Using SQLite database files as the native application data format

Richard Hipp, the creator of SQLite, was giving a talk titled "An Introduction to SQLite" at Google in May 2006. His talk has been recorded and is available online.

Although the talk lacks a clear structure in my opinion, it presents a very interesting idea for applying SQLite: the use of SQLite database files as application data files.

Briefly summarized, SQLite is a small SQL database engine, that stores the database in files. SQLite is not a distributed client-server database server, but is a small library, that can be embedded directly into the application. The whole database data is stored in a single file, that is even portable between different architectures.

A very interesting application of SQLite suggested by Hipp is to directly use this SQLite database file as the native datafile for an application. Using an SQL-based database for application data is particularly interesting if the data-sets are large and if complex queries need to be performed. The use of SQL lets the programmer focus on the data and relieves him from implement the algorithms for storing, retrieving and filtering of data.

Hipp points out the following advantages of SQLite as the application data format:

  • no need to build up complex data structures in your application (all data is stored in the DB, query the DB according to your needs)
  • efficient data access (specify what data you want, let SQLite optimize storage and retrieval process)
  • cross-platform and cross-application database file
  • applications can be written in different languages.
  • bindings for many programming languages exist (some bindings allow for implementing persistent data storage with little effort)
  • guaranteed data integrity and atomic transactions
  • SQLite is very well tested

I think that this unconventional idea for application data storage really has some convincing advantages. In particular it allows to implement efficient data storage, while keeping the data accessible for other applications.

Written December 1st, 2006