Library / Blogs
PayPal Developer Community Blog
The Paypal blog: an index of its posts, to pick the ones on the topic you are studying.
By Paypal engineers · Paypal · Added 2026-10-12
All content belongs to Paypal engineers / Paypal. We only link to it and give credit. Report a problem
Learn this article
About 37 min left. Your work is saved as you go.
What you are about to study
Paypal wrote this to explain how they thought about a problem. You should know the basics: caching, queues and replication.
Ideas you will meet
- Distributed Systems
- Consensus, time, failure and the fundamentals of scale-out.
What we already know about this
Our own lessons on these ideas. Read them here before you start, so it makes sense.
Core Concepts: How Things Actually Work · 8 minWhy Redis is fast, and Redis versus MemcachedIn-memory storage, a single-threaded event loop and rich data structures, plus how persistence and replication work.Read here
Why it is fast
- Everything lives in memory. No disk seek on the read path.
- Simple, efficient data structures (hash tables, skip lists, compact encodings) with predictable costs.
- A single-threaded event loop for command execution: no locks between threads, no context switching, and each command runs atomically. I/O multiplexing lets one thread serve thousands of connections.
- A lean protocol and in-process memory management.
(Newer versions use extra threads for network I/O, but command execution stays ordered.)
Image: Mixabest · Public domain · Source · Wikimedia Commons: Dual-channel DDR memory use 6026How the pieces fit
100%Figure SDA-CORE-09-1 · Redis: event loop, memory, persistence and replication · © forcsguy.com
More than a cache
Redis stores typed values:
Type Use String cached values, counters, flags Hash objects with fields (a user profile) List queues, recent items Set unique members, tags, set maths Sorted set leaderboards, priority queues, time-ordered data Others streams, bitmaps, HyperLogLog, geospatial Because operations run on the server, you can increment, push, pop or intersect without a read-modify-write race.
100%Figure SDA-CORE-09-2 · Redis data types and what they are for · © forcsguy.com
Durability options
Memory is volatile, so Redis offers:
- Snapshots (RDB): periodic point-in-time dumps. Compact, but recent writes can be lost.
- Append-only file (AOF): logs every write; replays on restart. Safer, bigger and a little slower.
- Or none at all when it is purely a cache.
Scaling and availability
- Replication: a primary copies to replicas (asynchronously), serving reads and enabling failover.
- Sentinel / managed failover promotes a replica when the primary dies.
- Cluster: splits keys across nodes by hash slot, for data larger than one machine.
Redis versus Memcached
Redis Memcached Data types many strings only Persistence optional none Replication yes not built in Threading one for commands multi-threaded Best for cache plus data structures, queues, counters a very simple, large, pure cache For most new projects Redis is the more flexible choice. Memcached remains fine for a straightforward cache that must use many CPU cores.
Pitfalls
- Memory is finite: set a maxmemory and an eviction policy (for example LRU).
- Avoid slow commands on huge collections.
- A very hot key still concentrates load on one node.
More on this site
Related reading
- Redis DocumentationRedis · Redis Ltd.Documentation
- Redis BlogRedis engineers · Redis Ltd.Blogs
- Redis UniversityRedis · Redis Ltd.Courses
- RedisRedis · Redis Ltd.GitHub
Show 6 moreShow fewer
- Redis persistenceRedis · Redis Ltd.Documentation
- Memory Optimization in Redis at WattpadWattpad engineers · WattpadCase Studies
- Scale with Redis ClusterRedis · Redis Ltd.Documentation
- Scaling Job Queue with Redis at SlackSlack engineers · SlackCase Studies
- Moving persistent data out of Redis at GithubGithub engineers · GithubCase Studies
- PayPal Developer Community BlogPaypal engineers · PaypalBlogs
Go deeper on this
A path through videos, articles, other case studies and code on the same ideas as PayPal Developer Community Blog.
Warm upGet the vocabulary first.
Books · Free from the author
Concurrent and Distributed Systems (Cambridge lecture notes)
Eight lectures on time, broadcast, replication, consensus and transactions, with notes, slides and video. Free from the author under CC BY-SA.
University of CambridgeIntermediate
Books · Free from the author
Computer Networks: A Systems Approach
How networks are built and why: protocols, routing, congestion control and the internet's architecture. The authors publish it free online under CC BY 4.0.
Systems ApproachIntermediate
WatchHow others solve the same problem, on video.
Videos belong to their creators and play from YouTube. More on YouTube (opens in a new tab)
ReadEngineers explain it in their own words.
Blogs · Free from the author · Read here
Scalable Web Architecture and Distributed Systems
A full chapter on the building blocks of large websites: availability, performance, reliability, scalability, caches, proxies, indexes, load balancers and queues. Free to read here under CC BY 3.0.
The Architecture of Open Source ApplicationsBeginner40 min
Papers · Read here
Facebook’s photo storage
This paper describes Haystack, an object storage system optimized for Facebook’s Photos application. Facebook currently stores over 260 billion images, which translates to over 20 petabytes of data.
USENIXIntermediate
See it in another companyThe same ideas, a different system.
Case Studies · Read here
Aroma: Using ML for Code Recommendation at Facebook
Thousands of engineers write the code to create our apps, which serve billions of people worldwide. This is no trivial task—our services have grown so diverse and complex that the codebase contains…
FacebookIntermediate
Case Studies · Read here
Brooklin: Distributed Service for Near Real-Time Data Streaming at LinkedIn
Brooklin—a distributed service for streaming data in near real-time and at scale—has been running in production at LinkedIn since 2016, powering thousands of data streams and over 2 trillion messages per day. Today, w...
LinkedInIntermediate
Read the codeSee how it looks when it is real.
GitHub
Engineering Blogs
A huge directory of company engineering blogs to learn from real production systems.
kilimchoiIntermediate
GitHub
Awesome Scalability
Curated reading list of articles on the architecture of scalable, reliable systems.
binhnguyennusIntermediate
Keep learning
Loading community…