惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

宝玉的分享
宝玉的分享
H
Hackread – Cybersecurity News, Data Breaches, AI and More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
小众软件
小众软件
月光博客
月光博客
D
DataBreaches.Net
L
LangChain Blog
美团技术团队
S
SegmentFault 最新的问题
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
博客园 - 司徒正美
aimingoo的专栏
aimingoo的专栏
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
H
Help Net Security
阮一峰的网络日志
阮一峰的网络日志
Y
Y Combinator Blog
I
InfoQ
U
Unit 42
Microsoft Azure Blog
Microsoft Azure Blog
J
Java Code Geeks
博客园 - 三生石上(FineUI控件)
腾讯CDC
Martin Fowler
Martin Fowler

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
You might not need Redis: a DB table and your filesystem ...
Schiff Heimlich · 2026-06-24 · via DEV Community
Cover image for You might not need Redis: a DB table and your filesystem do more than you think

Schiff Heimlich

Had yet another conversation yesterday with a team burning themselves on a Redis cache misconfiguration. Hot keys, thundering herd, memory policy oversights — the usual scars. One of the replies on the HN thread mentioned something that keeps showing up in these discussions: they just use a database table + filesystem, no Redis, no Memcached.

Sounded like a lazy joke. It isn't.

The setup

You already have a database. You already have a filesystem. You can build a perfectly functional caching layer with both.

The database table looks something like:

CREATE TABLE cache_entries (
  cache_key   TEXT PRIMARY KEY,
  expires_at  TIMESTAMPTZ,
  computing   BOOLEAN DEFAULT FALSE
);

The filesystem holds the actual cached values — call them /var/cache/myapp/<key>. Reads check the filesystem first; if the file is stale or missing, the DB is consulted.

What you actually get

Thundering herd protection. This is the part teams reach for Redis for, and it's the easiest win. Use a database row lock — SELECT FOR UPDATE — so that when a cache miss hits, only one process computes the result while others wait. Postgres handles this fine. The filesystem doesn't need to know about it.

Coordinated expiration. The DB holds the TTL. Workers can query expires_at before even touching the filesystem, so you don't serve stale content.

No extra daemon. No Redis process to babysit, no persistence configuration to get wrong, no memory limit to tune.

Persistence you actually control. The filesystem is on disk. If you want to survive restarts, you already have that. You don't have to configure appendfsync always and pray.

The part that bites

This is not Redis. If your cache layer needs to be shared across many application servers, you're back to a central store — the DB becomes that bottleneck and you haven't actually solved anything. This pattern works best on a single server or when the DB is already the shared coordinator anyway.

For high-TPS workloads (thousands of cache reads per second from many nodes) you'll still want something designed for the job. But most internal tooling, sidekiq-style job caching, and slow-query caching isn't that workload.

When it's worth considering

  • You're already running a database
  • Your cache is per-server or your DB is already shared
  • You want to reduce operational dependencies
  • You're building something that doesn't need Redis' data structures

The comment that stuck with me from the thread: "Using a db table as a k/v store + the FS can do so much before even considering paying the price of setting up a dedicated caching store."

He's right. The boring choice is boring for a reason.