2. PRESENTED
BY
1 Why Redis?
2 Scalable Segment Service
3 Scalable Mobile Verification Platform
Agenda:
4
5
Scalable A/B Test Platform
Redis as a Managed Service
3. PRESENTED
BY
• Turn underutilised resources on a server (CPU/RAM) into valuable resources.
• Scale beyond a single instance of cache, if more headroom is required, while
some other caching services such as memache cannot.
• Regular backups at disk to recover and get boot-up with minimal loss of data.
• Minimal memory fragmentation, to allow better reads.
• Ability to setup a cluster which helps with data sharding.
• Setting up user defined max-memory usage.
• User defined policies to either stop or evict data based on recent usages or expiry.
Why Redis?
4. PRESENTED
BY
Any B2C product will have user segmentation to perform A/B Testing, Personalization
or any behavioral analysis, certain analysis leads to create new segments as well
• Support very high read throughput, RPM: ~5mil
• latency should not be more than 5ms
• Service should be scalable to support for next few years
Redis for Scalable Segment Service
5. PRESENTED
BY
Redis seemed to fit the bill perfectly here, as it fulfills all our requirements here.
• Challenge: During writes almost entire redis database (keys) updated. Read throughput affected
during updates.
• Solution:
⎼ Before any write could happen at redis, we put up a queue (kafka), which throttles writes
⎼ Read and Write pools of redis connections were made separate.
Redis for Scalable Segment Service
6. PRESENTED
BY
Mobile verification via OTP is a popular mechanism to perform authentication for
different purposes, like Sign-In, 2 Factor Auth etc.
• OTP generation, Large scale Read/Writes, Time Bound deliveries were top level challenges
• Store OTP in RDBMS for high consistency. What if RDBMS goes down?
• RPM to serve: ~100k
• What if number of request doubles, or 10 times in next 5 years?
• How do we make it 99.999% available service? Should be highly consistent and reliable.
• We also wanted to persist those OTP sent against mobile number for other purposes, but not
within the transactional flow
Redis for Scalable Mobile Verification Platform
7. PRESENTED
BY
We introduced Augmented Data Store system
• Used Redis as a transient store & NoSQL DB for persistence and fallback option
• OTP data must expires in 15-20 minutes, so using ephemeral memory
• Redis works in cluster mode with Master-Slave, RF=1
• Redis helps in scale due to cluster mode, much better than any schema based DB
Redis for Scalable Mobile Verification Platform
8. PRESENTED
BY
In any B2C product, decision making is a tricky job, So A/B Testing experimentation
helps, and performing large scale A/B is complex because of concurrency, so
distributed lock comes in picture.
• Using redis locks to serve concurrent users creating A/B experiments
• Lock prevents multiple concurrent processes stepping on each other
• Many times locking over a request is required to make it transactional
Redis for Scalable A/B Test Platform
9. PRESENTED
BY
For creation of experiments
• Slotting concept, each experiment is associated with certain slots with each slot
containing a part of the population set
• If multiple concurrent users try to create/update, execution happens in an orderly
fashion while acquiring read and write locks over the slots.
Redis for Scalable A/B Test Platform
10. PRESENTED
BY
• 1-click-deploy redis cluster ready to boot up and use within a few
minutes.
• Auto-Monitoring setup, with cluster health checks, commands
monitoring, done via Graphana.
• Auto-backups with replication can also be configured with the setup
before deploying if required.
Redis as a Managed Service