We don't need a database if we can just load the application state in RAM and save it back via serialization. This works well in surprisingly many cases.
We don't need a database if we can just load the application state in RAM and save it back via serialization. This works well in surprisingly many cases.
[1] Common Lisp has a particularly nice system for doing it transparently, http://common-lisp.net/project/elephant/, and I believe HN is implemented using a DB-via-serialization strategy as well
Actor systems allow this to scale and cross the machine boundary without having some dedicated database product doing it for us.
I've noticed that the more I work with actor systems (each actor is stateful and keeps its own state), the less I use databases.
In fact, the idea of keep state separate from the code reading it and changing it begins to look oddly broken as a concept.
However not all of your state will be persistent, so you write only the persistent parts.
For example, if you need to have an index for quick access to items based on some criteria, you don't need to store the index on disk, you can always rebuild it on startup from the rest of the data.
While there's an upper limit for the amount of data you can store this way (it has to fit in RAM), it fits very favorably in web scenarios, where you have read-heavy write-light data access patterns, and you never have to touch the disk in order to read a piece of data (guaranteed).