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 Database
zingopen
 
Introduction to AJAX
Introduction to AJAXIntroduction to AJAX
Introduction to AJAX
Abzetdin Adamov
 
Drupal Performance and Scaling
Drupal Performance and ScalingDrupal Performance and Scaling
Drupal Performance and Scaling
Gerald 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, RightScale
mmoline
 
Using flash on the server side
Using flash on the server sideUsing flash on the server side
Using flash on the server side
Howard 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 - DDD7
Phil 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 NoSQL
Philipp 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
 

Viewers also liked

Going to hell_slideshare
Going to hell_slideshareGoing to hell_slideshare
Going to hell_slideshare
Luca Rossi
 
Conversation Practices and Network Structure in Twitter
Conversation Practices and Network Structure in TwitterConversation Practices and Network Structure in Twitter
Conversation Practices and Network Structure in Twitter
Luca Rossi
 
Ecologia spettatorialità
Ecologia spettatorialitàEcologia spettatorialità
Ecologia spettatorialità
Luca Rossi
 
Gaming in SNS context
Gaming in SNS contextGaming in SNS context
Gaming in SNS context
Luca Rossi
 
News Italia 2012
News Italia 2012News Italia 2012
News Italia 2012
Luca Rossi
 
Experience of discussing with 5 gamergate people 2015
Experience of discussing with 5 gamergate people 2015Experience of discussing with 5 gamergate people 2015
Experience of discussing with 5 gamergate people 2015
Staffan Björk
 
The Genesis of Crisis Communication: from Witnesses to Gatewatchers
The Genesis of Crisis Communication: from Witnesses to GatewatchersThe Genesis of Crisis Communication: from Witnesses to Gatewatchers
The Genesis of Crisis Communication: from Witnesses to Gatewatchers
Luca Rossi
 
Social Media in 2013 italian Elections
Social Media in 2013 italian Elections Social Media in 2013 italian Elections
Social Media in 2013 italian Elections
Luca Rossi
 

Viewers also liked (8)

Going to hell_slideshare
Going to hell_slideshareGoing to hell_slideshare
Going to hell_slideshare
 
Conversation Practices and Network Structure in Twitter
Conversation Practices and Network Structure in TwitterConversation Practices and Network Structure in Twitter
Conversation Practices and Network Structure in Twitter
 
Ecologia spettatorialità
Ecologia spettatorialitàEcologia spettatorialità
Ecologia spettatorialità
 
Gaming in SNS context
Gaming in SNS contextGaming in SNS context
Gaming in SNS context
 
News Italia 2012
News Italia 2012News Italia 2012
News Italia 2012
 
Experience of discussing with 5 gamergate people 2015
Experience of discussing with 5 gamergate people 2015Experience of discussing with 5 gamergate people 2015
Experience of discussing with 5 gamergate people 2015
 
The Genesis of Crisis Communication: from Witnesses to Gatewatchers
The Genesis of Crisis Communication: from Witnesses to GatewatchersThe Genesis of Crisis Communication: from Witnesses to Gatewatchers
The Genesis of Crisis Communication: from Witnesses to Gatewatchers
 
Social Media in 2013 italian Elections
Social Media in 2013 italian Elections Social Media in 2013 italian Elections
Social Media in 2013 italian Elections
 

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 game
action.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 databases
NoSQL databasesNoSQL databases
NoSQL databases
Marin Dimitrov
 
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
 
NoSql
NoSqlNoSql
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
 
NoSQL_Night
NoSQL_NightNoSQL_Night
NoSQL_Night
Clarence J M Tauro
 
No sql databases
No sql databasesNo sql databases
No sql databases
swathika rajan
 
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
smallerror
 
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
xlight
 

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 Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
 
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
 

More from we20

Nielsen SEA Cross-platform Report 2014
Nielsen SEA Cross-platform Report 2014Nielsen SEA Cross-platform Report 2014
Nielsen SEA Cross-platform Report 2014
we20
 
Hành vi và xu hướng sử dụng Internet tại Việt Nam
Hành vi và xu hướng sử dụng Internet tại Việt NamHành vi và xu hướng sử dụng Internet tại Việt Nam
Hành vi và xu hướng sử dụng Internet tại Việt Nam
we20
 
Báo Cáo Hành Vi Người Tiêu Dùng Online
Báo Cáo Hành Vi Người Tiêu Dùng OnlineBáo Cáo Hành Vi Người Tiêu Dùng Online
Báo Cáo Hành Vi Người Tiêu Dùng Online
we20
 
Bao cao tai nguyen Internet 2014
Bao cao tai nguyen Internet 2014Bao cao tai nguyen Internet 2014
Bao cao tai nguyen Internet 2014
we20
 
Report on Vietnam Internet resources 2014
Report on Vietnam Internet resources 2014Report on Vietnam Internet resources 2014
Report on Vietnam Internet resources 2014
we20
 
Internet Trends 2014
Internet Trends 2014 Internet Trends 2014
Internet Trends 2014
we20
 
2014 ASIA-PACIFIC DIGITAL OVERVIEW
2014 ASIA-PACIFIC DIGITAL OVERVIEW2014 ASIA-PACIFIC DIGITAL OVERVIEW
2014 ASIA-PACIFIC DIGITAL OVERVIEW
we20
 
2014 internet trends
2014 internet trends2014 internet trends
2014 internet trends
we20
 
Personalized Recommendation - The Key for Engagement?
Personalized Recommendation - The Key for Engagement?Personalized Recommendation - The Key for Engagement?
Personalized Recommendation - The Key for Engagement?
we20
 
VIETNAM E-COMMERCE REPORT 2013
VIETNAM E-COMMERCE REPORT 2013VIETNAM E-COMMERCE REPORT 2013
VIETNAM E-COMMERCE REPORT 2013
we20
 
Báo cáo Thương mại điện tử Việt Nam 2013
Báo cáo Thương mại điện tử Việt Nam 2013Báo cáo Thương mại điện tử Việt Nam 2013
Báo cáo Thương mại điện tử Việt Nam 2013we20
 
ONLINE PAYMENT ACTUAL SITUATION & POTENTIAL
ONLINE PAYMENT ACTUAL SITUATION & POTENTIALONLINE PAYMENT ACTUAL SITUATION & POTENTIAL
ONLINE PAYMENT ACTUAL SITUATION & POTENTIAL
we20
 
E-COMMERCE IN VN
E-COMMERCE IN VNE-COMMERCE IN VN
E-COMMERCE IN VN
we20
 
Online Mobile Game with Mobicom_eng ver.
Online Mobile Game with Mobicom_eng ver.Online Mobile Game with Mobicom_eng ver.
Online Mobile Game with Mobicom_eng ver.
we20
 
NÓI VỀ TMĐT Ở VN
NÓI VỀ TMĐT Ở VNNÓI VỀ TMĐT Ở VN
NÓI VỀ TMĐT Ở VNwe20
 
MUA CHUNG VA KINH NGHIEM PHAT TRIEN SOHAPAY
MUA CHUNG VA KINH NGHIEM PHAT TRIEN SOHAPAYMUA CHUNG VA KINH NGHIEM PHAT TRIEN SOHAPAY
MUA CHUNG VA KINH NGHIEM PHAT TRIEN SOHAPAY
we20
 
MOBILE APP _VIET VER
MOBILE APP _VIET VERMOBILE APP _VIET VER
MOBILE APP _VIET VERwe20
 
MOBILE APP _ENG VER.
MOBILE APP _ENG VER.MOBILE APP _ENG VER.
MOBILE APP _ENG VER.
we20
 
Phát triển Mobile Application
Phát triển Mobile ApplicationPhát triển Mobile Application
Phát triển Mobile Applicationwe20
 
Develop Mobile Application
Develop Mobile ApplicationDevelop Mobile Application
Develop Mobile Application
we20
 

More from we20 (20)

Nielsen SEA Cross-platform Report 2014
Nielsen SEA Cross-platform Report 2014Nielsen SEA Cross-platform Report 2014
Nielsen SEA Cross-platform Report 2014
 
Hành vi và xu hướng sử dụng Internet tại Việt Nam
Hành vi và xu hướng sử dụng Internet tại Việt NamHành vi và xu hướng sử dụng Internet tại Việt Nam
Hành vi và xu hướng sử dụng Internet tại Việt Nam
 
Báo Cáo Hành Vi Người Tiêu Dùng Online
Báo Cáo Hành Vi Người Tiêu Dùng OnlineBáo Cáo Hành Vi Người Tiêu Dùng Online
Báo Cáo Hành Vi Người Tiêu Dùng Online
 
Bao cao tai nguyen Internet 2014
Bao cao tai nguyen Internet 2014Bao cao tai nguyen Internet 2014
Bao cao tai nguyen Internet 2014
 
Report on Vietnam Internet resources 2014
Report on Vietnam Internet resources 2014Report on Vietnam Internet resources 2014
Report on Vietnam Internet resources 2014
 
Internet Trends 2014
Internet Trends 2014 Internet Trends 2014
Internet Trends 2014
 
2014 ASIA-PACIFIC DIGITAL OVERVIEW
2014 ASIA-PACIFIC DIGITAL OVERVIEW2014 ASIA-PACIFIC DIGITAL OVERVIEW
2014 ASIA-PACIFIC DIGITAL OVERVIEW
 
2014 internet trends
2014 internet trends2014 internet trends
2014 internet trends
 
Personalized Recommendation - The Key for Engagement?
Personalized Recommendation - The Key for Engagement?Personalized Recommendation - The Key for Engagement?
Personalized Recommendation - The Key for Engagement?
 
VIETNAM E-COMMERCE REPORT 2013
VIETNAM E-COMMERCE REPORT 2013VIETNAM E-COMMERCE REPORT 2013
VIETNAM E-COMMERCE REPORT 2013
 
Báo cáo Thương mại điện tử Việt Nam 2013
Báo cáo Thương mại điện tử Việt Nam 2013Báo cáo Thương mại điện tử Việt Nam 2013
Báo cáo Thương mại điện tử Việt Nam 2013
 
ONLINE PAYMENT ACTUAL SITUATION & POTENTIAL
ONLINE PAYMENT ACTUAL SITUATION & POTENTIALONLINE PAYMENT ACTUAL SITUATION & POTENTIAL
ONLINE PAYMENT ACTUAL SITUATION & POTENTIAL
 
E-COMMERCE IN VN
E-COMMERCE IN VNE-COMMERCE IN VN
E-COMMERCE IN VN
 
Online Mobile Game with Mobicom_eng ver.
Online Mobile Game with Mobicom_eng ver.Online Mobile Game with Mobicom_eng ver.
Online Mobile Game with Mobicom_eng ver.
 
NÓI VỀ TMĐT Ở VN
NÓI VỀ TMĐT Ở VNNÓI VỀ TMĐT Ở VN
NÓI VỀ TMĐT Ở VN
 
MUA CHUNG VA KINH NGHIEM PHAT TRIEN SOHAPAY
MUA CHUNG VA KINH NGHIEM PHAT TRIEN SOHAPAYMUA CHUNG VA KINH NGHIEM PHAT TRIEN SOHAPAY
MUA CHUNG VA KINH NGHIEM PHAT TRIEN SOHAPAY
 
MOBILE APP _VIET VER
MOBILE APP _VIET VERMOBILE APP _VIET VER
MOBILE APP _VIET VER
 
MOBILE APP _ENG VER.
MOBILE APP _ENG VER.MOBILE APP _ENG VER.
MOBILE APP _ENG VER.
 
Phát triển Mobile Application
Phát triển Mobile ApplicationPhát triển Mobile Application
Phát triển Mobile Application
 
Develop Mobile Application
Develop Mobile ApplicationDevelop Mobile Application
Develop Mobile Application
 

Recently uploaded

Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
jpupo2018
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
Federico Razzoli
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
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
 

Recently uploaded (20)

Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
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
 

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