Note that PostgreSQL is "aggressively, deliberately under-'optimized'" by default. So shared buffers (roughly, the memory area used for caching) is limited to 128 MB. I think it's likely that other software doesn't have such aggressive default memory limits, so yeah, comparisons with untuned Postgres wrt. other untuned software *can* be hugely misleading.
Even then I'd expect Redis to be faster in this specific example, or even that if you profile, neither Redis/Postgres are the bottlenecks there (you are using Django's ORM and caching subsystem that are wildy different code path), so just take my comment with a pinch of salt.
And everyone else, take quick benchmarks with salt and the whole spice rack.
The Redis isn't perfectly configured either. Maybe if PG was better configured, the difference would be 14x instead of 16x.
They aren't both apples. It's two different databases with their individual strengths and weaknesses. But you can use them for very similar applications, so it helps to be fully aware of their characteristics.
Comment
Note that PostgreSQL is "aggressively, deliberately under-'optimized'" by default. So shared buffers (roughly, the memory area used for caching) is limited to 128 MB. I think it's likely that other software doesn't have such aggressive default memory limits, so yeah, comparisons with untuned Postgres wrt. other untuned software *can* be hugely misleading.
Even then I'd expect Redis to be faster in this specific example, or even that if you profile, neither Redis/Postgres are the bottlenecks there (you are using Django's ORM and caching subsystem that are wildy different code path), so just take my comment with a pinch of salt.
And everyone else, take quick benchmarks with salt and the whole spice rack.
Parent comment
The Redis isn't perfectly configured either. Maybe if PG was better configured, the difference would be 14x instead of 16x. They aren't both apples. It's two different databases with their individual strengths and weaknesses. But you can use them for very similar applications, so it helps to be fully aware of their characteristics.