Keeping data in memory instead of using databases

This is exactly how Prevayler works. You have a singleton “Repository” class which contains just collections, objects etc… You can access it for reading just as regular Java/kotlin objects, that’s why it is so fast. It uses a command pattern to modify data which somehow ensures ACID because commands are immediately serialized. This is actually quite smart.
Like this:

object Repository {
   var users: MutableList<User>;
}
1 Like