View
350
Download
2
Category
Preview:
Citation preview
Reactive ManifestoDeveloping Real-time Leaderboards
Binoy ShahTechnical ArchitectWashington Post (Games)
What is The Reactive Manifesto
http://www.reactivemanifesto.org/
Strive to be: Responsive Resilient Elastic Asynchronous
Philosophy: Convention over configuration
Lightweight & Stateless Asynchronous & Non-blocking Message Driven [Actor based core
framework] Resilient & Ops - Friendly Write code in Java and/or Scala Integrates well with Spring [OMG!!] Simple API
Play Framework
Realtime Game play & Leaderboards Millions of players Millions of Player scores x 1000's of
Games Individual Player Rank [Dense Rank] Various Leaderboard rankings
• Per quiz• Per category• Global
Leaderboards
Leaderboards – Dense Ranking
Leaderboards - Initial PerformanceRDBMS Performance for calculating player Dense rank
# of Player Scores Response Times (ms)
Oracle
Response Times (ms)
MySQL
User Experience
500,000 720 690
1,000,000 3454 3645
10,000,0007662 7731
30,000,00045,000 43,000
So are we doomed??
Our hero…
Redis NoSQL Server
Leaderboards - Solution
What is Redis? REmote DIctionary Server Open source (http://redis.io) since 2009 Advanced in-memory key-value data-structure
server
Leaderboards - Solution
Available in-memory data structure in Redis: Hashes P List Sets Sorted Sets P Key Value
Leaderboards – DB vs Redis Load Test 30 million scores, 100k players, 100 leaderboards
Leaderboards - Stack
Leaderboards AWS Stack
Leaderboards…The TechLeading edge technology stack:• Scala• Java 8• Play Framework• Redis 3.0 NoSql DB• JSON ( RESTful APIs )• AngularJS• Bootstrap ( JS Library • Oracle 11g
Leaderboards…The TechLeaderboard Stack [ Deployment Architecture ]
Leaderboards – Live and Kicking !!
Introduced for 'Politics & Pints' section articles
Switched on as default feature of all Quiz games
Logged in players can view participate and view Leaderboards
Key TakeawaysDesign for simplicity
Simplicity is key to being responsiveDevelop iteratively and incrementally
Development process is responsive, it can scale well to changing requirements
Optimize your application in phasesLoad test application with worst case scenario in mind
Forges path for scaling and being more elasticStress test your application
Shows you bottlenecks in the system and help in optimizing the bottleneck
Questions
Recommended