Chapter 6. Databases

As a Linux application runs, all of the data used in the program resides in system memory. Once the application stops running, the data contained in the memory area is lost. The next time you start the application, none of the data from the previous session is accessible. Most data-handling applications require that data be available between different sessions of the application (called data persistence). Persistent storage of information is crucial to any application that must handle historical data, such as employee records, inventory information, or class grades.

This chapter describes two methods used for implementing data persistence in Linux programs. First, a method that utilizes a built-in database engine is demonstrated. Incorporating a built-in database engine in your application provides simple persistent data features without the overhead and administration of a separate database server. Next, a method that utilizes a full-featured open source database server is demonstrated. By using a database server, customers can access your data from anywhere on the network, or even the Internet.

Persistent Data Storage

The key to persistent data storage is being able to quickly retrieve stored data. Modern database theory utilizes many techniques and methods to provide for quick retrieval of data. There are many schools of thought on exactly how databases should be designed, configured, and operated. Fortunately, Linux provides products that cover a wide range ...

Get Professional Linux® Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.