frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

In praise of memcached

https://jchri.st/blog/in-praise-of-memcached/
77•j03b•3h ago

Comments

abofh•2h ago
Oh God I'm tired of ai written thought pieces
poly2it•2h ago
I don't see how this is AI-written?
newfocogi•2h ago
I don’t think LLMs would write this:

“Anyways, Redis homepage aside, you deploy it, and off you go - your trusty cache. You hand the connection string to the people who asked for it, and off you go.”

newfocogi•2h ago
Or this:

“None of these things are impossible with Redis, it’s just that memcached’s architecture in general more leans towards these directions, which makes it much, much more straightforward from an operations point of view.”

chipotle_coyote•1h ago
It's become de rigueur on HN to accuse any article one thinks is trite, obvious, or simply disagreeable of being AI-written. ("That comment has three items in a list! No human would ever put three items in a list! Checkmate, bot!")
abofh•1h ago
So many it's not X it's Y. It might have been polished, but it was claude
throw310822•1h ago
Somebody call Deckard.
hoppoli•1h ago
I see this comment frequently in this site and it doesn't provide any value. If this isn't part of the hackernews rules, I hope it becomes one soon.
kijin•2h ago
Redis works great as a cache, but there are a few things you need to do in order to use it reliably as a cache.

1) Wrap your client library so that it's impossible to store anything without an expiry date. You don't want 6-months-old data suddenly coming up in your app!

2) Either turn off persistence, or use a separate database for the cache. In other words, don't mix volatile data with stuff you actually care about.

3) Set up a reasonable maxmemory value with an appropriate maxmemory-policy, so that Redis doesn't eat up all your RAM.

4) Resist the urge to use complex data structures. If you try to update a single field on an expired hash, you will end up with an incomplete object.

If you don't want all that hassle, then yes, Memcached probably works better out of the box.

dvt•1h ago
> 1) Wrap your client library so that it's impossible to store anything without an expiry date. You don't want 6-months-old data suddenly coming up in your app!

No need for this client-side complexity, as you should be using `allkeys-lru`. FWIW, should likely be doing this anyway, as (generally speaking) all data stored in Redis is usually regarded as volatile because of what Redis actually is.

kijin•38m ago
> as (generally speaking) all data stored in Redis is usually regarded as volatile because of what Redis actually is.

If you know this already, then you didn't need to read OP or any of this thread. :)

The problem is that Redis tries very hard to position itself as a persistent data store, with defaults that lean toward persistence (no default eviction policy). Beginners need to fight the defaults every step of the way if all they want is a cache.

dvt•2h ago
Memcached is meant to be a lightweight memory cache, which makes sense, but contrary to the article's claim that "Redis is brought into a stack as a cache, and it is run with the assumption that people treat it that way"—I have very very rarely experienced this. Redis is brought into a stack because (most importantly!) it's fast and (almost as importantly!) because it's simple. I don't think this article is written by AI, but (and I'm trying to be charitable here), it's just like.. dumb.

> Dealing with memcached downtime is incredibly easy, because client libraries generally ignore connection exceptions. For instance, a simple get will just return the default value (or none) if the server is down.

This is a terrible idea in the context of things that might use Redis. If you use Redis with some kind of complex state (say, a document if you're working on a Notion clone, for instance), wtf even is a "default value"? In fact, I actually also want to know when the thing is down.

> Clustering memcached is wonderful, because memcached actually has no clustering built-in.

Yeah bro, this is yet another one of the reasons people use Redis: it handles consensus and clustering for you. What even is this article? It's a master class in straw-manning architectural decisions: most people use hammers as hammers, but screwdrivers make great hammers too, especially if you also need to screw stuff in! I mean.. technically true?

foobarian•1h ago
The memcache slab pools are a leaky abstraction that you may end up having to manage operationally, and it's another way Redis is simpler.
groundzeros2015•1h ago
> it handles consensus and clustering for you

Considering how complex and error prone this is, I don’t want it in my stack.

jszymborski•1h ago
jszymborski•1h ago
An article praising memcached and no mention of the feral bunny mascots.
abound•1h ago
> And look at those cute little mascots at the top!
jszymborski•31m ago
My bad!
tempest_•1h ago
I stopped using memcached a decade a go in favour of Redis and now use valkey.

Never felt the need to go back to memcached except when a legacy dependency needed it.

jimbokun•1h ago
OK.

What do you think of the argument made in the article?

tempest_•43m ago
I don't want my cache to silently fail.

Clustering redis is not that hard even if you do it manually and I have only had to do it once.

I never use redis persistence and have a max size set with LRU or whatever the application requires.

With memcached I remember having to mess around the LD_LIBRARY path to link whatever python module I was using at the time

crabmusket•6m ago
> silently fail

Mature ops would be tracking cache hit ratios right?

It sounds like memcached would be really good in a use case where you really just need an optional stateless pure cache with absolutely zero rope to hang yourself on. A use case where "cache hit ratio" is the goal, not "fiddly in-memory data store".

kylewpppd•47m ago
I think I've seen all of the Redis/Valkey issues the author mentioned in production.

* Outages where Valkey had no memory policy, ate all the memory, and then caused write errors to its append-only file. Bonus points for another one where the disk itself was full, and AOF writes failed.

* 500s where Redis was fully expected to be live, running, and populated with data for every user, and no fallback to a slower path.

* Creative uses of sorted sets and other data structures which depended on the sets never being evicted.

Despite the observations from the field, I think it's still hard to recommend memcache ahead of Redis. It can be difficult to architect an app to have a memcache-friendly cache layout.

I'd almost guarantee a large enough team using memcache will find a way to need Redis. And then we're maintaining 2 cache technologies.

> wtf even is a "default value"?

The article mentions the default value is a null, which would be the cue to run whatever computationally expensive op or query the db or hit the disk etc... that you would normally run if you had no cache to begin with.

> but screwdrivers make great hammers too

I don't know what your screwdrivers look like but that sounds like a rough time.

sethherr•37m ago
Generally you can use the back of a screwdriver like a hammer.

It works pretty well when you need to hit something with a solid object a couple times.

bch•13m ago
Sounds like a trip to the hospital.

Steam Machine launches today

https://store.steampowered.com/news/group/45479024/view/685257114654870245
1346•theschwa•11h ago•1213 comments

GLM-5.2 – How to Run Locally

https://unsloth.ai/docs/models/glm-5.2
253•TechTechTech•7h ago•112 comments

In praise of memcached

https://jchri.st/blog/in-praise-of-memcached/
80•j03b•3h ago•27 comments

VibeThinker: 3B param model that beats Opus 4.5 on reasoning with novel SFT+GRPO

https://arxiv.org/abs/2606.16140
48•timhigins•2h ago•18 comments

An Introduction to YOLO26

https://blog.roboflow.com/yolo26/
20•teleforce•2h ago•0 comments

Polymarket has flooded social media with deceptive videos by paid creators

https://www.wsj.com/business/media/polymarket-social-media-bets-prediction-market-441cdeb5?st=HhTZY2
89•Vaslo•2d ago•90 comments

Will It Mythos?

https://swelljoe.com/post/will-it-mythos/
3•mindingnever•15m ago•0 comments

Cyberdecks, going analog, and convivial technology

https://blog.hydroponictrash.solar/cyberdecks-going-analog-and-convivial-technology/
68•akkartik•3d ago•30 comments

Optocam Zero: a Pi Zero based digital camera made using off the shelf components

https://github.com/dorukkumkumoglu/optocamzero
130•iamnothere•9h ago•31 comments

My Mathematical Regression

https://blog.dahl.dev/posts/my-mathematical-regression/
239•aleda145•3d ago•88 comments

Japanese symbols that speak without words

https://arun.is/blog/japan-symbols/
134•msephton•9h ago•56 comments

Windows NT for GameCube/Wii

https://github.com/Wack0/entii-for-workcubes
35•zdw•3d ago•7 comments

1,700 free online courses from top universities

https://www.openculture.com/freeonlinecourses
100•momentmaker•2h ago•20 comments

Giant Banana Pulled Over: Driver Says Cops Have Stopped Him 100s of Times

https://cowboystatedaily.com/2026/06/18/giant-banana-pulled-over-in-montana-driver-says-cops-have...
10•speckx•2d ago•1 comments

Moebius: 0.2B image inpainting model with 10B-level performance

https://hustvl.github.io/Moebius/
251•DSemba•14h ago•65 comments

Is it time for a new Embedded Linux build system?

https://yoebuild.org/blog/time-for-a-new-build-system/
51•cbrake•4d ago•36 comments

Canada plans 'nuclear renaissance' with up to 10 reactors built by 2040

https://www.cbc.ca/news/politics/federal-nuclear-strategy-9.7244509
375•geox•9h ago•227 comments

British Columbia, Time Zones, and Postgres

https://www.crunchydata.com/blog/british-columbia-and-time-zone-changes
124•sprawl_•9h ago•82 comments

Show HN: Oak – Git alternative designed for agents

https://oak.space/oak/oak
163•zdgeier•12h ago•154 comments

Package Managers need global hooks

https://captnemo.in/blog/2026/06/17/package-managers-need-hooks/
7•evakhoury•4d ago•1 comments

Kyber (YC W23) Is Hiring a Head of Engineering

https://www.ycombinator.com/companies/kyber/jobs/FGmI8mx-head-of-engineering
1•asontha•7h ago

Canyon HUD helmet for road riding

https://media-centre.canyon.com/en-INT/266866-new-canyon-heads-up-display-helmet-could-be-a-safet...
77•zh3•2d ago•91 comments

Flock-Powered Police Chiefs Stalking Women Shows Why Warrants Are Needed

https://ipvm.com/reports/police-chiefs-track
434•jhonovich•9h ago•176 comments

Show HN: Pagecast – Publish Markdown/HTML Reports to Cloudflare Pages

https://github.com/Amal-David/pagecast
37•amaldavid•4d ago•9 comments

ytr: YouTube Radio for Emacs

https://xenodium.com/ytr-youtube-radio-for-emacs
75•xenodium•7h ago•8 comments

Job application asked for my SAT scores

https://mrmarket.lol/job-application-asked-for-my-sat-scores/
109•seltzerboys•7h ago•270 comments

Help I accidentally a wigglegram

https://lmao.center/blog/wiggle-accidents/
504•gregsadetsky•3d ago•120 comments

Prompt Injection as Role Confusion

https://role-confusion.github.io
166•x312•12h ago•89 comments

Show HN: Got sick of ads, so I made my own logic puzzle site

https://puzzlelair.com/
157•HaxleRose•16h ago•105 comments

Ultralytics YOLO26: Unified Real-Time End-to-End Vision Models

https://arxiv.org/abs/2606.03748
10•teleforce•2h ago•0 comments