Memcached vs. Redis 00:00:01 The same profile lookup hides different work A game shop stores a rebuildable profile object. Looking only at a plain get operation makes two stores seem interchangeable. Compare how the workload behaves when a slow command shares a busy server. Each server holds user:123. Memcached has several worker threads. Redis runs commands on one. A free worker thread reads the request, looks up the key and answers. Another request can be served at the same time by another thread. The command waits its turn and then runs alone, so nobody can see a half-finished change. On Redis, a command that scans every key holds up all that follow. This is why KEYS is avoided in production. Benchmark the actual command mix, object sizes and server versions. A simple throughput comparison cannot predict the tail latency of a richer command workload. 00:00:55 Update a leaderboard without shipping the whole list The shop now wants ordered scores and a rank query. Compare fetching and replacing a serialized leaderboard with updating a server-side ordered representation close to the data. The app fetches every score and a token that says which version it read. The app adds 10 points and sorts. Meanwhile another app server may do the same. The token no longer matches, so Memcached refuses. Nothing is lost, but the work is. Two more trips, this time without a conflict. One command adds to the score and keeps the set in order. No read, no retry. Conditional replacement can preserve correctness but may require retries and large transfers. A suitable native operation changes both the concurrency behavior and how much data crosses the network. 00:01:44 Restart both stores with different persistence settings Both stores hold the same three sample keys. One example has an append log enabled. Before restarting, identify what each configuration can recover without reading the application database. Both hold 3 keys. Redis also appends each write to a log on disk. Memory is gone in both. The log file is still on disk. Memcached is empty. Redis reads its log and has the keys again, after a wait. With Memcached each read misses once and the database refills it. Redis answers at once. If Redis used no persistence, it would be empty too. Persistence is a deployment choice with write and recovery costs. Keeping a durable copy still does not replace independent backups or establish zero-loss failover. 00:02:34 Route a key after adding a server The client library can select a Memcached server from its placement scheme. A Redis Cluster client uses slot ownership and may be redirected when its routing view is no longer current. The client library hashes the key and picks a server. The servers know nothing of each other. The library moves its share to the others. Those keys miss once and are read from the database. A slot number comes from the key, and each primary owns a range of slots. Here three primaries own about a third each. If a client's map is old, the server replies with a redirect and the client asks the right one: one extra trip. Client membership refresh, resharding and failure handling belong in the comparison. A successful lookup on a warm, unchanged cluster tests only the easiest path. 00:03:31 Pick a store separately for two game features The game shop has both whole rendered pages and a leaderboard that changes on every match. One choice for every use case is not required. Write down which operation dominates each feature. Whole pages, read often, easy to rebuild. Either server fits. The board changes with every game. A sorted set does this in one step, so Redis gains a reason. One system means one set of alerts and one on-call guide. Traffic is small, so they run only Redis, with a memory limit and an eviction policy. If plain gets one day fill the command thread, they add Memcached or more Redis shards. They wrote that number down. Choose from required atomic operations, acceptable recovery and measured capacity. Revisit that choice when the workload changes rather than treating a product name as the architecture.