Hacker News new | ask | show | jobs
by timojeajea 1890 days ago
Even though Redis might be 16 times faster than PostgreSQL at reading JSON blobs, it doesn't mean that it is using 16 times less CPU doing so.

A while ago I benchmarked Redis vs PostgreSQL and I was initially fooled by the difference in query time. But after a deeper investigation, I realised that, even though each individual PostgreSQL request was slower, the maximum request per second when the CPU is maxed to 100% usage was pretty similar between Redis and PostgreSQL. I was benchmarking a count query with a multi-column partial index, so this might not translate at all for reading json blobs. But I think with those kind of bechmarks, one need to be very careful and shouldn't jump to conlusions that easily.

If the authors concern really is the 10ms difference it makes for each individual request, then the benchmark makes sense. But if the concern is to make the best out his server's hardware, I think his benchmark needs more work. no conclusion can be drawn at this point.