Skip to content

Creating hundreds of SQLite Databases per Node.js server #388

Answered by ddevienne
kof asked this question in Q&A
Discussion options

You must be logged in to vote

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 :)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants