Chapter 1. Introduction

 

Everything should be made as simple as possible, but not simpler.

 Albert Einstein

dbstreams is designed by the diligent for the lazy. It requires the bare minimum of typing and of database-y work. Its purpose is to move data between application memory and database with as little effort — human and machine — as possible.

dbstreams takes its name from std::iostreams because it conceives of a database connection as analogous to a file handle, and as a table to a file. Consider:

How is a database like a file?

How is a database not like a file?

The challenge is to take advantage of the similarity while honoring the difference.

Intuition is a measure of the familiar. If you know std::iostreams, and the dbstreams operations look familiar and predictable, we have succeeded. The only goal beyond that is that when the database presents a problem with no filesystem analog, the method offered is a plausible extension: clear, consistent, and easy to use.