December 18, 2023
-
3
Min Read

ElastiCache Serverless has a hidden feature: Memcached replication

Redis is no longer the only way for ElastiCache users to get automatic replication across availability zones.
Daniela Miao
Khawaja Shams
Headshot of the blog author
by
Daniela Miao
,
Khawaja Shams
,
by
Daniela Miao
by
Khawaja Shams
Daniela Miao
,
Khawaja Shams
,
Caching

The ElastiCache Serverless launch has gotten a ton of visibility (and debate on how serverless it is)! There are two key insights that I feel are easily overlooked: first, S3 One Zone Express may be a better serverless cache in certain scenarios than ElastiCache Serverless. Second, with the launch of ElastiCache Serverless, Amazon silently released replication for Memcached! This is a bigger deal than it may appear.

What is Memcached?

Memcached is a hyper-optimized key-value store. It is multi-threaded and scales incredibly well. It is typically underappreciated when compared to the visibility of Redis, but it is hard to beat on performance, tail latencies, and scale. Some of the biggest companies in the world are running their caching fleet entirely on Memcached or a variant of it, including but not limited to Facebook, Twitter, Netflix, and Pinterest.

What Memcached is not and why the world needs Redis

Redis offers a much richer set of primitives and functions than Memcached does. Redis has data structures, Lua scripting (which I highly recommend you stay away from), and replication! We often run into advanced caching users doing only key-value functionality of Redis - but picking Redis simply because it has a great multi-AZ replication story.

Enter ElastiCache Serverless: Leveling the replication playing field between Redis and Memcached

ElastiCache Memcached does not offer replication - so it is completely up to the application to mitigate the risk of data loss from node failure. ElastiCache Serverless for Memcached automatically replicates data across multiple AZs. This makes Memcached more appealing for the simple key-value use cases in Redis because you can drive more throughput out of the memcached instance of the same size. Now, you no longer have to pick between availability, throughput, and performance.

Does Momento use Memcached? How does it support replication?

Our Memcached support comes from Pelikan, Twitter’s reimplementation of Memcached, written entirely in Rust and optimized for tail latencies. Our proxy layer performs the replication for this engine, and it also doubles down as a way to warm up new nodes with data after node failure, deployments, or scaling events.

With Momento, you don’t have to worry about scaling delays, building another proxy layer to talk to your customers, or what version/type of engine you are using. Momento optimizes all of this on your behalf, leaving you with as close to zero config as possible (you still need to name your cache 😜).

Daniela Miao
Khawaja Shams
by
Daniela Miao
,
Khawaja Shams
,
by
Daniela Miao
by
Khawaja Shams
green squirrel logo for momento
by
Daniela Miao
,
Khawaja Shams
,
Author
Daniela Miao

Daniela Miao is the Co-Founder of Momento, where she's humbled everyday by her awesome teammates! Previously, she led Platform Engineering at Lightstep, where she launched their new Metrics Product. She was also tech lead at AWS DynamoDB, and released cross-region replication. Daniela has spoken at many events including re:Invent, QCon, and Kubecon. At Momento, she works on distributed system performance, observability, security, and the intersection of engineering with business.

Author
Khawaja Shams

Khawaja is the CEO and Co-Founder of Momento. He is passionate about investing in people, setting a bold vision, and team execution. Khawaja has experience at AWS where he owned DynamoDB, and subsequently owned product and engineering for all 7 of the AWS Media Services. He was awarded the prestigious NASA Early Career Medal for his contributions to the Mars Rovers.

Author
Open