PrefaceSOME GENERIC STUFF
Myself• Many years @ 888 an online Casino & Poker  company. Finished as Gaming Architect• CTO @ UMOO, a financial market g...
Playtika• Founded mid 2010• Social gaming company• Multiple social networks and sites• Multiple platforms  (SNs, destinati...
Where
Our Games• A few million daily active users.• A few (more) million monthly active users• Our biggest game today Slotomania...
So…OUR STORY BEGINS
2 years ago, Slotomania on Facebook• 70K Concurrent users• A few million registered  users• One MySQL node• Hit a glass ce...
So what now?• Had Sharding code  branch that had to be  dropped• Within 3 weeks!!!  MySQL only => MySQL +  Couchbase• Mean...
Why Couchbase• Open source• Backed by a serious company• Indications all around that the tech is being  successfully used ...
introducingOUR SOLUTION
Keep MySQL – Why?•   Fear is the mind killer•   Site to site replication•   Can still “SQL Query” the data•   Easy as pie…...
What do we keep in couchbase?• Everything key value• Anything we need to access fast and frequent  – User Score  – User Sa...
Keys and Values•   Be creative with keys and objects•   Most common: user_id•   E.g. user_id & session_id•   E.g. user_id ...
“Schema” – SQL vs. Document based• Sometimes you need to turn the data on its  head• 2 Table join in SQL = multi get in Co...
Serialization• Right now, some JSON some Binary• Intend to move most if not all to JSON  – 2.0!  – Browse keys without hav...
Data Services or Direct Access?• Encapsulate data access?• Direct Access => High Performance• Data layer Encapsulation => ...
Data Services vs. Direct Access                                                   Couchbase                 Couchbase     ...
Locks• Pessimistic vs. Optimistic• We use 2 different lock types in different cases:• CAS + spin X times (and fail)• Lock ...
BarzelimTHE OPS ANGLE
Our cluster(s)• 12 Couchbase buckets + 4 memcache buckets  On two clusters• The 2 “heavy” buckets are on their own  cluste...
Ops/s (off-peak)• “Small cluster” (actually with a bug on prod)• “Big cluster”
Our hardware•   Couchbase boxes are physical•   Latest “spec” – Dell R710 with•   2 CPUs (12 cores) – overkill!!•   6 SAS ...
What’sNext?
Thanks for listeningQUESTIONS?
CouchConf Israel 2013_Couchbase at Playtika
Upcoming SlideShare
Loading in …5
×

CouchConf Israel 2013_Couchbase at Playtika

973 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
973
On SlideShare
0
From Embeds
0
Number of Embeds
434
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

CouchConf Israel 2013_Couchbase at Playtika

  1. 1. PrefaceSOME GENERIC STUFF
  2. 2. Myself• Many years @ 888 an online Casino & Poker company. Finished as Gaming Architect• CTO @ UMOO, a financial market gaming platform• CTO @ Playtika
  3. 3. Playtika• Founded mid 2010• Social gaming company• Multiple social networks and sites• Multiple platforms (SNs, destination, Android, iOS)• Acquired by by Caesar’s Interactive Entertainment mid 2011
  4. 4. Where
  5. 5. Our Games• A few million daily active users.• A few (more) million monthly active users• Our biggest game today Slotomania – 200K+ concurrent users at peak hours. No less than 100K during off-peak• At least one request per user every 5 seconds• At least one read-modify write on user state per request• In many cases multiple read-modify-writes
  6. 6. So…OUR STORY BEGINS
  7. 7. 2 years ago, Slotomania on Facebook• 70K Concurrent users• A few million registered users• One MySQL node• Hit a glass ceiling Needed to scale “yesterday”
  8. 8. So what now?• Had Sharding code branch that had to be dropped• Within 3 weeks!!! MySQL only => MySQL + Couchbase• Meantime – 3 ring MySQL circus
  9. 9. Why Couchbase• Open source• Backed by a serious company• Indications all around that the tech is being successfully used with some big-time players• Almost no comparison work. Online only!
  10. 10. introducingOUR SOLUTION
  11. 11. Keep MySQL – Why?• Fear is the mind killer• Site to site replication• Can still “SQL Query” the data• Easy as pie…• BUT, not everyone can keep everything on one node.
  12. 12. What do we keep in couchbase?• Everything key value• Anything we need to access fast and frequent – User Score – User Save – User Messages• Only things where true ACIDness is not 100% mandatory or can be faked.
  13. 13. Keys and Values• Be creative with keys and objects• Most common: user_id• E.g. user_id & session_id• E.g. user_id & game_type
  14. 14. “Schema” – SQL vs. Document based• Sometimes you need to turn the data on its head• 2 Table join in SQL = multi get in Couchbase• Excessive ‘multigetting’ = network saturation• Our Lesson: Don’t migrate as is. Refactor/reimagine the schema for a document-oriented database
  15. 15. Serialization• Right now, some JSON some Binary• Intend to move most if not all to JSON – 2.0! – Browse keys without having to have entire context – Easier to support object versioning• Consider other serialization methods (thrift, protobuf)
  16. 16. Data Services or Direct Access?• Encapsulate data access?• Direct Access => High Performance• Data layer Encapsulation => mitigate complex SOA-ish environments
  17. 17. Data Services vs. Direct Access Couchbase Couchbase Data Services DAL Lib DAL Lib RPC Lib RPC Lib Service A Service B Service A Service B
  18. 18. Locks• Pessimistic vs. Optimistic• We use 2 different lock types in different cases:• CAS + spin X times (and fail)• Lock object with timeout (actually can be done better than we do it!)• Avoid contention if possible (especially cross- process ) by old-school tricks – Queue stuff – IP based stickiness (you lose nothing by this) – Don’t be a nerd! Cut corners where possible.
  19. 19. BarzelimTHE OPS ANGLE
  20. 20. Our cluster(s)• 12 Couchbase buckets + 4 memcache buckets On two clusters• The 2 “heavy” buckets are on their own cluster• 40K ops/s on couchbase, 20K ops/s on memcache• 30-35% Couchbase ops are writes• We still live in a pre-2.0 world (1.8.1)
  21. 21. Ops/s (off-peak)• “Small cluster” (actually with a bug on prod)• “Big cluster”
  22. 22. Our hardware• Couchbase boxes are physical• Latest “spec” – Dell R710 with• 2 CPUs (12 cores) – overkill!!• 6 SAS HDDs• 64 Gigs RAM• Running CentOS 5.8
  23. 23. What’sNext?
  24. 24. Thanks for listeningQUESTIONS?

×