3 ms·
> My understanding is that Redis is fast because it writes and reads from memory. Postgres is slower because it ensures writes are persisted to disk before resp
by anarazel 5y ago
> My understanding is that Redis is fast because it writes and reads from memory. Postgres is slower because it ensures writes are persisted to disk before responding (among other reasons).
If you don't need transaction commits to be durable, you can turn that off in postgres, on a per-transaction/connection/user/database basis. E.g.
BEGIN;
SET LOCAL synchronous_commit = off;
/* bunch of writes */
COMMIT;
will, just for that one transaction, not wait for transaction commits to be flushed to disk. Can be very useful for not-that-important data...