What is SQLite?
In this post, we will discuss about SQLite – A Thin Relational Database.
SQLite is used in most of the applications which need less complicated relational database.
SQLite is embedded in every Android device and it provides phenomenal support to perform database operations in Android via in built Android APIs.
Here are the quick links:
What is SQLite?
SQLite is an Open Source database. SQLite supports standard relational database features like SQL syntax, transactions and prepared statements. The database requires limited memory at runtime (approx. 250 KByte) which makes it a light weight database to embed into other runtimes.
SQLite supports the data types TEXT (like String in Java), INTEGER (like long in Java) and REAL (like double in Java). All other types must be converted into one of these fields before getting saved in the database. SQLite itself does not validate if the types written to the columns are actually of the defined type, e.g. you can write an integer into a string column and vice versa.
SQLite is different from most other SQL database engines in that its primary design goal is to be simple:
- Simple to administer
- Simple to operate
- Simple to embed in a larger program
- Simple to maintain and customize
Features of SQLite
- Zero configuration – SQLite does not need to be Installed as there is no setup procedure to use it.
- Serverless – SQLite is not implemented as a separate server process. With SQLite, the process that wants to access the database reads and writes directly from the database files on disk as there is no intermediary server process.
- Stable Cross-Platform Database File – The SQLite file format is cross-platform. A database file written on one machine can be copied to and used on a different machine with a different architecture.
- Single Database File – An SQLite database is a single ordinary disk file that can be located anywhere in the directory hierarchy.
- Compact – When optimized for size, the whole SQLite library with everything enabled is less than 400KB in size
Advantages of using SQLite
Below are the advantages of using SQLite:
- There is no file parsing and no need to generate code to read/write/update the file.
- Content can be accessed and updated using powerful SQL queries, greatly reducing the complexity of the application code.
- Extending the file format for new capabilities in later releases is a simple as adding new tables or new columns to existing tables.
- Diverse content which might otherwise be stored as a “pile-of-files” can be encapsulated into a single disk file.
- The content can be viewed using third-party tools like Toad.
- The application file is portable across all operating systems, 32-bit and 64-bit and big- and little-endian architectures.
- The application only has to load as much data as it needs, rather than reading the entire application file and holding a complete parse in memory. Startup time and memory consumption are reduced.
- Small edits only overwrite the parts of the file that change, not the entire file, thus improving performance and reducing wear on SSD drives.
- Content is updated continuously and automically so that there is no work lost in the event of a power failure or crash.
- Performance problems can often be resolved using CREATE INDEX rather than redesigning, rewriting, and retesting application code.
Well Known Users of SQLite