Reputation: 14691
What is a memory database? Is sqlite a memory database? On this mode, does it support persistence data to a local file?
Upvotes: 5
Views: 7032
Reputation: 1870
SQLite supports memory-only databases - it's one of the options. It is useful when persistence is not important, but being able to execute SQL queries quickly against relational data is.
The detailed description of in-memory databases: https://www.sqlite.org/inmemorydb.html
Upvotes: 0
Reputation: 137597
An in-memory database supports all operations and database access syntax, but doesn't actually persist; it's just data structures in memory. This makes it fast, and great for developer experimentation and (relatively small amounts of) temporary data, but isn't suited to anything where you want the data to persist (it's persisting the data that really costs, yet that's the #1 reason for using a database) or where the overall dataset is larger than you can comfortably fit in your available physical memory.
SQLite databases are created coupled to a particular file, or to the pseudo-file “:memory:
” which is used when you're wanting an in-memory database. You can't change the location of a database while it is open, and an in-memory database is disposed when you close its connection; the only way to persist it is to use queries to pull data out of it and write it to somewhere else (e.g., an on-disk database, or some kind of dump file).
Upvotes: 10