Make Replit DB 30x-50x Faster on Nodejs with just One Line
The Line Change:
require('better-replit-db') in your JS file.
How/Why it Works
I recently decided to fork the Replit DB client to add a feature which I thought would greatly improve it: a memcache.
The idea is that instead of every read and write being a get/post request to the actual database, everything is done through a dictionary stored in ram. To then make sure data persists, every write also writes to the DB, but asynchronously. This allows for the program to continue on without having to wait for the request to resolve, therefore increasing speed.
Any recommendations for what I should add, let me know!
P.S. I plan on adding the same feature set to forks of other Replit DB libraries.