4 ms·
It sounds like this was more of a tip to always test your assumptions, rather than an serious attempt as a benchmark. It does its job in that respect, but ther
by jamiesonbecker 11y ago
It sounds like this was more of a tip to always test your assumptions, rather than an serious attempt as a benchmark. It does its job in that respect, but there's so much more to both of these servers than the test case.
It sounds like OP wrote a for loop in Python but was surprised that the Redis one was only marginally faster. Nearly all of the speed loss would have been in that loop, not in either server. Both servers are so fast that all of the latency was in the mechanics of a sequential for loop.
Postgresql is awesome for so many things, and certainly so is Redis, but those are really two distinct sets with very little intersection. Knowing when to use each is something that a good architect intuitively grasps. (these two in particular complement each other very well.)
Always test your assumptions within your specific use case, and don't embark on performance optimizations until you've solved all of your other requirements first.