3 ms·
Even if your disk speed is infinitely fast, or your using an in-memory thing like Redis, hitting the DB is almost always going to be slow-ish due to network lat
by tombert 7y ago
Even if your disk speed is infinitely fast, or your using an in-memory thing like Redis, hitting the DB is almost always going to be slow-ish due to network latency.
Redis is awesome badass rockstar tech, but I try and avoid it for any single-processe thing, instead opting for a tried-and-true global (thread-safe) hash table. Network packets aren't free, and no matter how cool your database is, I don't see you avoiding that. Not to mention that there is a cost to (de)serializing data, which you don't pay if you use something built into the language itself.
I'm not saying to go drop Redis (or any database/cache), just to keep this in mind.