---
title: "I Replaced Redis with PostgreSQL (And It's Faster)"
url: https://daily.dev/posts/i-replaced-redis-with-postgresql-and-it-s-faster--x7d3o8vu2
source_url: https://dev.to/polliog/i-replaced-redis-with-postgresql-and-its-faster-4942
type: article
source: "Lobsters"
published: 2026-01-12T01:24:56.571Z
updated: 2026-01-12T01:25:19.907Z
tags: ["performance", "database", "postgresql", "redis"]
reading_time: 12
upvotes: 742
comments: 61
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# I Replaced Redis with PostgreSQL (And It's Faster)

**[Lobsters](https://daily.dev/sources/lobsters)** · 12 min read · 742 upvotes · 61 comments

## Summary

PostgreSQL can replace Redis for caching, pub/sub, job queues, and sessions using UNLOGGED tables, LISTEN/NOTIFY, SKIP LOCKED, and JSONB. While PostgreSQL is 50-158% slower per operation (0.1-1ms difference), it eliminates network hops between databases, reduces infrastructure costs by ~$100/month, simplifies operations, and guarantees transactional consistency. The approach works best for small-to-medium apps with simple caching needs but isn't suitable for high-throughput scenarios (100k+ ops/sec) or applications requiring Redis-specific data structures like sorted sets or HyperLogLog.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://dev.to/polliog/i-replaced-redis-with-postgresql-and-its-faster-4942>

## Community discussion

Top comments from developers on daily.dev.

**@eugeneyaremenko** · 87 upvotes

> Cool. I'll ask Claude to do this on our prod 2day.

**@jzambrano12** · 18 upvotes

> What a great article and research!
>
> Is it possible that people use Redis because they don't know how to take advantage of PostgreSQL's strengths? I don't see the need for so much complexity for just 0.5ms.

**@ddhv** · 12 upvotes

> how can something be reduced by 150%?
>  ![GIF](https://media.tenor.com/MFE6UiMEpRoAAAAC/math-zack-galifianakis.gif)
>
>  math ...

**@byteoutlaw** · 8 upvotes

> Mastering PG in 2026 could be nice! :D<3

**@mcquiggd** · 5 upvotes

> You mention:
>
> "The pain points:
>
> Two databases to backup
> Redis uses RAM (expensive at scale)
> Redis persistence is... complicated
> Network hop between Postgres and Redis"
>
> Then your "solution" simply removes persistence:
>
> "UNLOGGED tables:
>
> Skip the Write-Ahead Log (WAL)
> Much faster writes
> Don't survive crashes (perfect for cache!)"
>
>
> You then admit it's slower.
>
> "Redis: 100,000+ ops/sec (single instance)
> Postgres: 10,000-50,000 ops/sec"
>
> Why don't you just read-through cache with Redis, like everyone else, and save yourself all this stress?

## Similar posts on daily.dev

- [How to Use PostgreSQL as a Cache, Queue, and Search Engine](https://daily.dev/posts/how-to-use-postgresql-as-a-cache-queue-and-search-engine-ykurnyxgc) · freeCodeCamp · 90 upvotes · 1 comments

---

Tags: [#performance](https://daily.dev/tags/performance), [#database](https://daily.dev/tags/database), [#postgresql](https://daily.dev/tags/postgresql), [#redis](https://daily.dev/tags/redis)

[View this post on daily.dev](https://daily.dev/posts/i-replaced-redis-with-postgresql-and-it-s-faster--x7d3o8vu2)
