SlideShare a Scribd company logo
1 of 37
MongoDB in KIXEYE Analytics
Ben Goswami
Game Play
           BP Video clips ( http://www.youtube.com/watch?v=uUHzppVn8WM)




©2011 Kixeye, Private and Confidential
Agenda


       • Data scaling problems at KIXEYE analytics and
               what technologies we use
       • Example application: Cheater Detection
               Engine
       • How MongoDB helped us to solve it


©2011 Kixeye, Private and Confidential
Game Play
               BP Attack Video (https://www.youtube.com/watch?v=qud_-18D2MU)




©2011 Kixeye, Private and Confidential
Game Play and Data
       • Games generate lots of click data

       • Click = event
                 o      time of the event
                 o      what happened before or after
                 o      how the events are correlated



©2011 Kixeye, Private and Confidential
Attack: {
  attacker : {
                   user:123
                   player_level: 31
                   fleet:
                        {
                           1:{
                                   Weapons: {
                                      name:“Ripper Cannon IV”
                                      damage:306
                                         accuracy:55
                                    }
                                 armors:{
                                     }
                                     …
                              }
                           2: {
                               }
_id" : ObjectId("506e23001d4524122c00004b"), "ip" : "10.54.72.206", "dt" :{ "_id" :
ObjectId("506e23001d4524dd2b0000bd"), "ip" : "10.54.72.206",
                         }
"&attacker_level=42&defender=0&defender_ext=salvage&defender_level=25&attack_type=PVE&attacking_
               }
units=%7b%224071%22%3a%5b5%2c3%2c0%5d%7d&defending_units=%7b%221040%22%3a%5b4%2c
    defender: {
0%2c4%5d%2c%221060%22%3a%5b1%2c0%2c1%5d%7d&attacking_shipconfig=%7b%22ships%22%3a
    }
%5b%7b%22armors%22%3a%5b333%2c333%2c333%2c333%5d%2c%22weapons%22%3a%5b134%2c1
    attack_time: 100354563
34%2c193%2c134%2c134%2c134%2c134%2c134%5d%2c%22specials%22%3a%5b542%2c561%2c571
    attack_duration:290
%2c501%5d%2c%22hullID%22%3a4071%2c%22tacticalModules%22%3a%5b%5d%2c%22actives%22%3
    sector:7
a%7b%22hp%22%3a9317.68457%2c%22rank%22%3a4%2c%22fltp%22%3a5%2c%22bid%22%3a54834
  …
79%2c%22f%22%3a0%2c%22id%22%3a110%2c%22flt%22%3a5%2c%22vxp%22%3a10.858466%7d%7
d%2c%7b%22armors%22%3a%5b333%2c333%2c333%2c333.. "stage" : "new" }
  }
How much data?

       •Multi TBs / month (4-5x in next 6 months)

       •Critical : Volume reads with speed

       •< 1% data has actionable intelligence




©2011 Kixeye, Private and Confidential
MongoDB in KIXEYE


       •Why:
         – fast read + writes for high volume
         – Document based architecture, schema less
         – Indexing , auto failover, auto sharding
       •Where:
         – Games , KIXEYE Platform
         – Analytics, Logging


©2011 Kixeye, Private and Confidential
Data technologies at Analytics

     Technology                          Data Volume   Query Type    I/O speed


     MySQL                               Small         Adhoc +       Read fast, only
                                         < 300 GB      Pre defined   Aggregated data
     Mongo                               Mid           Predefined    Read + Write speed
                                         < 2 TB                      fast

     Hadoop      X-Large                               Adhoc         Read slow
     (Hive+HDFS) 2 TB+                                               writes: only insert
                                                                     no update



©2011 Kixeye, Private and Confidential
An Example Application

       Cheater Detection engine for games:
         How mongoDB helped us




©2011 Kixeye, Private and Confidential
A simple backyard at start in BYM
Currency is time or $ or both




©2011 Kixeye, Private and Confidential
Sample record

       •       4kb nested jason block
       •       base = {
                base_name: “sweet_mango_db”
                    resources {
                                               1: { name: "storage silo"
                                                        level: 5,
                                                        mode:“built"
                                                        time:123456902
                                               2: { …
                                         ..}
                        ...}
       ...} ..}
©2011 Kixeye, Private and Confidential
How people cheat?



       • Each upgrade or repair
               takes pre defined time

       • if time+payment < predefined time = cheater
       • victims chain create snowball effect

©2011 Kixeye, Private and Confidential
..and why they cheat...




©2011 Kixeye, Private and Confidential
Data volume for cheater detection

          • 16Mil * 50 * 10 * 3
            *....
          • multiple time based
            snapshots
          • 0.01 % cheaters
          • Detect < 5 mins
          • That's searching
                  through lot of data
                  fast

©2011 Kixeye, Private and Confidential
.. and boss told


             • Catch and auto
                    ban cheaters

             • Don't label a good
                    guy a cheater




©2011 Kixeye, Private and Confidential
..team was ready for the challenge



    • Speed+Accuracy of
           application

    • Technology evalauation



©2011 Kixeye, Private and Confidential
MongoDB fits the requirement


       • read writes are fast because memory mapped
               files compared to mysql+memcache or hbase
       • Unstructured data => need schema less
       • indexing on a nested data element



©2011 Kixeye, Private and Confidential
.. more on why mongo


       • Auto purging thru TTL
       • Auto sharding during traffic spikes
       • Binary data support, fast uncompression
       • Capped collection: writes faster



©2011 Kixeye, Private and Confidential
Development decision points

       • Old map-reduce (prior to 2.2) vs New
               Aggregation framework
       • Global write locks removal in 2.2
       • Lazy and Non lazy inserts



©2011 Kixeye, Private and Confidential
Result


   • 100+ cheaters caught
     per hour

   • Better game balancing

   • $$ saved



©2011 Kixeye, Private and Confidential
Wrap up : A good partnership

       •Good partnership with KIXEYE and 10gen
       •Consulting/Training and MMS service was very
        helpful
       •More mongoDB usages in future at KIXEYE




©2011 Kixeye, Private and Confidential
{Status: “The End”}

       •{ next_action: “Q&A” }

       • Like this jason? meet us outside – KIXEYE recruiting
       { Company                                     : “KIXEYE”,
           “Engineers/Total _employee” : “65%”,
           Culture                       : [“Fun”, “Innovative”, “Passionate”]
           Analytics_engg : { technology : “mongo, hadoop , mysql”,
                                           tag        : “big data, geek” }
       }

©2011 Kixeye, Private and Confidential
Extra slides
Game Play
               BP Attack Video (https://www.youtube.com/watch?v=qud_-18D2MU)




©2011 Kixeye, Private and Confidential
Usage of data

• Data mining and aggregation to
  o Optimize User Acquisition
  o Optimize game analyzing game play
    behavior and
                      Algo +
              Data   Optimize
                         r

                       Feedback
Mongo - pain points




       • Diskspace handling
       • No sql syntax support
       • Capped collection - no deletes allowed
       • No good client GUI based tool

©2011 Kixeye, Private and Confidential
Damaged building is useless
Data related to player

       •       building has 5-10 levels
       •       building can have 3 states [built, damaged, repair in progress)
       •       an average base can have 50+ buildings
       •       16 million such bases
       •       45k people at any second [i.e base gets updated]
       •       Each level up or repair has time delay. People pay to reduce delay




©2011 Kixeye, Private and Confidential
Map-reduce in cheater detection


       function mapf()
       {
           emit(this.userid,             {userid:this.userid, total_time:this.length, bldg_id:1} ;
       }


       function reducef(key, values)
       {
           var r = {userid:key, total_time:0, count:0, avg_time:0};
           values.forEach(function(v)
                          {r.total_time += v.total_time; });       return r;
       }


       function finalizef(key, value) { ... }


©2011 Kixeye, Private and Confidential
The End

       •Q&A


       •Love numbers and big data? We have a job for
        you at analytics engg at KIXEYE. Talk to our
        recruiting team



©2011 Kixeye, Private and Confidential
To scale data handling

       •       Write speed for large volume data
       •       Read speed + volume [aggregate+find]
       •       MongoDB provides good balance compared to other sql+nosql solutions
               for certain use cases




©2011 Kixeye, Private and Confidential
Games+Platforms
       devices




      mysql         mongo                          BI Mongo Cluster



                                      ETL



              non Real time >= 1 hr                             real time 5
API
                                                                mins

       mySQL             Mongo              Hadoop                    mySQL
                                                                      /mongo



                                                                      Admin console
         Data access tools

       Dashboards          Hive        sql query       API            Scheduler,




                 Analytics Components - Birds' Eye View

More Related Content

What's hot

Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017
Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017
Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017
Amazon Web Services Korea
 

What's hot (20)

DSpace 7 - The Power of Configurable Entities
DSpace 7 - The Power of Configurable EntitiesDSpace 7 - The Power of Configurable Entities
DSpace 7 - The Power of Configurable Entities
 
Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017
Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017
Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017
 
The delta architecture
The delta architectureThe delta architecture
The delta architecture
 
PySpark in practice slides
PySpark in practice slidesPySpark in practice slides
PySpark in practice slides
 
Apache Sqoop Tutorial | Sqoop: Import & Export Data From MySQL To HDFS | Hado...
Apache Sqoop Tutorial | Sqoop: Import & Export Data From MySQL To HDFS | Hado...Apache Sqoop Tutorial | Sqoop: Import & Export Data From MySQL To HDFS | Hado...
Apache Sqoop Tutorial | Sqoop: Import & Export Data From MySQL To HDFS | Hado...
 
Unified MLOps: Feature Stores & Model Deployment
Unified MLOps: Feature Stores & Model DeploymentUnified MLOps: Feature Stores & Model Deployment
Unified MLOps: Feature Stores & Model Deployment
 
MongoDB Best Practices
MongoDB Best PracticesMongoDB Best Practices
MongoDB Best Practices
 
Spark graphx
Spark graphxSpark graphx
Spark graphx
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Hive spark-s3acommitter-hbase-nfs
Hive spark-s3acommitter-hbase-nfsHive spark-s3acommitter-hbase-nfs
Hive spark-s3acommitter-hbase-nfs
 
Facebooks Petabyte Scale Data Warehouse using Hive and Hadoop
Facebooks Petabyte Scale Data Warehouse using Hive and HadoopFacebooks Petabyte Scale Data Warehouse using Hive and Hadoop
Facebooks Petabyte Scale Data Warehouse using Hive and Hadoop
 
SparkSQL: A Compiler from Queries to RDDs
SparkSQL: A Compiler from Queries to RDDsSparkSQL: A Compiler from Queries to RDDs
SparkSQL: A Compiler from Queries to RDDs
 
Apache Spark RDD 101
Apache Spark RDD 101Apache Spark RDD 101
Apache Spark RDD 101
 
PyCon Colombia 2020 Python for Data Analysis: Past, Present, and Future
PyCon Colombia 2020 Python for Data Analysis: Past, Present, and Future PyCon Colombia 2020 Python for Data Analysis: Past, Present, and Future
PyCon Colombia 2020 Python for Data Analysis: Past, Present, and Future
 
Spark overview
Spark overviewSpark overview
Spark overview
 
Apache Spark Introduction and Resilient Distributed Dataset basics and deep dive
Apache Spark Introduction and Resilient Distributed Dataset basics and deep diveApache Spark Introduction and Resilient Distributed Dataset basics and deep dive
Apache Spark Introduction and Resilient Distributed Dataset basics and deep dive
 
Big Data Architectural Patterns and Best Practices
Big Data Architectural Patterns and Best PracticesBig Data Architectural Patterns and Best Practices
Big Data Architectural Patterns and Best Practices
 
CI/DC in MLOps by J.B. Hunt
CI/DC in MLOps by J.B. HuntCI/DC in MLOps by J.B. Hunt
CI/DC in MLOps by J.B. Hunt
 
How to build a data lake with aws glue data catalog (ABD213-R) re:Invent 2017
How to build a data lake with aws glue data catalog (ABD213-R)  re:Invent 2017How to build a data lake with aws glue data catalog (ABD213-R)  re:Invent 2017
How to build a data lake with aws glue data catalog (ABD213-R) re:Invent 2017
 
Amazon Redshift: Performance Tuning and Optimization
Amazon Redshift: Performance Tuning and OptimizationAmazon Redshift: Performance Tuning and Optimization
Amazon Redshift: Performance Tuning and Optimization
 

Viewers also liked

Viewers also liked (11)

Mongo db data-models guide
Mongo db data-models guideMongo db data-models guide
Mongo db data-models guide
 
Morning with MongoDB Paris 2012 - Cas d'usages courant en entreprise. Présent...
Morning with MongoDB Paris 2012 - Cas d'usages courant en entreprise. Présent...Morning with MongoDB Paris 2012 - Cas d'usages courant en entreprise. Présent...
Morning with MongoDB Paris 2012 - Cas d'usages courant en entreprise. Présent...
 
An Elastic Metadata Store for eBay’s Media Platform
An Elastic Metadata Store for eBay’s Media PlatformAn Elastic Metadata Store for eBay’s Media Platform
An Elastic Metadata Store for eBay’s Media Platform
 
Fraud detection, whiplash for cash scheme and Neo4j
Fraud detection, whiplash for cash scheme and Neo4jFraud detection, whiplash for cash scheme and Neo4j
Fraud detection, whiplash for cash scheme and Neo4j
 
MongoDB is the MashupDB
MongoDB is the MashupDBMongoDB is the MashupDB
MongoDB is the MashupDB
 
MongoDB @ Viacom
MongoDB @ ViacomMongoDB @ Viacom
MongoDB @ Viacom
 
Dex: Introduction
Dex: IntroductionDex: Introduction
Dex: Introduction
 
How to apply graph analytics for bank loan fraud detection?
How to apply graph analytics for bank loan fraud detection?How to apply graph analytics for bank loan fraud detection?
How to apply graph analytics for bank loan fraud detection?
 
GraphDay Stockholm - Fraud Prevention
GraphDay Stockholm - Fraud PreventionGraphDay Stockholm - Fraud Prevention
GraphDay Stockholm - Fraud Prevention
 
Big Data : concepts, cas d'usage et tendances
Big Data : concepts, cas d'usage et tendancesBig Data : concepts, cas d'usage et tendances
Big Data : concepts, cas d'usage et tendances
 
Intro to Neo4j and Graph Databases
Intro to Neo4j and Graph DatabasesIntro to Neo4j and Graph Databases
Intro to Neo4j and Graph Databases
 

Similar to Mongo DB in gaming industry

"Performing Multiple Perceptual Tasks With a Single Deep Neural Network," a P...
"Performing Multiple Perceptual Tasks With a Single Deep Neural Network," a P..."Performing Multiple Perceptual Tasks With a Single Deep Neural Network," a P...
"Performing Multiple Perceptual Tasks With a Single Deep Neural Network," a P...
Edge AI and Vision Alliance
 
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
 

Similar to Mongo DB in gaming industry (20)

Uncover the Root Cause of Kafka Performance Anomalies, Daniel Kim & Antón Rod...
Uncover the Root Cause of Kafka Performance Anomalies, Daniel Kim & Antón Rod...Uncover the Root Cause of Kafka Performance Anomalies, Daniel Kim & Antón Rod...
Uncover the Root Cause of Kafka Performance Anomalies, Daniel Kim & Antón Rod...
 
Bletchley
BletchleyBletchley
Bletchley
 
Big Data Warehousing: Pig vs. Hive Comparison
Big Data Warehousing: Pig vs. Hive ComparisonBig Data Warehousing: Pig vs. Hive Comparison
Big Data Warehousing: Pig vs. Hive Comparison
 
Maintenance for MongoDB Replica Sets
Maintenance for MongoDB Replica SetsMaintenance for MongoDB Replica Sets
Maintenance for MongoDB Replica Sets
 
99.9999% (Seriously, that Many 9's) Uptime at Adobe: How We Got There with Neo4j
99.9999% (Seriously, that Many 9's) Uptime at Adobe: How We Got There with Neo4j99.9999% (Seriously, that Many 9's) Uptime at Adobe: How We Got There with Neo4j
99.9999% (Seriously, that Many 9's) Uptime at Adobe: How We Got There with Neo4j
 
2016-JAN-28 -- High Performance Production Databases on Ceph
2016-JAN-28 -- High Performance Production Databases on Ceph2016-JAN-28 -- High Performance Production Databases on Ceph
2016-JAN-28 -- High Performance Production Databases on Ceph
 
"Performing Multiple Perceptual Tasks With a Single Deep Neural Network," a P...
"Performing Multiple Perceptual Tasks With a Single Deep Neural Network," a P..."Performing Multiple Perceptual Tasks With a Single Deep Neural Network," a P...
"Performing Multiple Perceptual Tasks With a Single Deep Neural Network," a P...
 
Idera live 2021: Managing Digital Transformation on a Budget by Bert Scalzo
Idera live 2021:  Managing Digital Transformation on a Budget by Bert ScalzoIdera live 2021:  Managing Digital Transformation on a Budget by Bert Scalzo
Idera live 2021: Managing Digital Transformation on a Budget by Bert Scalzo
 
Securing your Cloud Environment v2
Securing your Cloud Environment v2Securing your Cloud Environment v2
Securing your Cloud Environment v2
 
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?
 
Introduction to Neo4j AuraDB: Your Fastest Path to Graph
Introduction to Neo4j AuraDB: Your Fastest Path to GraphIntroduction to Neo4j AuraDB: Your Fastest Path to Graph
Introduction to Neo4j AuraDB: Your Fastest Path to Graph
 
CIS13: OpenStack API Security
CIS13: OpenStack API SecurityCIS13: OpenStack API Security
CIS13: OpenStack API Security
 
Sydjs – Deploying Node.js and Staying Sane
Sydjs – Deploying Node.js and Staying SaneSydjs – Deploying Node.js and Staying Sane
Sydjs – Deploying Node.js and Staying Sane
 
KCD Munich 2022: Hijack a Kubernetes Cluster - a Walkthrough
KCD Munich 2022: Hijack a Kubernetes Cluster - a WalkthroughKCD Munich 2022: Hijack a Kubernetes Cluster - a Walkthrough
KCD Munich 2022: Hijack a Kubernetes Cluster - a Walkthrough
 
Making sense of your Microsoft Cloud licenses part 2
Making sense of your Microsoft Cloud licenses part 2 Making sense of your Microsoft Cloud licenses part 2
Making sense of your Microsoft Cloud licenses part 2
 
002 Introducing Neo4j 5 for Administrators - NODES2022 AMERICAS Beginner 2 - ...
002 Introducing Neo4j 5 for Administrators - NODES2022 AMERICAS Beginner 2 - ...002 Introducing Neo4j 5 for Administrators - NODES2022 AMERICAS Beginner 2 - ...
002 Introducing Neo4j 5 for Administrators - NODES2022 AMERICAS Beginner 2 - ...
 
Securing jenkins
Securing jenkinsSecuring jenkins
Securing jenkins
 
A Schema Migration Tool for the Neo4j Database(Pavel_Kutac).pptx
A Schema Migration Tool for the Neo4j Database(Pavel_Kutac).pptxA Schema Migration Tool for the Neo4j Database(Pavel_Kutac).pptx
A Schema Migration Tool for the Neo4j Database(Pavel_Kutac).pptx
 
Supercharge Your Real-time Event Processing with Neo4j's Streams Kafka Connec...
Supercharge Your Real-time Event Processing with Neo4j's Streams Kafka Connec...Supercharge Your Real-time Event Processing with Neo4j's Streams Kafka Connec...
Supercharge Your Real-time Event Processing with Neo4j's Streams Kafka Connec...
 
Massively Social != Massively Multiplayer
Massively Social != Massively MultiplayerMassively Social != Massively Multiplayer
Massively Social != Massively Multiplayer
 

More from Dmitry Makarchuk

2012 11-28 rich web data modeling with graphs-1
2012 11-28 rich web data modeling with graphs-12012 11-28 rich web data modeling with graphs-1
2012 11-28 rich web data modeling with graphs-1
Dmitry Makarchuk
 
2012 11-28 rich web data modeling with graphs-1
2012 11-28 rich web data modeling with graphs-12012 11-28 rich web data modeling with graphs-1
2012 11-28 rich web data modeling with graphs-1
Dmitry Makarchuk
 
Hadoop and mysql by Chris Schneider
Hadoop and mysql by Chris SchneiderHadoop and mysql by Chris Schneider
Hadoop and mysql by Chris Schneider
Dmitry Makarchuk
 
A random forest approach to skin detection with r
A random forest approach to skin detection with rA random forest approach to skin detection with r
A random forest approach to skin detection with r
Dmitry Makarchuk
 
"Your script just killed my site" by Steve Souders
"Your script just killed my site" by Steve Souders"Your script just killed my site" by Steve Souders
"Your script just killed my site" by Steve Souders
Dmitry Makarchuk
 
RBrowserPlugin Project (Gabriel Becker)
RBrowserPlugin Project (Gabriel Becker)RBrowserPlugin Project (Gabriel Becker)
RBrowserPlugin Project (Gabriel Becker)
Dmitry Makarchuk
 
Builiding analytical apps on Hadoop
Builiding analytical apps on HadoopBuiliding analytical apps on Hadoop
Builiding analytical apps on Hadoop
Dmitry Makarchuk
 
Jesse Yates: Hbase snapshots patch
Jesse Yates: Hbase snapshots patchJesse Yates: Hbase snapshots patch
Jesse Yates: Hbase snapshots patch
Dmitry Makarchuk
 

More from Dmitry Makarchuk (11)

Linzer slides-barug
Linzer slides-barugLinzer slides-barug
Linzer slides-barug
 
2012 11-28 rich web data modeling with graphs-1
2012 11-28 rich web data modeling with graphs-12012 11-28 rich web data modeling with graphs-1
2012 11-28 rich web data modeling with graphs-1
 
2012 11-28 rich web data modeling with graphs-1
2012 11-28 rich web data modeling with graphs-12012 11-28 rich web data modeling with graphs-1
2012 11-28 rich web data modeling with graphs-1
 
Hadoop and mysql by Chris Schneider
Hadoop and mysql by Chris SchneiderHadoop and mysql by Chris Schneider
Hadoop and mysql by Chris Schneider
 
A random forest approach to skin detection with r
A random forest approach to skin detection with rA random forest approach to skin detection with r
A random forest approach to skin detection with r
 
"Your script just killed my site" by Steve Souders
"Your script just killed my site" by Steve Souders"Your script just killed my site" by Steve Souders
"Your script just killed my site" by Steve Souders
 
RBrowserPlugin Project (Gabriel Becker)
RBrowserPlugin Project (Gabriel Becker)RBrowserPlugin Project (Gabriel Becker)
RBrowserPlugin Project (Gabriel Becker)
 
Bridge to r
Bridge to rBridge to r
Bridge to r
 
Builiding analytical apps on Hadoop
Builiding analytical apps on HadoopBuiliding analytical apps on Hadoop
Builiding analytical apps on Hadoop
 
Jesse Yates: Hbase snapshots patch
Jesse Yates: Hbase snapshots patchJesse Yates: Hbase snapshots patch
Jesse Yates: Hbase snapshots patch
 
Phoenix h basemeetup
Phoenix h basemeetupPhoenix h basemeetup
Phoenix h basemeetup
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 

Mongo DB in gaming industry

  • 1. MongoDB in KIXEYE Analytics Ben Goswami
  • 2. Game Play BP Video clips ( http://www.youtube.com/watch?v=uUHzppVn8WM) ©2011 Kixeye, Private and Confidential
  • 3. Agenda • Data scaling problems at KIXEYE analytics and what technologies we use • Example application: Cheater Detection Engine • How MongoDB helped us to solve it ©2011 Kixeye, Private and Confidential
  • 4. Game Play BP Attack Video (https://www.youtube.com/watch?v=qud_-18D2MU) ©2011 Kixeye, Private and Confidential
  • 5. Game Play and Data • Games generate lots of click data • Click = event o time of the event o what happened before or after o how the events are correlated ©2011 Kixeye, Private and Confidential
  • 6. Attack: { attacker : { user:123 player_level: 31 fleet: { 1:{ Weapons: { name:“Ripper Cannon IV” damage:306 accuracy:55 } armors:{ } … } 2: { } _id" : ObjectId("506e23001d4524122c00004b"), "ip" : "10.54.72.206", "dt" :{ "_id" : ObjectId("506e23001d4524dd2b0000bd"), "ip" : "10.54.72.206", } "&attacker_level=42&defender=0&defender_ext=salvage&defender_level=25&attack_type=PVE&attacking_ } units=%7b%224071%22%3a%5b5%2c3%2c0%5d%7d&defending_units=%7b%221040%22%3a%5b4%2c defender: { 0%2c4%5d%2c%221060%22%3a%5b1%2c0%2c1%5d%7d&attacking_shipconfig=%7b%22ships%22%3a } %5b%7b%22armors%22%3a%5b333%2c333%2c333%2c333%5d%2c%22weapons%22%3a%5b134%2c1 attack_time: 100354563 34%2c193%2c134%2c134%2c134%2c134%2c134%5d%2c%22specials%22%3a%5b542%2c561%2c571 attack_duration:290 %2c501%5d%2c%22hullID%22%3a4071%2c%22tacticalModules%22%3a%5b%5d%2c%22actives%22%3 sector:7 a%7b%22hp%22%3a9317.68457%2c%22rank%22%3a4%2c%22fltp%22%3a5%2c%22bid%22%3a54834 … 79%2c%22f%22%3a0%2c%22id%22%3a110%2c%22flt%22%3a5%2c%22vxp%22%3a10.858466%7d%7 d%2c%7b%22armors%22%3a%5b333%2c333%2c333%2c333.. "stage" : "new" } }
  • 7. How much data? •Multi TBs / month (4-5x in next 6 months) •Critical : Volume reads with speed •< 1% data has actionable intelligence ©2011 Kixeye, Private and Confidential
  • 8.
  • 9. MongoDB in KIXEYE •Why: – fast read + writes for high volume – Document based architecture, schema less – Indexing , auto failover, auto sharding •Where: – Games , KIXEYE Platform – Analytics, Logging ©2011 Kixeye, Private and Confidential
  • 10. Data technologies at Analytics Technology Data Volume Query Type I/O speed MySQL Small Adhoc + Read fast, only < 300 GB Pre defined Aggregated data Mongo Mid Predefined Read + Write speed < 2 TB fast Hadoop X-Large Adhoc Read slow (Hive+HDFS) 2 TB+ writes: only insert no update ©2011 Kixeye, Private and Confidential
  • 11. An Example Application Cheater Detection engine for games: How mongoDB helped us ©2011 Kixeye, Private and Confidential
  • 12. A simple backyard at start in BYM
  • 13. Currency is time or $ or both ©2011 Kixeye, Private and Confidential
  • 14.
  • 15.
  • 16. Sample record • 4kb nested jason block • base = { base_name: “sweet_mango_db” resources { 1: { name: "storage silo" level: 5, mode:“built" time:123456902 2: { … ..} ...} ...} ..} ©2011 Kixeye, Private and Confidential
  • 17. How people cheat? • Each upgrade or repair takes pre defined time • if time+payment < predefined time = cheater • victims chain create snowball effect ©2011 Kixeye, Private and Confidential
  • 18. ..and why they cheat... ©2011 Kixeye, Private and Confidential
  • 19. Data volume for cheater detection • 16Mil * 50 * 10 * 3 *.... • multiple time based snapshots • 0.01 % cheaters • Detect < 5 mins • That's searching through lot of data fast ©2011 Kixeye, Private and Confidential
  • 20. .. and boss told • Catch and auto ban cheaters • Don't label a good guy a cheater ©2011 Kixeye, Private and Confidential
  • 21. ..team was ready for the challenge • Speed+Accuracy of application • Technology evalauation ©2011 Kixeye, Private and Confidential
  • 22. MongoDB fits the requirement • read writes are fast because memory mapped files compared to mysql+memcache or hbase • Unstructured data => need schema less • indexing on a nested data element ©2011 Kixeye, Private and Confidential
  • 23. .. more on why mongo • Auto purging thru TTL • Auto sharding during traffic spikes • Binary data support, fast uncompression • Capped collection: writes faster ©2011 Kixeye, Private and Confidential
  • 24. Development decision points • Old map-reduce (prior to 2.2) vs New Aggregation framework • Global write locks removal in 2.2 • Lazy and Non lazy inserts ©2011 Kixeye, Private and Confidential
  • 25. Result • 100+ cheaters caught per hour • Better game balancing • $$ saved ©2011 Kixeye, Private and Confidential
  • 26. Wrap up : A good partnership •Good partnership with KIXEYE and 10gen •Consulting/Training and MMS service was very helpful •More mongoDB usages in future at KIXEYE ©2011 Kixeye, Private and Confidential
  • 27. {Status: “The End”} •{ next_action: “Q&A” } • Like this jason? meet us outside – KIXEYE recruiting { Company : “KIXEYE”, “Engineers/Total _employee” : “65%”, Culture : [“Fun”, “Innovative”, “Passionate”] Analytics_engg : { technology : “mongo, hadoop , mysql”, tag : “big data, geek” } } ©2011 Kixeye, Private and Confidential
  • 29. Game Play BP Attack Video (https://www.youtube.com/watch?v=qud_-18D2MU) ©2011 Kixeye, Private and Confidential
  • 30. Usage of data • Data mining and aggregation to o Optimize User Acquisition o Optimize game analyzing game play behavior and Algo + Data Optimize r Feedback
  • 31. Mongo - pain points • Diskspace handling • No sql syntax support • Capped collection - no deletes allowed • No good client GUI based tool ©2011 Kixeye, Private and Confidential
  • 33. Data related to player • building has 5-10 levels • building can have 3 states [built, damaged, repair in progress) • an average base can have 50+ buildings • 16 million such bases • 45k people at any second [i.e base gets updated] • Each level up or repair has time delay. People pay to reduce delay ©2011 Kixeye, Private and Confidential
  • 34. Map-reduce in cheater detection function mapf() { emit(this.userid, {userid:this.userid, total_time:this.length, bldg_id:1} ; } function reducef(key, values) { var r = {userid:key, total_time:0, count:0, avg_time:0}; values.forEach(function(v) {r.total_time += v.total_time; }); return r; } function finalizef(key, value) { ... } ©2011 Kixeye, Private and Confidential
  • 35. The End •Q&A •Love numbers and big data? We have a job for you at analytics engg at KIXEYE. Talk to our recruiting team ©2011 Kixeye, Private and Confidential
  • 36. To scale data handling • Write speed for large volume data • Read speed + volume [aggregate+find] • MongoDB provides good balance compared to other sql+nosql solutions for certain use cases ©2011 Kixeye, Private and Confidential
  • 37. Games+Platforms devices mysql mongo BI Mongo Cluster ETL non Real time >= 1 hr real time 5 API mins mySQL Mongo Hadoop mySQL /mongo Admin console Data access tools Dashboards Hive sql query API Scheduler, Analytics Components - Birds' Eye View

Editor's Notes

  1. Wow that is fun