-
If this question is very stupid I am sorry :) The idea is to give an own SQLite database to each "user", where one Node.js server can handle hundreds of "users". Is that something you would do? Bonus question: is it possible to use litestream with "in memory" sqllite setup? This would allow using sqlite as a way for quickly accessing the data from memory, but I still need replication and failover. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Litestream is based on a separate process accessing the disk and WAL mode, both of which are incompatible with in-memory DB, so definite no to your second question. As to a DB per user, seems excessive to me, but you chould shard your user DBs based on a hash of the user name or ID for example, and have 16, 64, 256, etc... user DBs (a fixed number), to achieve better concurrency of writes, at the expense of complexity and possibly performance. Definitely not the first choice I'd go for. Start simple (single user DB), and complexify as actual metrics show it is necessary :) |
Beta Was this translation helpful? Give feedback.
Litestream is based on a separate process accessing the disk and WAL mode, both of which are incompatible with in-memory DB, so definite no to your second question. As to a DB per user, seems excessive to me, but you chould shard your user DBs based on a hash of the user name or ID for example, and have 16, 64, 256, etc... user DBs (a fixed number), to achieve better concurrency of writes, at the expense of complexity and possibly performance. Definitely not the first choice I'd go for. Start simple (single user DB), and complexify as actual metrics show it is necessary :)