6 votes

How much faster is Redis at storing a blob of JSON compared to PostgreSQL?

1 comment

  1. spit-evil-olive-tips
    Link
    Holy apples-to-oranges comparison Batman! This starts to get at the real problem with the comparison, but only really scratches the surface. Redis is inherently an in-memory data store, with...

    Holy apples-to-oranges comparison Batman!

    That extra RAM usage pretty much sums of this whole blog post; of course it's faster if you can rely on RAM instead of disk.

    This starts to get at the real problem with the comparison, but only really scratches the surface.

    Redis is inherently an in-memory data store, with optional asynchronous persistence to disk. This means that when your data is written to Postgres, it's been actually written to disk before your query returns. That's not true with Redis. By default, for example:

    With the default policy of fsync every second write performances are still great

    So Redis is batching up writes and only flushing them to disk once per second, at least by default. This works great for many use cases (including the author's, from his description of it) but isn't really comparable to Postgres or any other ACID database.

    Also, he's testing with a modern Postgres (11.4) but with a 3 year old version of Redis (3.2.1, released in June 2016).

    5 votes