einsteinx2/WaveBox

Move User table into a separate db file or flat file

einsteinx2 opened this issue · 4 comments

Right now, for every API call, we're forced to do a select before we can process it, even if it's not database related. Since sqlite3 locks on writes, this is introducing unnecessary lag, and causing things like logins to fail during database busy situations.

We should either move the User table into a separate db file, or use a flat file similar to the linux passwd file.

Y'know, I was actually just thinking about this the other day too. Sharding the Users table would probably be of benefit for us. If we don't need many joins or anything, we should investigate if a flat file would be faster than using a sqlite database.

Alternatively, if we could find a way to load the table into memory, since it should be pretty small, that would probably work too.

Haha I was just thinking that, ya it would be better to just load all users into an array and do all checks against that. Then we can keep the db simple.

User and session repositories are now mem cached