SlideShare a Scribd company logo
1 of 30
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         Key             Value   Key          Value
Peter.Gold   7050          Jack.Gold       50123   Peter.Coin   1
Jack.Exp     4670                                  Jack.Coin    700
Peter.Exp    20005
Active set on RAM
                     CLIENT




                ACTIVE SET ON RAM


                          Lazy write



                    HDD
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

       Game Logic   Game Logic      Game Logic    Game Logic


              APC      APC             APC            APC




    Index                 Data          Data         Data
   Instance            Instance 1    Instance 2   Instance 3
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
OGDC Datastorage Solution_Mr.Dung, Dinh Nguyen Anh

More Related Content

What's hot

Play concurrency
Play concurrencyPlay concurrency
Play concurrency
Justin Long
 
Optimizing MySQL for Cascade Server
Optimizing MySQL for Cascade ServerOptimizing MySQL for Cascade Server
Optimizing MySQL for Cascade Server
hannonhill
 
Drupal High Availability High Performance 2012
Drupal High Availability High Performance 2012Drupal High Availability High Performance 2012
Drupal High Availability High Performance 2012
Amazee Labs
 
Server modeling with mysql
Server modeling with mysqlServer modeling with mysql
Server modeling with mysql
DaeMyung Kang
 
Performance and scalability with drupal
Performance and scalability with drupalPerformance and scalability with drupal
Performance and scalability with drupal
Ronan Berder
 

What's hot (19)

Modern MySQL Monitoring and Dashboards.
Modern MySQL Monitoring and Dashboards.Modern MySQL Monitoring and Dashboards.
Modern MySQL Monitoring and Dashboards.
 
Scaling Pinterest
Scaling PinterestScaling Pinterest
Scaling Pinterest
 
[JSS2015] AlwaysOn 2016
[JSS2015] AlwaysOn 2016[JSS2015] AlwaysOn 2016
[JSS2015] AlwaysOn 2016
 
NSBCon UK nservicebus on Azure by Yves Goeleven
NSBCon UK nservicebus on Azure by Yves GoelevenNSBCon UK nservicebus on Azure by Yves Goeleven
NSBCon UK nservicebus on Azure by Yves Goeleven
 
Scaling High Traffic Web Applications
Scaling High Traffic Web ApplicationsScaling High Traffic Web Applications
Scaling High Traffic Web Applications
 
10 things, an Oracle DBA should care about when moving to PostgreSQL
10 things, an Oracle DBA should care about when moving to PostgreSQL10 things, an Oracle DBA should care about when moving to PostgreSQL
10 things, an Oracle DBA should care about when moving to PostgreSQL
 
Random thoughts on sql server performance
Random thoughts on sql server performanceRandom thoughts on sql server performance
Random thoughts on sql server performance
 
Mysql Optimization
Mysql OptimizationMysql Optimization
Mysql Optimization
 
Play concurrency
Play concurrencyPlay concurrency
Play concurrency
 
Scaling MongoDB in the cloud with Microsoft Azure
Scaling MongoDB in the cloud with Microsoft AzureScaling MongoDB in the cloud with Microsoft Azure
Scaling MongoDB in the cloud with Microsoft Azure
 
Who wants to be a DBA? Roles and Responsibilities
Who wants to be a DBA? Roles and ResponsibilitiesWho wants to be a DBA? Roles and Responsibilities
Who wants to be a DBA? Roles and Responsibilities
 
Day 4 - Models
Day 4 - ModelsDay 4 - Models
Day 4 - Models
 
Making MySQL Administration a Breeze - A Look Into a MySQL DBA's Toolchest
Making MySQL Administration a Breeze - A Look Into a MySQL DBA's ToolchestMaking MySQL Administration a Breeze - A Look Into a MySQL DBA's Toolchest
Making MySQL Administration a Breeze - A Look Into a MySQL DBA's Toolchest
 
Backup and Restore SQL Server Databases in Microsoft Azure
Backup and Restore SQL Server Databases in Microsoft AzureBackup and Restore SQL Server Databases in Microsoft Azure
Backup and Restore SQL Server Databases in Microsoft Azure
 
Optimizing MySQL for Cascade Server
Optimizing MySQL for Cascade ServerOptimizing MySQL for Cascade Server
Optimizing MySQL for Cascade Server
 
Drupal High Availability High Performance 2012
Drupal High Availability High Performance 2012Drupal High Availability High Performance 2012
Drupal High Availability High Performance 2012
 
PostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya KosmodemianskyPostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya Kosmodemiansky
 
Server modeling with mysql
Server modeling with mysqlServer modeling with mysql
Server modeling with mysql
 
Performance and scalability with drupal
Performance and scalability with drupalPerformance and scalability with drupal
Performance and scalability with drupal
 

Viewers also liked

Mobile first 2014 final
Mobile first 2014 finalMobile first 2014 final
Mobile first 2014 final
Thanh Dao
 

Viewers also liked (8)

4. VNG presentation 2011
4. VNG presentation 20114. VNG presentation 2011
4. VNG presentation 2011
 
Mobile first 2014 final
Mobile first 2014 finalMobile first 2014 final
Mobile first 2014 final
 
2. Bluetooth Low Energy và ứng dụng thực tế_Mr. Châu Nguyễn Nhật Thanh VNG Corp.
2. Bluetooth Low Energy và ứng dụng thực tế_Mr. Châu Nguyễn Nhật Thanh VNG Corp.2. Bluetooth Low Energy và ứng dụng thực tế_Mr. Châu Nguyễn Nhật Thanh VNG Corp.
2. Bluetooth Low Energy và ứng dụng thực tế_Mr. Châu Nguyễn Nhật Thanh VNG Corp.
 
What is a Good Game? (From the Perspective of a Game Publisher) | Christopher...
What is a Good Game? (From the Perspective of a Game Publisher) | Christopher...What is a Good Game? (From the Perspective of a Game Publisher) | Christopher...
What is a Good Game? (From the Perspective of a Game Publisher) | Christopher...
 
OGDC2013_ Making of Sky garden Artwork_ Mr Nguyen Ngoc Hoang
OGDC2013_ Making of Sky garden Artwork_  Mr Nguyen Ngoc HoangOGDC2013_ Making of Sky garden Artwork_  Mr Nguyen Ngoc Hoang
OGDC2013_ Making of Sky garden Artwork_ Mr Nguyen Ngoc Hoang
 
Mobile Game Asia 2015 Ho Chi Minh City: The role of a game publisher in Vietnam
Mobile Game Asia 2015 Ho Chi Minh City: The role of a game publisher in VietnamMobile Game Asia 2015 Ho Chi Minh City: The role of a game publisher in Vietnam
Mobile Game Asia 2015 Ho Chi Minh City: The role of a game publisher in Vietnam
 
Zalo Profile
Zalo ProfileZalo Profile
Zalo Profile
 
VNG/IRD - Cloud computing & Openstack discussion 3/5/2014
VNG/IRD - Cloud computing & Openstack discussion 3/5/2014VNG/IRD - Cloud computing & Openstack discussion 3/5/2014
VNG/IRD - Cloud computing & Openstack discussion 3/5/2014
 

Similar to OGDC Datastorage Solution_Mr.Dung, Dinh Nguyen Anh

Data Storage Solutions for SNS game
Data Storage Solutions for SNS gameData Storage Solutions for SNS game
Data Storage Solutions for SNS game
we20
 
Data storage solutions for sns game
Data storage solutions for sns gameData storage solutions for sns game
Data storage solutions for sns game
Son Aris
 
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
 
Sony Computer Entertainment Europe Research & Development Division
Sony Computer Entertainment Europe Research & Development DivisionSony Computer Entertainment Europe Research & Development Division
Sony Computer Entertainment Europe Research & Development Division
Slide_N
 
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
DATAVERSITY
 
My Sql And Search At Craigslist
My Sql And Search At CraigslistMy Sql And Search At Craigslist
My Sql And Search At Craigslist
MySQLConference
 

Similar to OGDC Datastorage Solution_Mr.Dung, Dinh Nguyen Anh (20)

Data Storage Solutions for SNS game
Data Storage Solutions for SNS gameData Storage Solutions for SNS game
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
 
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
 
Yes sql08 inmemorydb
Yes sql08 inmemorydbYes sql08 inmemorydb
Yes sql08 inmemorydb
 
Intro to Cassandra
Intro to CassandraIntro to Cassandra
Intro to Cassandra
 
Fixing twitter
Fixing twitterFixing twitter
Fixing twitter
 
Fixing_Twitter
Fixing_TwitterFixing_Twitter
Fixing_Twitter
 
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 ...
 
Building a High Performance Analytics Platform
Building a High Performance Analytics PlatformBuilding a High Performance Analytics Platform
Building a High Performance Analytics Platform
 
A Global In-memory Data System for MySQL
A Global In-memory Data System for MySQLA Global In-memory Data System for MySQL
A Global In-memory Data System for MySQL
 
Running MongoDB in the Cloud
Running MongoDB in the CloudRunning MongoDB in the Cloud
Running MongoDB in the Cloud
 
Inside the IT Territory game server / Mark Lokshin (IT Territory)
Inside the IT Territory game server / Mark Lokshin (IT Territory)Inside the IT Territory game server / Mark Lokshin (IT Territory)
Inside the IT Territory game server / Mark Lokshin (IT Territory)
 
Sony Computer Entertainment Europe Research & Development Division
Sony Computer Entertainment Europe Research & Development DivisionSony Computer Entertainment Europe Research & Development Division
Sony Computer Entertainment Europe Research & Development Division
 
MySQL Cluster Scaling to a Billion Queries
MySQL Cluster Scaling to a Billion QueriesMySQL Cluster Scaling to a Billion Queries
MySQL Cluster Scaling to a Billion Queries
 
High-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and JavaHigh-Performance Storage Services with HailDB and Java
High-Performance Storage Services with HailDB and Java
 
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
 
PayPal Big Data and MySQL Cluster
PayPal Big Data and MySQL ClusterPayPal Big Data and MySQL Cluster
PayPal Big Data and MySQL Cluster
 
Cassandra Core Concepts
Cassandra Core ConceptsCassandra Core Concepts
Cassandra Core Concepts
 
My Sql And Search At Craigslist
My Sql And Search At CraigslistMy Sql And Search At Craigslist
My Sql And Search At Craigslist
 

More from Buff Nguyen

More from Buff Nguyen (18)

OGDC2012 Vision of VN Game Industry_Mr.Minh,Le Hong
OGDC2012 Vision of VN Game Industry_Mr.Minh,Le HongOGDC2012 Vision of VN Game Industry_Mr.Minh,Le Hong
OGDC2012 Vision of VN Game Industry_Mr.Minh,Le Hong
 
OGDC2012 Just-in-time Operation in Social Games_Mr.Eiji Okuda_Glooops
OGDC2012 Just-in-time Operation in Social Games_Mr.Eiji Okuda_GlooopsOGDC2012 Just-in-time Operation in Social Games_Mr.Eiji Okuda_Glooops
OGDC2012 Just-in-time Operation in Social Games_Mr.Eiji Okuda_Glooops
 
OGDC2012 Thiet Ke Sang Tao Cho Mobile Game_Ms.Nhung, Nguyen Hong_Ruby Cell
OGDC2012 Thiet Ke Sang Tao Cho Mobile Game_Ms.Nhung, Nguyen Hong_Ruby CellOGDC2012 Thiet Ke Sang Tao Cho Mobile Game_Ms.Nhung, Nguyen Hong_Ruby Cell
OGDC2012 Thiet Ke Sang Tao Cho Mobile Game_Ms.Nhung, Nguyen Hong_Ruby Cell
 
OGDC2012 Driving Vietnam's and Your Own Future_Mr.Tetsuya Mori_DeNA
OGDC2012 Driving Vietnam's and Your Own Future_Mr.Tetsuya Mori_DeNAOGDC2012 Driving Vietnam's and Your Own Future_Mr.Tetsuya Mori_DeNA
OGDC2012 Driving Vietnam's and Your Own Future_Mr.Tetsuya Mori_DeNA
 
OGDC2012 Cross-Platform Development On Mobile Devices_Mr.Takaaki Mizuno_DeNA
OGDC2012 Cross-Platform Development On Mobile Devices_Mr.Takaaki Mizuno_DeNAOGDC2012 Cross-Platform Development On Mobile Devices_Mr.Takaaki Mizuno_DeNA
OGDC2012 Cross-Platform Development On Mobile Devices_Mr.Takaaki Mizuno_DeNA
 
OGDC2012 Game Designer_Mr.Nicolas_ Phuong Hoang Enix
OGDC2012 Game Designer_Mr.Nicolas_ Phuong Hoang EnixOGDC2012 Game Designer_Mr.Nicolas_ Phuong Hoang Enix
OGDC2012 Game Designer_Mr.Nicolas_ Phuong Hoang Enix
 
OGDC2012 2D Art For Realtime 3D Web Game_Mr. Khanh, Pham Ngoc Vu
OGDC2012 2D Art For Realtime 3D Web Game_Mr. Khanh, Pham Ngoc VuOGDC2012 2D Art For Realtime 3D Web Game_Mr. Khanh, Pham Ngoc Vu
OGDC2012 2D Art For Realtime 3D Web Game_Mr. Khanh, Pham Ngoc Vu
 
OGDC2012 SNS Balance_2012_Mr.Le Anh Minh
OGDC2012 SNS Balance_2012_Mr.Le Anh MinhOGDC2012 SNS Balance_2012_Mr.Le Anh Minh
OGDC2012 SNS Balance_2012_Mr.Le Anh Minh
 
OGDC2012 Building An MMOG For SNS Audiences_Mr. Quang, Dang Hong
OGDC2012 Building An MMOG For SNS Audiences_Mr. Quang, Dang HongOGDC2012 Building An MMOG For SNS Audiences_Mr. Quang, Dang Hong
OGDC2012 Building An MMOG For SNS Audiences_Mr. Quang, Dang Hong
 
OGDC2012 Data centric Design & Operation_Mr. Hieu, Nguyen Chi
OGDC2012 Data centric Design & Operation_Mr. Hieu, Nguyen ChiOGDC2012 Data centric Design & Operation_Mr. Hieu, Nguyen Chi
OGDC2012 Data centric Design & Operation_Mr. Hieu, Nguyen Chi
 
OGDC2012 Lua In Game_Mr. Van, Nguyen Ngoc
OGDC2012 Lua In Game_Mr. Van, Nguyen NgocOGDC2012 Lua In Game_Mr. Van, Nguyen Ngoc
OGDC2012 Lua In Game_Mr. Van, Nguyen Ngoc
 
OGDC Recruiting and Developing Human Resource in Game Studio_Mr. Tu, Truong D...
OGDC Recruiting and Developing Human Resource in Game Studio_Mr. Tu, Truong D...OGDC Recruiting and Developing Human Resource in Game Studio_Mr. Tu, Truong D...
OGDC Recruiting and Developing Human Resource in Game Studio_Mr. Tu, Truong D...
 
OGDC2012_The Story Inside Art Of Cam Gioi 3_Mr. Lam, Nguyen Quang
OGDC2012_The Story Inside Art Of Cam Gioi 3_Mr. Lam, Nguyen QuangOGDC2012_The Story Inside Art Of Cam Gioi 3_Mr. Lam, Nguyen Quang
OGDC2012_The Story Inside Art Of Cam Gioi 3_Mr. Lam, Nguyen Quang
 
OGDC2012 Game interface Design_Mr.Phu, Nguyen Xuan
OGDC2012 Game interface Design_Mr.Phu, Nguyen XuanOGDC2012 Game interface Design_Mr.Phu, Nguyen Xuan
OGDC2012 Game interface Design_Mr.Phu, Nguyen Xuan
 
OGDC2012 A Practical Architecture Design For MMO Casual Game_Mr. An, Ngo Thai
OGDC2012 A Practical Architecture Design For MMO Casual Game_Mr. An, Ngo ThaiOGDC2012 A Practical Architecture Design For MMO Casual Game_Mr. An, Ngo Thai
OGDC2012 A Practical Architecture Design For MMO Casual Game_Mr. An, Ngo Thai
 
OGDC2012 Maintaining Longevity Of An SNS Game_Mr. Nhut, Nguyen Minh
OGDC2012 Maintaining Longevity Of An SNS Game_Mr. Nhut, Nguyen MinhOGDC2012 Maintaining Longevity Of An SNS Game_Mr. Nhut, Nguyen Minh
OGDC2012 Maintaining Longevity Of An SNS Game_Mr. Nhut, Nguyen Minh
 
OGDC2012 Art Style In Game Hang Rong_Mr. Hieu, Luc Hoang
OGDC2012 Art Style In Game Hang Rong_Mr. Hieu, Luc HoangOGDC2012 Art Style In Game Hang Rong_Mr. Hieu, Luc Hoang
OGDC2012 Art Style In Game Hang Rong_Mr. Hieu, Luc Hoang
 
OGDC2012 Operating Vietnamese Games In China_Mr.Liu C Christopher
OGDC2012 Operating Vietnamese Games In China_Mr.Liu C ChristopherOGDC2012 Operating Vietnamese Games In China_Mr.Liu C Christopher
OGDC2012 Operating Vietnamese Games In China_Mr.Liu C Christopher
 

Recently uploaded

Constitution of Company Article of Association
Constitution of Company Article of AssociationConstitution of Company Article of Association
Constitution of Company Article of Association
seri bangash
 
PEMATANG SIANTAR 0851/8063/4797 JUAL OBAT ABORSI CYTOTEC PEMATANG SIANTAR
PEMATANG SIANTAR 0851/8063/4797 JUAL OBAT ABORSI CYTOTEC PEMATANG SIANTARPEMATANG SIANTAR 0851/8063/4797 JUAL OBAT ABORSI CYTOTEC PEMATANG SIANTAR
PEMATANG SIANTAR 0851/8063/4797 JUAL OBAT ABORSI CYTOTEC PEMATANG SIANTAR
doktercalysta
 
What is paper chromatography, principal, procedure,types, diagram, advantages...
What is paper chromatography, principal, procedure,types, diagram, advantages...What is paper chromatography, principal, procedure,types, diagram, advantages...
What is paper chromatography, principal, procedure,types, diagram, advantages...
srcw2322l101
 
ابو ظبي اعلان | - سايتوتك في الامارات حبوب الاجهاض للبيع ف حبوب الإجهاض ... ا...
ابو ظبي اعلان | - سايتوتك في الامارات حبوب الاجهاض للبيع ف حبوب الإجهاض ... ا...ابو ظبي اعلان | - سايتوتك في الامارات حبوب الاجهاض للبيع ف حبوب الإجهاض ... ا...
ابو ظبي اعلان | - سايتوتك في الامارات حبوب الاجهاض للبيع ف حبوب الإجهاض ... ا...
brennadilys816
 
NewBase 17 May 2024 Energy News issue - 1725 by Khaled Al Awadi_compresse...
NewBase   17 May  2024  Energy News issue - 1725 by Khaled Al Awadi_compresse...NewBase   17 May  2024  Energy News issue - 1725 by Khaled Al Awadi_compresse...
NewBase 17 May 2024 Energy News issue - 1725 by Khaled Al Awadi_compresse...
Khaled Al Awadi
 

Recently uploaded (20)

Constitution of Company Article of Association
Constitution of Company Article of AssociationConstitution of Company Article of Association
Constitution of Company Article of Association
 
PEMATANG SIANTAR 0851/8063/4797 JUAL OBAT ABORSI CYTOTEC PEMATANG SIANTAR
PEMATANG SIANTAR 0851/8063/4797 JUAL OBAT ABORSI CYTOTEC PEMATANG SIANTARPEMATANG SIANTAR 0851/8063/4797 JUAL OBAT ABORSI CYTOTEC PEMATANG SIANTAR
PEMATANG SIANTAR 0851/8063/4797 JUAL OBAT ABORSI CYTOTEC PEMATANG SIANTAR
 
Progress Report - UKG Analyst Summit 2024 - A lot to do - Good Progress1-1.pdf
Progress Report - UKG Analyst Summit 2024 - A lot to do - Good Progress1-1.pdfProgress Report - UKG Analyst Summit 2024 - A lot to do - Good Progress1-1.pdf
Progress Report - UKG Analyst Summit 2024 - A lot to do - Good Progress1-1.pdf
 
Pay after result spell caster (,$+27834335081)@ bring back lost lover same da...
Pay after result spell caster (,$+27834335081)@ bring back lost lover same da...Pay after result spell caster (,$+27834335081)@ bring back lost lover same da...
Pay after result spell caster (,$+27834335081)@ bring back lost lover same da...
 
Inside the Black Box of Venture Capital (VC)
Inside the Black Box of Venture Capital (VC)Inside the Black Box of Venture Capital (VC)
Inside the Black Box of Venture Capital (VC)
 
wagamamaLab presentation @MIT 20240509 IRODORI
wagamamaLab presentation @MIT 20240509 IRODORIwagamamaLab presentation @MIT 20240509 IRODORI
wagamamaLab presentation @MIT 20240509 IRODORI
 
What is paper chromatography, principal, procedure,types, diagram, advantages...
What is paper chromatography, principal, procedure,types, diagram, advantages...What is paper chromatography, principal, procedure,types, diagram, advantages...
What is paper chromatography, principal, procedure,types, diagram, advantages...
 
ابو ظبي اعلان | - سايتوتك في الامارات حبوب الاجهاض للبيع ف حبوب الإجهاض ... ا...
ابو ظبي اعلان | - سايتوتك في الامارات حبوب الاجهاض للبيع ف حبوب الإجهاض ... ا...ابو ظبي اعلان | - سايتوتك في الامارات حبوب الاجهاض للبيع ف حبوب الإجهاض ... ا...
ابو ظبي اعلان | - سايتوتك في الامارات حبوب الاجهاض للبيع ف حبوب الإجهاض ... ا...
 
Global Internal Audit Standards 2024.pdf
Global Internal Audit Standards 2024.pdfGlobal Internal Audit Standards 2024.pdf
Global Internal Audit Standards 2024.pdf
 
Guide to Networking Essentials 8th Edition by Greg Tomsho solution manual.doc
Guide to Networking Essentials 8th Edition by Greg Tomsho solution manual.docGuide to Networking Essentials 8th Edition by Greg Tomsho solution manual.doc
Guide to Networking Essentials 8th Edition by Greg Tomsho solution manual.doc
 
NewBase 17 May 2024 Energy News issue - 1725 by Khaled Al Awadi_compresse...
NewBase   17 May  2024  Energy News issue - 1725 by Khaled Al Awadi_compresse...NewBase   17 May  2024  Energy News issue - 1725 by Khaled Al Awadi_compresse...
NewBase 17 May 2024 Energy News issue - 1725 by Khaled Al Awadi_compresse...
 
Innomantra Viewpoint - Building Moonshots : May-Jun 2024.pdf
Innomantra Viewpoint - Building Moonshots : May-Jun 2024.pdfInnomantra Viewpoint - Building Moonshots : May-Jun 2024.pdf
Innomantra Viewpoint - Building Moonshots : May-Jun 2024.pdf
 
Hyundai capital 2024 1q Earnings release
Hyundai capital 2024 1q Earnings releaseHyundai capital 2024 1q Earnings release
Hyundai capital 2024 1q Earnings release
 
Top^Clinic ^%[+27785538335__Safe*Women's clinic//Abortion Pills In Harare
Top^Clinic ^%[+27785538335__Safe*Women's clinic//Abortion Pills In HarareTop^Clinic ^%[+27785538335__Safe*Women's clinic//Abortion Pills In Harare
Top^Clinic ^%[+27785538335__Safe*Women's clinic//Abortion Pills In Harare
 
1Q24_EN hyundai capital 1q performance
1Q24_EN   hyundai capital 1q performance1Q24_EN   hyundai capital 1q performance
1Q24_EN hyundai capital 1q performance
 
Stages of Startup Funding - An Explainer
Stages of Startup Funding - An ExplainerStages of Startup Funding - An Explainer
Stages of Startup Funding - An Explainer
 
How to refresh to be fit for the future world
How to refresh to be fit for the future worldHow to refresh to be fit for the future world
How to refresh to be fit for the future world
 
Creative Ideas for Interactive Team Presentations
Creative Ideas for Interactive Team PresentationsCreative Ideas for Interactive Team Presentations
Creative Ideas for Interactive Team Presentations
 
WAM Corporate Presentation May 2024_w.pdf
WAM Corporate Presentation May 2024_w.pdfWAM Corporate Presentation May 2024_w.pdf
WAM Corporate Presentation May 2024_w.pdf
 
hyundai capital 2023 consolidated financial statements
hyundai capital 2023 consolidated financial statementshyundai capital 2023 consolidated financial statements
hyundai capital 2023 consolidated financial statements
 

OGDC Datastorage Solution_Mr.Dung, Dinh Nguyen Anh

  • 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 Key Value Key Value Peter.Gold 7050 Jack.Gold 50123 Peter.Coin 1 Jack.Exp 4670 Jack.Coin 700 Peter.Exp 20005
  • 11. Active set on RAM CLIENT ACTIVE SET ON RAM Lazy write HDD
  • 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 Game Logic Game Logic Game Logic Game Logic APC APC APC APC Index Data Data Data Instance Instance 1 Instance 2 Instance 3
  • 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