anaboo.ai
Anaboo AI hero graphic titled Redis vs Postgres, with a purple Postgres card labelled long-term memory and an orange Redis card labelled short-term memory
← All posts

Redis vs Postgres, explained simply (with a real Instagram example)

5 June 2026Brett Alegre-Wood5 min read
RedisPostgresPostgreSQLdatabases explaineddata layerAI app architecturecaching
Listen to this article0:00 / 5:05
Two AI hosts discuss this article. Generated from the text.Download

TL;DR

Redis and Postgres are both ways to store data for apps, but they work in completely different ways. Postgres is your long-term memory: a careful, organised filing system that never forgets, but is a little slower because it's being so thorough. Redis is your short-term memory: data kept in RAM so it's lightning fast, but temporary and easily wiped. Real apps use both together, Postgres as the storage that never forgets and Redis sitting in front of it so everything feels instant.

The simplest way to think about it

You probably keep hearing both names and wondering why an app needs two different ways to store data. Here's the version that actually sticks.

Postgres is long-term memory. Slower, but trustworthy, and brilliant at organising complex information.

Redis is short-term memory. Lightning fast, but temporary.

That's the whole idea. Everything else is detail. Let's make each one concrete.

What Postgres actually is

Postgres (its full name is PostgreSQL) is like a giant, super-organised spreadsheet system. Imagine a filing cabinet where everything has its proper place, labelled and connected.

If you're building an online store, Postgres remembers your users, their orders and their addresses, and it can answer complicated questions like "show me everyone who bought sneakers last month and lives in Texas." It's reliable and careful: it doesn't lose your stuff, and it makes sure the data stays correct. The tradeoff is that it's a bit slower, because it's being so thorough.

Postgres illustrated as long-term memory, a purple database that is organised, reliable and never forgets

Postgres is the part of an app that never forgets.

What Redis actually is

Redis is like sticky notes on your desk that you can grab instantly. It keeps data in memory (RAM) instead of on a hard drive, which makes it crazy fast. But memory gets wiped easily, so it's not built for the stuff you need to keep forever.

You use Redis for things you need right now: keeping someone logged in, remembering what's in a shopping cart for the next ten minutes, or showing a leaderboard that updates live. When the data doesn't need to survive a restart, Redis is the perfect home for it.

Redis illustrated as short-term memory, orange sticky notes with a lightning bolt, instant but temporary and easily wiped

Redis is the part of an app that's instant but forgetful on purpose.

Start here

See where AI fits in your business. Free.

A 45-minute audit. We map the highest-value automations and what they're worth in time and money. No pitch, no pressure.

How Instagram uses both at the same time

This is where it clicks. Take something like Instagram and watch the two work side by side.

When you open the app and look at someone's profile, the permanent facts live in Postgres: the account, every photo and caption they've ever posted, who follows whom, the comments. None of that can ever be lost, so it belongs in the long-term memory.

But the moment you load that profile, the app needs to feel instant, and asking Postgres to recount the exact follower number for a huge account on every single view would be slow and wasteful. So the app keeps the hot stuff in Redis: the follower count it just calculated, your logged-in session, the feed it assembled for you a moment ago. Next time it's needed, the app grabs it from Redis in a blink instead of bothering the database again.

Diagram of how an app uses both: the app talks to Redis for fast, temporary data, and Redis sits in front of Postgres which is the permanent source of truth

Redis sits in front so the app feels instant. Postgres sits behind so nothing is ever lost.

The pattern is always the same: Postgres is the source of truth, Redis is the speed layer in front of it. When Redis doesn't have the answer, it asks Postgres once, hands it to you, and remembers it for the next few people who ask.

How a live game uses both

A multiplayer game tells the same story from a different angle.

The things that must survive forever go in Postgres: your account, what you've unlocked, your purchase history, your stats. Lose those and players riot.

The things that change every second go in Redis: the live leaderboard ticking up as people score, who's currently online, the state of a match in progress. A leaderboard might update thousands of times a minute, and writing every change to a careful on-disk database would be painful. Redis handles that churn effortlessly because it's all in memory. When the match ends, the final result gets written back to Postgres so it's remembered for good, and the temporary stuff is allowed to disappear.

Why this matters when you build with AI

You don't need to write a line of code to benefit from understanding this, and it matters more than ever now that so many businesses are building their own AI tools.

Almost every AI app sits on the same two ideas. The things the AI must never forget, your customer records, your documents, the history of every conversation, belong in a real database like Postgres. The fast, throwaway things, a login session, a rate limit, or a cached answer so you don't pay to run the same expensive query twice, belong in Redis.

When someone quotes you to build a tool, knowing the difference lets you ask the right question: where does our permanent data live, and what are we caching to keep it fast? That single question separates a system you can trust from one that quietly loses data or burns money repeating work it already did.

What to do this week

  • Ask where your truth lives. For any app or tool you rely on, find out which system is the permanent record. That's your Postgres-shaped layer, and it's the thing you must be able to back up and export.
  • Ask what's being cached. If something feels instant, something is probably caching it. Knowing what's temporary tells you what's safe to lose and what isn't.
  • Don't pay for speed you don't need yet. A simple tool runs fine on a database alone. Add a Redis-style speed layer when you actually feel the slowness, not before.
  • Write the question down. "Where does our permanent data live, and what are we caching?" Keep it handy for the next time someone proposes building you something.

Where to from here

If you're weighing up an AI tool for your business and want a plain-English read on whether it's built on solid foundations, book a free 60-minute AI audit. We'll look at where your data lives, what's worth keeping, and where to start, so you build on a stack you can actually trust.

Live with passion & AI,

Brett

Podcast

Host a podcast? Have Brett on as a guest.

Straight talk on implementing AI in real SMEs, no jargon, plenty of receipts from the businesses we run.

Frequently asked questions

What is the main difference between Redis and Postgres?

+

Postgres stores data on disk and is built to keep it safely forever, so it's your long-term memory: slower, but reliable and great at answering complicated questions. Redis keeps data in memory (RAM), which makes it lightning fast but temporary, so it's your short-term memory: perfect for things you only need for the next few minutes. Most real apps use both, with Postgres as the source of truth and Redis sitting in front of it as a speed booster.

Can Redis replace a database like Postgres?

+

For most apps, no. Redis is fast because it holds data in memory, but memory gets wiped when the server restarts, so it's the wrong place for anything you need to keep, like users, orders or payments. Redis is brilliant as a layer in front of a real database, not as a replacement for one. The usual pattern is Postgres for permanent storage and Redis for the hot, short-lived stuff.

Why is Redis so much faster than Postgres?

+

Redis keeps its data in RAM, which a computer can read far faster than a hard drive or SSD. Postgres writes everything to disk and does extra work to guarantee your data stays correct and never gets lost, and that carefulness costs a little speed. So you trade Postgres's safety for Redis's raw speed, which is exactly why apps use each one for the job it's best at.

Do I need both Redis and Postgres for my project?

+

Not always. A simple app can run perfectly well on Postgres alone. You reach for Redis once speed becomes a problem, for example a page that's slow because it asks the database the same heavy question thousands of times, or a feature like a live leaderboard or a login session that needs to be instant. Add Redis when you feel the pain, not before.

How does this relate to building with AI?

+

Almost every AI app sits on top of the same two ideas. Postgres (or a database like it) is where you keep the things the AI must never forget, your customer records, documents and history. Redis is where you keep the fast, throwaway stuff, like a session, a rate limit, or a cached answer so you don't pay to run the same query twice. Understanding which is which helps you ask better questions when someone builds something for you.

Brett Alegre-Wood, founder of Anaboo
About the author
Brett Alegre-Wood

Brett is a four-time founder (Darra Tyres, Gladfish, EzyTrac, Anaboo) and the operator behind AIOS, Anaboo's AI Operating System. He writes from inside the build, installing AI in his own businesses first and reporting back what actually moves the numbers. Based between Singapore, the UK and Australia.

WE USE AI: All images are made with programmatic AI (a prompt is used rather than real photos) so when you meet Brett and the team they may look slightly different from these images. This is done to show you what's possible.

Want Augment AIOS in your business?

Free 60-minute audit. We'll show you what's worth automating first.