Persistence is all too often the drudge work of any project. It’s fun to design and develop an application, but when it comes time to figure out how to store and fetch data to and from persistent (or long-term) storage, the work can get complicated, unruly, and downright aggravating.
In most cases, you don’t need to “roll your own” persistent storage engine. Instead, you can pick from a number of different databases that are out there, some of which may already be installed on your Linux system.
Generally speaking, there are four different types of databases available on Linux: key/value, relational, object-oriented, and XML. Each has strengths and weaknesses. When choosing a database you should consider whether it:
Can handle simultaneous access from multiple users
Can be easily accessed from programs written in different languages (especially object-oriented languages)
Can handle large amounts of data
Can ensure that multiple operations either all happen at once, or not at all (”transactions”)
Can perform complicated searches (”queries”)
To help compare the different types of databases, let’s imagine that we need to store data about employees, projects, and what project(s) each employee is working on. As we examine each type of database to see how it stores this information, we’ll point out its respective strengths and weaknesses.
Key/Value Databases
Key/value databases are the simplest form of databases and store data in key/value pairs. Each key (such as an employee’s…
Please log in to view this content.
Not Yet a Member?
Register with LinuxMagazine.com and get free access to the entire archive, including: