Comment on Why are (rational) databases preferred over keeping the data in memory?
corytheboyd@kbin.social 1 year ago
Like everyone has mentioned, because you want the data to persist across program runs. By all means, use in-memory state for truly ephemeral things like caches. You will need both for any real world task.
One more unmentioned reason to use a database, even if the persisted set off data is small, is the query engine. SQLite is absolutely perfect for such small tasks. Writing SQL to query the data can save you from tons of waste fully repetitive app code.
lysdexic@programming.dev 1 year ago
RDBMS do not imply persisted data. There are plenty of databases which support or are designed explicitly to work as in-memory data stores. Perhaps the most popular one is SQLite, whose in-memory store is widely used.