SlideShare a Scribd company logo
Data Storage Solutions
for SNS game
Dinh Nguyen Anh Dung – P2S – G6 – VNG
CONTENT
• SNS games and SQL-based databases
• NoSQL technology and Couchbase
• NoSQL does not come without challenges
• SNS Storage Engine (SSE)
SNS games AND SQL-based databases
SNS games characteristics
• Huge amount of concurrent requests but
require low response time
• Accounts can be stored separately
– No need for centralized storage
– In most cases, no need to put strict constrains on
data relationship
Native limitations of SQL-based DBMS
• Centralized fundamentally
– Vertical scale up issue
• Schema
– High risk (and cost) for updates
• Normalized data
– Unnecessary overhead: join tables, locking, data
constrain check,…
Native limitations of SQL-based DBMS
Source : NoSQL - WhitePaper
Native limitations of SQL-based DBMS
• SQL processing overhead at both DBMS and
client side.
• Most data accesses end up at hard-disk
– Very challenging to meet low response time
– Internal caching does not help much
• Hard to distributed data across multiple-
servers
NoSQL technology and Couchbase
NoSQL technology
• Persistent distributed hash-table
• Active set resides on RAM
– Extremely fast response time
• Horizontal scale up
• Raw and direct data access
– set, get, add, inc, dec : no overhead
NoSQL technology
Key Value
Jack.Gold 50123
Jack.Exp 4670
Jack.Coin 700
Peter.Gold 7050
Peter.Exp 20005
Peter.Coin 1
Key Value
Peter.Gold 7050
Jack.Exp 4670
Peter.Exp 20005
Key Value
Jack.Gold 50123
Key Value
Peter.Coin 1
Jack.Coin 700
Active set on RAM
HDD
ACTIVE SET ON RAM
CLIENT
Lazy write
Couchbase server
• Based on membase technology
• Distributed
• Replica
• Since 1.8, have native client for PHP
• Bucket types
– Couchbase (persistent)
– Memcache (memory only)
NoSQL does not come without challenges
Our first SNS game with Couchbase
Architecture and design issues
• Transition from relational database design to
key-value design
– Account data => keys : how ?
• Only minimum support for
locking, concurrency control
– add : failed if exists - mutex
– cas : read get cas, write failed if cas is out-dated
Architecture and design issues
• No transaction support
– Data corruption becomes so easy!
• No high-level data support (e.g. list,queue,…)
• No tools for raw data viewing / editing
Pitfalls
• Too much freedom for developers
– Anyone can add / modify any key any time
• Epic key design mindset
– One key for all : bad performance, concurrency
control is a true night mare
• Abuse the power of set
– Never fail ! Developer LOVE it !
SSE – SNS Storage Engine
Our second SNS game with Couchbase
What is SSE ?
• A thin “layer” between developers and the
all-mighty Couchbase
– SSE is simply a PHP library
• Provide better support for locking and
concurrency control
– Basic support for : Begin – update - commit
• Provide high-level data structures
– Collection, queue, stack, integer (gold), inc-only
integer (exp), binary flags (quest)…
What is SSE ?
• Minimize the risk of weak concurrency support
– Ability to rollback pending writes
• Schema
– Limit freedom of developers!
– No more nightmare for backup and raw data
view/editing
• Buffers to eliminate repeated read / writes
Raw account view / editing tool
What is SSE ?
What is SSE ?
Multi-instance architecture
• Replica is too costly to performance
• One node failed means cluster failed
• Adding nodes requires rebalance
– Only good when having clusters with large
number of nodes (more than 20 nodes)
Multi-instance architecture
• One instance for index (user-to-instance
mapping)
– Use APC on logic servers to cache / reduce load
to index instance
• Many instances of data
– Dynamically adjust weight on each instance base
on average load of instance
– Node failure only affects part of the user-base
Multi-instance architecture
Data
Instance 1
Data
Instance 2
Data
Instance 3
Index
Instance
Game Logic Game Logic Game Logic
APC APC APC
Game Logic
APC
Disavantages
• Lower performance of multi-get
• Not well balance between instances in terms
of accesses
How good is SSE for us ?
• No more data loss due to concurrency
• No more data corruption
• No mysterious bugs due to un-intended
writes
• Reduce more than 3 times workload of server
developers
Data storage solutions for sns game

More Related Content

What's hot

Membase East Coast Meetups
Membase East Coast MeetupsMembase East Coast Meetups
Membase East Coast Meetups
Membase
 
Zing Database – Distributed Key-Value Database
Zing Database – Distributed Key-Value DatabaseZing Database – Distributed Key-Value Database
Zing Database – Distributed Key-Value Databasezingopen
 
Drupal Performance and Scaling
Drupal Performance and ScalingDrupal Performance and Scaling
Drupal Performance and ScalingGerald Villorente
 
Moving to the Cloud: AWS, Zend, RightScale
Moving to the Cloud: AWS, Zend, RightScaleMoving to the Cloud: AWS, Zend, RightScale
Moving to the Cloud: AWS, Zend, RightScalemmoline
 
Using flash on the server side
Using flash on the server sideUsing flash on the server side
Using flash on the server sideHoward Marks
 
Redis : Database, cache, pub/sub and more at Jelly button games
Redis : Database, cache, pub/sub and more at Jelly button gamesRedis : Database, cache, pub/sub and more at Jelly button games
Redis : Database, cache, pub/sub and more at Jelly button games
Redis Labs
 
Caching technology comparison
Caching technology comparisonCaching technology comparison
Caching technology comparison
Rohit Kelapure
 
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7Phil Pursglove
 
Webinar: StorPool and WHIR - better storage, better business
Webinar: StorPool and WHIR - better storage, better businessWebinar: StorPool and WHIR - better storage, better business
Webinar: StorPool and WHIR - better storage, better business
StorPool Storage
 
KoprowskiT_HUG-MSSQL_AdHocMaintenancePlansForBeginners
KoprowskiT_HUG-MSSQL_AdHocMaintenancePlansForBeginnersKoprowskiT_HUG-MSSQL_AdHocMaintenancePlansForBeginners
KoprowskiT_HUG-MSSQL_AdHocMaintenancePlansForBeginners
Tobias Koprowski
 
Drop acid
Drop acidDrop acid
Drop acid
Mike Feltman
 
Node.js and couchbase Full Stack JSON - Munich NoSQL
Node.js and couchbase   Full Stack JSON - Munich NoSQLNode.js and couchbase   Full Stack JSON - Munich NoSQL
Node.js and couchbase Full Stack JSON - Munich NoSQLPhilipp Fehre
 
North Bay Ruby Meetup 101911
North Bay Ruby Meetup 101911North Bay Ruby Meetup 101911
North Bay Ruby Meetup 101911
Ines Sombra
 
FOSSASIA 2016 - 7 Tips to design web centric high-performance applications
FOSSASIA 2016 - 7 Tips to design web centric high-performance applicationsFOSSASIA 2016 - 7 Tips to design web centric high-performance applications
FOSSASIA 2016 - 7 Tips to design web centric high-performance applications
Ashnikbiz
 
Java scalability considerations yogesh deshpande
Java scalability considerations   yogesh deshpandeJava scalability considerations   yogesh deshpande
Java scalability considerations yogesh deshpande
IndicThreads
 
SQL 2014 In-Memory OLTP
SQL 2014 In-Memory  OLTPSQL 2014 In-Memory  OLTP
SQL 2014 In-Memory OLTP
Amber Keyse
 
Optimising for Performance
Optimising for PerformanceOptimising for Performance
Optimising for Performance
thomas_mb
 
Optimize MySQL performance for developers
Optimize MySQL performance for developersOptimize MySQL performance for developers
Optimize MySQL performance for developers
jackbillow
 

What's hot (19)

Membase East Coast Meetups
Membase East Coast MeetupsMembase East Coast Meetups
Membase East Coast Meetups
 
Zing Database – Distributed Key-Value Database
Zing Database – Distributed Key-Value DatabaseZing Database – Distributed Key-Value Database
Zing Database – Distributed Key-Value Database
 
Introduction to AJAX
Introduction to AJAXIntroduction to AJAX
Introduction to AJAX
 
Drupal Performance and Scaling
Drupal Performance and ScalingDrupal Performance and Scaling
Drupal Performance and Scaling
 
Moving to the Cloud: AWS, Zend, RightScale
Moving to the Cloud: AWS, Zend, RightScaleMoving to the Cloud: AWS, Zend, RightScale
Moving to the Cloud: AWS, Zend, RightScale
 
Using flash on the server side
Using flash on the server sideUsing flash on the server side
Using flash on the server side
 
Redis : Database, cache, pub/sub and more at Jelly button games
Redis : Database, cache, pub/sub and more at Jelly button gamesRedis : Database, cache, pub/sub and more at Jelly button games
Redis : Database, cache, pub/sub and more at Jelly button games
 
Caching technology comparison
Caching technology comparisonCaching technology comparison
Caching technology comparison
 
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
 
Webinar: StorPool and WHIR - better storage, better business
Webinar: StorPool and WHIR - better storage, better businessWebinar: StorPool and WHIR - better storage, better business
Webinar: StorPool and WHIR - better storage, better business
 
KoprowskiT_HUG-MSSQL_AdHocMaintenancePlansForBeginners
KoprowskiT_HUG-MSSQL_AdHocMaintenancePlansForBeginnersKoprowskiT_HUG-MSSQL_AdHocMaintenancePlansForBeginners
KoprowskiT_HUG-MSSQL_AdHocMaintenancePlansForBeginners
 
Drop acid
Drop acidDrop acid
Drop acid
 
Node.js and couchbase Full Stack JSON - Munich NoSQL
Node.js and couchbase   Full Stack JSON - Munich NoSQLNode.js and couchbase   Full Stack JSON - Munich NoSQL
Node.js and couchbase Full Stack JSON - Munich NoSQL
 
North Bay Ruby Meetup 101911
North Bay Ruby Meetup 101911North Bay Ruby Meetup 101911
North Bay Ruby Meetup 101911
 
FOSSASIA 2016 - 7 Tips to design web centric high-performance applications
FOSSASIA 2016 - 7 Tips to design web centric high-performance applicationsFOSSASIA 2016 - 7 Tips to design web centric high-performance applications
FOSSASIA 2016 - 7 Tips to design web centric high-performance applications
 
Java scalability considerations yogesh deshpande
Java scalability considerations   yogesh deshpandeJava scalability considerations   yogesh deshpande
Java scalability considerations yogesh deshpande
 
SQL 2014 In-Memory OLTP
SQL 2014 In-Memory  OLTPSQL 2014 In-Memory  OLTP
SQL 2014 In-Memory OLTP
 
Optimising for Performance
Optimising for PerformanceOptimising for Performance
Optimising for Performance
 
Optimize MySQL performance for developers
Optimize MySQL performance for developersOptimize MySQL performance for developers
Optimize MySQL performance for developers
 

Similar to Data storage solutions for sns game

Data storage solutions for SNS game
Data storage solutions for SNS gameData storage solutions for SNS game
Data storage solutions for SNS gameaction.vn
 
Network support for resource disaggregation in next-generation datacenters
Network support for resource disaggregation in next-generation datacentersNetwork support for resource disaggregation in next-generation datacenters
Network support for resource disaggregation in next-generation datacenters
Sangjin Han
 
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
Amazon Web Services
 
NoSQL for great good [hanoi.rb talk]
NoSQL for great good [hanoi.rb talk]NoSQL for great good [hanoi.rb talk]
NoSQL for great good [hanoi.rb talk]
Huy Do
 
Cassandra Core Concepts
Cassandra Core ConceptsCassandra Core Concepts
Cassandra Core Concepts
DataStax Academy
 
Modeling, estimating, and predicting Ceph (Linux Foundation - Vault 2015)
Modeling, estimating, and predicting Ceph (Linux Foundation - Vault 2015)Modeling, estimating, and predicting Ceph (Linux Foundation - Vault 2015)
Modeling, estimating, and predicting Ceph (Linux Foundation - Vault 2015)
Lars Marowsky-Brée
 
Large-scale projects development (scaling LAMP)
Large-scale projects development (scaling LAMP)Large-scale projects development (scaling LAMP)
Large-scale projects development (scaling LAMP)
Alexey Rybak
 
Jay Kreps on Project Voldemort Scaling Simple Storage At LinkedIn
Jay Kreps on Project Voldemort Scaling Simple Storage At LinkedInJay Kreps on Project Voldemort Scaling Simple Storage At LinkedIn
Jay Kreps on Project Voldemort Scaling Simple Storage At LinkedIn
LinkedIn
 
Intro to Cassandra
Intro to CassandraIntro to Cassandra
Intro to Cassandra
Jon Haddad
 
Serve like a boss (part one)
Serve like a boss (part one)Serve like a boss (part one)
Serve like a boss (part one)
Hamed Nemati
 
Scalable web architecture
Scalable web architectureScalable web architecture
Scalable web architecture
Kaushik Paranjape
 
NoSQL A brief look at Apache Cassandra Distributed Database
NoSQL A brief look at Apache Cassandra Distributed DatabaseNoSQL A brief look at Apache Cassandra Distributed Database
NoSQL A brief look at Apache Cassandra Distributed Database
Joe Alex
 
Yes sql08 inmemorydb
Yes sql08 inmemorydbYes sql08 inmemorydb
Yes sql08 inmemorydb
Daniel Austin
 
Scylla Summit 2016: Using ScyllaDB for a Microservice-based Pipeline in Go
Scylla Summit 2016: Using ScyllaDB for a Microservice-based Pipeline in GoScylla Summit 2016: Using ScyllaDB for a Microservice-based Pipeline in Go
Scylla Summit 2016: Using ScyllaDB for a Microservice-based Pipeline in Go
ScyllaDB
 
No sql databases
No sql databasesNo sql databases
No sql databases
swathika rajan
 
Fixing twitter
Fixing twitterFixing twitter
Fixing twitter
Roger Xia
 

Similar to Data storage solutions for sns game (20)

Data storage solutions for SNS game
Data storage solutions for SNS gameData storage solutions for SNS game
Data storage solutions for SNS game
 
Network support for resource disaggregation in next-generation datacenters
Network support for resource disaggregation in next-generation datacentersNetwork support for resource disaggregation in next-generation datacenters
Network support for resource disaggregation in next-generation datacenters
 
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
 
NoSQL for great good [hanoi.rb talk]
NoSQL for great good [hanoi.rb talk]NoSQL for great good [hanoi.rb talk]
NoSQL for great good [hanoi.rb talk]
 
Cassandra Core Concepts
Cassandra Core ConceptsCassandra Core Concepts
Cassandra Core Concepts
 
Modeling, estimating, and predicting Ceph (Linux Foundation - Vault 2015)
Modeling, estimating, and predicting Ceph (Linux Foundation - Vault 2015)Modeling, estimating, and predicting Ceph (Linux Foundation - Vault 2015)
Modeling, estimating, and predicting Ceph (Linux Foundation - Vault 2015)
 
Large-scale projects development (scaling LAMP)
Large-scale projects development (scaling LAMP)Large-scale projects development (scaling LAMP)
Large-scale projects development (scaling LAMP)
 
Jay Kreps on Project Voldemort Scaling Simple Storage At LinkedIn
Jay Kreps on Project Voldemort Scaling Simple Storage At LinkedInJay Kreps on Project Voldemort Scaling Simple Storage At LinkedIn
Jay Kreps on Project Voldemort Scaling Simple Storage At LinkedIn
 
Intro to Cassandra
Intro to CassandraIntro to Cassandra
Intro to Cassandra
 
Serve like a boss (part one)
Serve like a boss (part one)Serve like a boss (part one)
Serve like a boss (part one)
 
Scalable web architecture
Scalable web architectureScalable web architecture
Scalable web architecture
 
NoSQL A brief look at Apache Cassandra Distributed Database
NoSQL A brief look at Apache Cassandra Distributed DatabaseNoSQL A brief look at Apache Cassandra Distributed Database
NoSQL A brief look at Apache Cassandra Distributed Database
 
Yes sql08 inmemorydb
Yes sql08 inmemorydbYes sql08 inmemorydb
Yes sql08 inmemorydb
 
NoSql
NoSqlNoSql
NoSql
 
Scylla Summit 2016: Using ScyllaDB for a Microservice-based Pipeline in Go
Scylla Summit 2016: Using ScyllaDB for a Microservice-based Pipeline in GoScylla Summit 2016: Using ScyllaDB for a Microservice-based Pipeline in Go
Scylla Summit 2016: Using ScyllaDB for a Microservice-based Pipeline in Go
 
NoSQL_Night
NoSQL_NightNoSQL_Night
NoSQL_Night
 
No sql databases
No sql databasesNo sql databases
No sql databases
 
Fixing twitter
Fixing twitterFixing twitter
Fixing twitter
 
Fixing_Twitter
Fixing_TwitterFixing_Twitter
Fixing_Twitter
 

More from Son Aris

Main land china mobile app market 2014. what you need to know
Main land china mobile app market 2014. what you need to knowMain land china mobile app market 2014. what you need to know
Main land china mobile app market 2014. what you need to know
Son Aris
 
Vietnam Digital Marketing Market Overview
Vietnam Digital Marketing Market OverviewVietnam Digital Marketing Market Overview
Vietnam Digital Marketing Market OverviewSon Aris
 
Mobile Game In China 2013-2014
Mobile Game In China 2013-2014Mobile Game In China 2013-2014
Mobile Game In China 2013-2014Son Aris
 
Japans social gaming market 2013
Japans social gaming market 2013Japans social gaming market 2013
Japans social gaming market 2013Son Aris
 
In mobi app_insight_report
In mobi app_insight_reportIn mobi app_insight_report
In mobi app_insight_reportSon Aris
 
Ogdc 2013 am i ready to go startup
Ogdc 2013 am i ready to go startupOgdc 2013 am i ready to go startup
Ogdc 2013 am i ready to go startupSon Aris
 
Ogdc 2013 zing me mobile
Ogdc 2013 zing me mobileOgdc 2013 zing me mobile
Ogdc 2013 zing me mobileSon Aris
 
Ogdc 2013 the importance of in game event
Ogdc 2013 the importance of in game eventOgdc 2013 the importance of in game event
Ogdc 2013 the importance of in game eventSon Aris
 
Ogdc 2013 spine anim20131
Ogdc 2013 spine anim20131Ogdc 2013 spine anim20131
Ogdc 2013 spine anim20131Son Aris
 
Ogdc 2013 psychology applied 2013
Ogdc 2013 psychology applied 2013Ogdc 2013 psychology applied 2013
Ogdc 2013 psychology applied 2013Son Aris
 
Ogdc 2013 prototyping mobile games
Ogdc 2013 prototyping mobile gamesOgdc 2013 prototyping mobile games
Ogdc 2013 prototyping mobile gamesSon Aris
 
Ogdc 2013 network stragegy for mmo game
Ogdc 2013 network stragegy for mmo gameOgdc 2013 network stragegy for mmo game
Ogdc 2013 network stragegy for mmo gameSon Aris
 
Ogdc 2013 monetization experience
Ogdc 2013 monetization experienceOgdc 2013 monetization experience
Ogdc 2013 monetization experienceSon Aris
 
Ogdc 2013 mobile game trend in southeastasia
Ogdc 2013 mobile game trend in southeastasiaOgdc 2013 mobile game trend in southeastasia
Ogdc 2013 mobile game trend in southeastasiaSon Aris
 
Ogdc 2013 lets remake the wheel
Ogdc 2013 lets remake the wheelOgdc 2013 lets remake the wheel
Ogdc 2013 lets remake the wheelSon Aris
 
Ogdc 2013 how to distribute content touser for social and mobile game
Ogdc 2013 how to distribute content touser for social and mobile gameOgdc 2013 how to distribute content touser for social and mobile game
Ogdc 2013 how to distribute content touser for social and mobile gameSon Aris
 
Ogdc 2013 how retention rate affects aniworld
Ogdc 2013 how retention rate affects aniworldOgdc 2013 how retention rate affects aniworld
Ogdc 2013 how retention rate affects aniworldSon Aris
 
Ogdc 2013 game design problem solving
Ogdc 2013 game design problem solvingOgdc 2013 game design problem solving
Ogdc 2013 game design problem solvingSon Aris
 
Ogdc 2013 choosing the right database for social mobile game
Ogdc 2013 choosing the right database for social mobile gameOgdc 2013 choosing the right database for social mobile game
Ogdc 2013 choosing the right database for social mobile gameSon Aris
 
Ogdc 2013 cross platform game development with html5
Ogdc 2013 cross platform game development with html5Ogdc 2013 cross platform game development with html5
Ogdc 2013 cross platform game development with html5Son Aris
 

More from Son Aris (20)

Main land china mobile app market 2014. what you need to know
Main land china mobile app market 2014. what you need to knowMain land china mobile app market 2014. what you need to know
Main land china mobile app market 2014. what you need to know
 
Vietnam Digital Marketing Market Overview
Vietnam Digital Marketing Market OverviewVietnam Digital Marketing Market Overview
Vietnam Digital Marketing Market Overview
 
Mobile Game In China 2013-2014
Mobile Game In China 2013-2014Mobile Game In China 2013-2014
Mobile Game In China 2013-2014
 
Japans social gaming market 2013
Japans social gaming market 2013Japans social gaming market 2013
Japans social gaming market 2013
 
In mobi app_insight_report
In mobi app_insight_reportIn mobi app_insight_report
In mobi app_insight_report
 
Ogdc 2013 am i ready to go startup
Ogdc 2013 am i ready to go startupOgdc 2013 am i ready to go startup
Ogdc 2013 am i ready to go startup
 
Ogdc 2013 zing me mobile
Ogdc 2013 zing me mobileOgdc 2013 zing me mobile
Ogdc 2013 zing me mobile
 
Ogdc 2013 the importance of in game event
Ogdc 2013 the importance of in game eventOgdc 2013 the importance of in game event
Ogdc 2013 the importance of in game event
 
Ogdc 2013 spine anim20131
Ogdc 2013 spine anim20131Ogdc 2013 spine anim20131
Ogdc 2013 spine anim20131
 
Ogdc 2013 psychology applied 2013
Ogdc 2013 psychology applied 2013Ogdc 2013 psychology applied 2013
Ogdc 2013 psychology applied 2013
 
Ogdc 2013 prototyping mobile games
Ogdc 2013 prototyping mobile gamesOgdc 2013 prototyping mobile games
Ogdc 2013 prototyping mobile games
 
Ogdc 2013 network stragegy for mmo game
Ogdc 2013 network stragegy for mmo gameOgdc 2013 network stragegy for mmo game
Ogdc 2013 network stragegy for mmo game
 
Ogdc 2013 monetization experience
Ogdc 2013 monetization experienceOgdc 2013 monetization experience
Ogdc 2013 monetization experience
 
Ogdc 2013 mobile game trend in southeastasia
Ogdc 2013 mobile game trend in southeastasiaOgdc 2013 mobile game trend in southeastasia
Ogdc 2013 mobile game trend in southeastasia
 
Ogdc 2013 lets remake the wheel
Ogdc 2013 lets remake the wheelOgdc 2013 lets remake the wheel
Ogdc 2013 lets remake the wheel
 
Ogdc 2013 how to distribute content touser for social and mobile game
Ogdc 2013 how to distribute content touser for social and mobile gameOgdc 2013 how to distribute content touser for social and mobile game
Ogdc 2013 how to distribute content touser for social and mobile game
 
Ogdc 2013 how retention rate affects aniworld
Ogdc 2013 how retention rate affects aniworldOgdc 2013 how retention rate affects aniworld
Ogdc 2013 how retention rate affects aniworld
 
Ogdc 2013 game design problem solving
Ogdc 2013 game design problem solvingOgdc 2013 game design problem solving
Ogdc 2013 game design problem solving
 
Ogdc 2013 choosing the right database for social mobile game
Ogdc 2013 choosing the right database for social mobile gameOgdc 2013 choosing the right database for social mobile game
Ogdc 2013 choosing the right database for social mobile game
 
Ogdc 2013 cross platform game development with html5
Ogdc 2013 cross platform game development with html5Ogdc 2013 cross platform game development with html5
Ogdc 2013 cross platform game development with html5
 

Recently uploaded

A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 

Recently uploaded (20)

A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 

Data storage solutions for sns game

  • 1. Data Storage Solutions for SNS game Dinh Nguyen Anh Dung – P2S – G6 – VNG
  • 2. CONTENT • SNS games and SQL-based databases • NoSQL technology and Couchbase • NoSQL does not come without challenges • SNS Storage Engine (SSE)
  • 3. SNS games AND SQL-based databases
  • 4. SNS games characteristics • Huge amount of concurrent requests but require low response time • Accounts can be stored separately – No need for centralized storage – In most cases, no need to put strict constrains on data relationship
  • 5. Native limitations of SQL-based DBMS • Centralized fundamentally – Vertical scale up issue • Schema – High risk (and cost) for updates • Normalized data – Unnecessary overhead: join tables, locking, data constrain check,…
  • 6. Native limitations of SQL-based DBMS Source : NoSQL - WhitePaper
  • 7. Native limitations of SQL-based DBMS • SQL processing overhead at both DBMS and client side. • Most data accesses end up at hard-disk – Very challenging to meet low response time – Internal caching does not help much • Hard to distributed data across multiple- servers
  • 9. NoSQL technology • Persistent distributed hash-table • Active set resides on RAM – Extremely fast response time • Horizontal scale up • Raw and direct data access – set, get, add, inc, dec : no overhead
  • 10. NoSQL technology Key Value Jack.Gold 50123 Jack.Exp 4670 Jack.Coin 700 Peter.Gold 7050 Peter.Exp 20005 Peter.Coin 1 Key Value Peter.Gold 7050 Jack.Exp 4670 Peter.Exp 20005 Key Value Jack.Gold 50123 Key Value Peter.Coin 1 Jack.Coin 700
  • 11. Active set on RAM HDD ACTIVE SET ON RAM CLIENT Lazy write
  • 12. Couchbase server • Based on membase technology • Distributed • Replica • Since 1.8, have native client for PHP • Bucket types – Couchbase (persistent) – Memcache (memory only)
  • 13. NoSQL does not come without challenges
  • 14. Our first SNS game with Couchbase
  • 15. Architecture and design issues • Transition from relational database design to key-value design – Account data => keys : how ? • Only minimum support for locking, concurrency control – add : failed if exists - mutex – cas : read get cas, write failed if cas is out-dated
  • 16. Architecture and design issues • No transaction support – Data corruption becomes so easy! • No high-level data support (e.g. list,queue,…) • No tools for raw data viewing / editing
  • 17. Pitfalls • Too much freedom for developers – Anyone can add / modify any key any time • Epic key design mindset – One key for all : bad performance, concurrency control is a true night mare • Abuse the power of set – Never fail ! Developer LOVE it !
  • 18. SSE – SNS Storage Engine
  • 19. Our second SNS game with Couchbase
  • 20. What is SSE ? • A thin “layer” between developers and the all-mighty Couchbase – SSE is simply a PHP library • Provide better support for locking and concurrency control – Basic support for : Begin – update - commit • Provide high-level data structures – Collection, queue, stack, integer (gold), inc-only integer (exp), binary flags (quest)…
  • 21. What is SSE ? • Minimize the risk of weak concurrency support – Ability to rollback pending writes • Schema – Limit freedom of developers! – No more nightmare for backup and raw data view/editing • Buffers to eliminate repeated read / writes
  • 22. Raw account view / editing tool
  • 25. Multi-instance architecture • Replica is too costly to performance • One node failed means cluster failed • Adding nodes requires rebalance – Only good when having clusters with large number of nodes (more than 20 nodes)
  • 26. Multi-instance architecture • One instance for index (user-to-instance mapping) – Use APC on logic servers to cache / reduce load to index instance • Many instances of data – Dynamically adjust weight on each instance base on average load of instance – Node failure only affects part of the user-base
  • 27. Multi-instance architecture Data Instance 1 Data Instance 2 Data Instance 3 Index Instance Game Logic Game Logic Game Logic APC APC APC Game Logic APC
  • 28. Disavantages • Lower performance of multi-get • Not well balance between instances in terms of accesses
  • 29. How good is SSE for us ? • No more data loss due to concurrency • No more data corruption • No mysterious bugs due to un-intended writes • Reduce more than 3 times workload of server developers