Benchmark Background:
- Requested by TV Broadcaster for a voting platform
- Choose the best NoSQL DB for the use case
- Push the DB to the max limit
- AWS infrastructure
Goal:
- 2M votes/sec at the best TCO
- 2M Votes = ~7M DB Ops/sec
2. Who is emind?
● Born in the cloud company
● Amazon Web Services and Google Cloud
Platform Partners and Resellers
● 7 Years of experience with 850+ successful
cloud deployments
3. Benchmark Background
● Requested by TV Broadcaster for a
voting platform
● Choose the best NoSQL DB for the use
case
● Push the DB to the max limit
● AWS infrastructure
● Goal
● 2M votes/sec at the best TCO
● 2M Votes = ~7M DB Ops/sec
4. Real-Time Voting API
● Save User Votes, IP, Hash
● Prevent Duplicates
● Count Total Yes/No
● Count Total Votes
5. Requirements of NoSQL Candidates
● Auto Sharding
● Infinite Scale
● Replication
● High Availability
● Counter Heavy
● Aerospike
● Casandra
● CouchBase
● Redis - (Redis Labs)
7. App Flow with channels & pipeline
success = SetNX ( user_id, vote_obj)
if (success) {
c <- vote
}
worker(c -> vote) {
push_to_queue(vote)
if (queue.size() > 35) {
redis.pipeline_on(queue) {
incr(“total_votes”)
incr(vote.choice)
}
}
}
8. AWS Deployment
● Ubuntu 14.04 (Enh. Networking Enabled)
● API Backend on C4.8XLarge (golang)
● Load Generator C4.8XLarge (wrk)
● Databases on C4.Large
● All in same Placement Group
Load
generator
C4.8XL
API backend
C4.8XL
NoSQL
C4.L
9. Results - Votes Per Sec
* No optimization of DBs - default presets
10. Cassandra
● API Req / Sec : 8.2K
● DB Ops / Sec : 19.5K
● Votes Within 60 Sec :
493,886
11. CouchBase
● API Req / Sec : 13.5K
● DB Ops / Sec : 30K
● Votes Within 60 Sec : 800,951
12. Aerospike
● API Req / Sec : 16.5K
● DB Ops / Sec : 50K
● Votes Within 60 Sec :
989,659
13. Redis Labs
● API Req / Sec : 44K
● DB Ops / Sec : 126K
● Votes Within 60 Sec : 2.65M
14. Redis Pipeline is Crucial
● App is in golang driver has good support for
pipeline
● Play with pipeline size, match your use case
○ We tried 10-100, peaked ~35
15. ● Redis wins big time ~x2.5 votes/sec
● Pipeline is crucial
● Possible enhancement
○ UDF Lua will probably get redis results even higher.
Summary