Thursday May 02, 2013

SQLite: The File Format Of The Future

After I got the latest version of Acorn, one of the awesome indie image editing suites for OS X, I was catching up with Gus Mueller’s blog and came across an awesome post a few days ago about his use of SQLite as the file format for the app. You read that right…Acorn uses SQLite to store images and metadata.

Acorn has been using SQLite as its native file format since version 2.0, and it has been wonderful. When writing out and reading in an image I don’t have to think about byte offsets, I mix bitmap and vector layers together in the same file, and debugging a troubled file is as simple as opening it up in Base or your preferred SQLite tool. This sure beats opening a PSD file in a hex editor to figure out what’s going on.

This is a marvelous simple and real world example of how to leverage what SQLite does well: atomic, transactional, and incremental data storage. Sound familiar? This is why Core Data uses it, too…and why you shouldn’t think of Core Data as an ORM for SQLite. It merely uses SQLite for data storage because it kicks ass in general.