Why it won
Consider a photo catalog that keeps track of albums, tags and import history. A folder of text files is easy to start and awkward to query when one photo belongs to three collections. SQLite gives the application joins and transactions while letting the user carry the catalog as a file. We selected it because the storage model fits the product people think they are using. Installing the photo app can be the entire setup process.
A practical workflow
Separate the image files from the catalog. Put photos, tags and their relationships in tables, then wrap each batch import in a transaction. A failed import can roll back as a unit. When you implement an export or backup, use SQLite’s backup interface to capture a consistent database, especially if the application still has the catalog open.
Where it falls short
The attractive single-file model has a concurrency limit. SQLite permits one writer at a time per database file. When many remote clients must write simultaneously, contention and coordinating network file access can erase the simplicity that made it attractive.
When to choose an alternative
Choose SQLite for an embedded catalog, cache or local analysis project. If many application servers share the same authoritative database and routinely write at once, start by evaluating a client/server engine such as PostgreSQL.
People and vision
- Founder or origin
- D. Richard Hipp
- Platform
- Embedded library and command-line tools
- Product vision
- Give an application a durable, queryable file of its own without requiring its users to install a database service.
Sources
- Where SQLite fitssqlite.org
- Project originswww2.sqlite.org
- Online backup APIsqlite.org
Reader reviews
Be the first to share how SQLite worked for you.
Sign in to write a review