SlideShare a Scribd company logo
Webinar : Managing Real Time Risk Analytics with MongoDB
will begin at 14:00 GMT / 7:00 AM PDT / 2:00 PM UTC

Audio should start immediately when you log into the event via
Audio Broadcast. You will need a VOID headset and reliable
internet connection for Audio Broadcast. If you are having issues
connecting, please dial 1-877-668-4493; Access code: 666 722
454.

There is a Q&A following the webinar. You can enter questions in
the chat box to the Host and Presenter.

A recording of the webinar will be available 24 hours after the
eventi s complete.

For any other issues please email webinars@10gen.com.
Easy to Start, Easy to Develop, Easy to Scale


  Managing Real Time Risk Analytics with
              MongoDB

                  10gen, Inc.

                November 2012
@dmroberts

daniel.roberts@10gen.com
       Solution Architect
        Based in London
     http://www.10gen.com/
Last Time

•Document-Oriented
                             •High Volume Data Feeds
    •Dynamic schema          •Tick Data capture
    •Agile                   •Risk Analytics
    •Flexible                •Product Catalogs & Trade
•High Performance            Capture
•Highly Available            •P&L Reporting
•Horizontal Scale Out        •Portfolio Management
                             •Reference Data Management
                             •Quantitative Analysis
                             •Automated Trading
Key Features for reporting /
             analytics


•Dynamic Query Language
•Aggregation Framework
•Dynamic & Flexible Schemas
•Atomic Updates to documents
   •Upserts
•Horizonal Scale Out
•Map Reduce
•Hadoop Integration
Sharded Architecture
Risk Analytics & Reporting
Use Case:
•Collect and aggregate risk data
•Calculate risk / exposures
•Potentially real time
Why MongoDB?
•Collect data from a single or multiple sources
   •Different formats
•Documents used to create ‘pre-aggregated’ reports
   •Real Time
•Aggregation Framework for reporting
   •e.g. exposure for a counter party
•Internal MR or Hadoop connector
   •Batch process risk data
Portfolio / Position reporting
Use Case:
•Store positions or portfolio information
•Query to find current positions/portfolios
•Query by client or trader
Why MongoDB?
•Customer/client my have many different products
•Aggregation Framework to calculate values and views
•Work on extremely large data sets
   •Current and historic data
Reporting / Analytics requirements


•How quickly do you need answers?
•How often do you need updates?
•Requirements will drive which methods to utilise.
   •Generally the high the latency tolerance the greater the insight.

•Choices
   •Batch calculations - large complex data volumes
   •Pre-Aggregated - specific and very fast
   •Real-time calculations - As needed reports and calculations
Batch Processing

•MongoDB internal Map Reduce
•Hadoop Map Reduce with MongoDB connector
                                                  raw

•Insight after batch run
                                                 hourly
   •For instance every hour or day
   •Output to documents/collection                daily
   •Fast read once data produced
                                                 monthly

•Results not up to last millisecond
•Can generate insight from huge datasets
•Rolled up stats
   •Source collections -> reporting collection
Sharded MongoDB + Hadoop
Shard 1           Shard 2           Shard 3           Shard 4           Shard 5

       c                  z         t       f         v                 w        y


a      s         u        g         e                 h       d         b        x




    Hadoop            Hadoop            Hadoop            Hadoop            Hadoop
     Node              Node              Node              Node              Node



                                                 Hadoop            Hadoop
             Hadoop            Hadoop
                                                  Node              Node
              Node              Node
Use Query Language

•Query across documents using MongoDB JSON query language
   •Infer results in the application code.
   •Dynamic - but what happens when we have 1 billion documents.
•Indexing strategy key
•var data = db.pl.find({ positionId: 1234 })[0]
            {
                 "_id" : ObjectId("50990a10fd421cb025407cb1"),
                 "positionId" : 1234,
                 "security" : "ORCL",
                 "quantity" : 1000,
                 "price" : 30.23,
                 "currency" : "USD"
            }
   data.price * data.quantity = 30230.00
Leverage schema design


•Group useful data together into documents
•Utilise upsert and $inc functionality of MongoDB
   •Pre-aggregate reports
   •$inc incrementing counters is light weight.

•Fast pre calculated data
•Low latency retrieval
•http://docs.mongodb.org/manual/use-cases/pre-aggregated-reports/
Pre-Aggregated Reports -
Daily trade volumes


// daily buckets, each hour a sub-document
{ _id: "2012-11-06-1231", security:‘ORCL’
  ts: ISODate("2012-11-06T00:00:00.000Z")
  daily: 67345234,
  minute: { 0: { 0: 2034, 1: 735, ... 59: 2644 },
             ...
            7: { 0: 15434, 1: 334, ... 59: 64234 }
           }
}
// Increment counters in document. Automatically
insert new document (upsert : true)
> db.trades.update(
   { _id: "2012-11-06-1231", security:‘ORCL’ },
   { $inc: { "minute.4.09": 1034, “daily” : 1034 } },
  true)
Aggregation Framework
•Much simpler and faster than MongoDB map reduce
•Replaces common MR use cases in MongoDB
•Native operators in the MongoDB core

db.pl.aggregate([
!   {$match:{"clientId" : 4321}},
    { $project :
       { value :
          { $multiply:["$quantity", "$price"] }
       }
    }
]);
Aggregation FIX Execution report

Calculating average price for a fulfilled order:

db.ExecutionReport.aggregate(
{
    $match : {"Instrument.Symbol":"MSFT"},
    $group :
    {
        _id : "$ClOrdID",
             reportsPerOrd : { $sum : 1 },
            totalNumOrdered : { $sum : "$OrderQtyData.OrderQty"},
            avgPrice : { $avg : "$AvgPx" }
      }
});
Summary

•Number of choices for Aggregating data.
   •MongoDB Map Reduce
   •Pre-Compute - Schema Design
   •Hadoop Connector
   •Aggregation Framework
download at mongodb.org

                    @dmroberts
             daniel.roberts@10gen.com

Free online training - http://education.10gen.com/

www.meetup.com/London-MongoDB-User-Group/



     Facebook           Twitter       LinkedIn
http://bit.ly/mongodb   @dmroberts   http://linkd.in/joinmongo

More Related Content

PPTX
July 2014 HUG : Pushing the limits of Realtime Analytics using Druid
PDF
Gregorry Letribot - Druid at Criteo - NoSQL matters 2015
PDF
Data Analytics and Processing at Snap - Druid Meetup LA - September 2018
PPTX
Python and MongoDB as a Market Data Platform by James Blackburn
PDF
Data Analytics with Druid
PPTX
Druid realtime indexing
PPT
MongoDB Tick Data Presentation
PPTX
MongoDB + Spring
July 2014 HUG : Pushing the limits of Realtime Analytics using Druid
Gregorry Letribot - Druid at Criteo - NoSQL matters 2015
Data Analytics and Processing at Snap - Druid Meetup LA - September 2018
Python and MongoDB as a Market Data Platform by James Blackburn
Data Analytics with Druid
Druid realtime indexing
MongoDB Tick Data Presentation
MongoDB + Spring

What's hot (20)

PPTX
Webinar: Choosing the Right Shard Key for High Performance and Scale
PDF
Real-time Analytics with Apache Flink and Druid
PPTX
How to leverage MongoDB for Big Data Analysis and Operations with MongoDB's A...
PPT
Migrating to MongoDB: Best Practices
PPTX
When to Use MongoDB
PPTX
Agility and Scalability with MongoDB
PPTX
The of Operational Analytics Data Store
PPTX
Webinar: When to Use MongoDB
PDF
What does Netflix, NTT and Rubicon Project have in common? Apache Druid.
PPTX
MongoDB and Spark
PPTX
MongoDB and Hadoop: Driving Business Insights
PPTX
Using MongoDB As a Tick Database
PPTX
MongoDB for Time Series Data Part 1: Setting the Stage for Sensor Management
PDF
Using MongoDB + Hadoop Together
PPTX
Back to Basics 2017: Introduction to Sharding
PPTX
HBaseCon 2015: HBase @ CyberAgent
PPTX
Webinar: “ditch Oracle NOW”: Best Practices for Migrating to MongoDB
PDF
Dan Sullivan - Data Analytics and Text Mining with MongoDB - NoSQL matters Du...
PDF
RedisConf18 - Redis and Elasticsearch
PPTX
Eagle6 Enterprise Situational Awareness
Webinar: Choosing the Right Shard Key for High Performance and Scale
Real-time Analytics with Apache Flink and Druid
How to leverage MongoDB for Big Data Analysis and Operations with MongoDB's A...
Migrating to MongoDB: Best Practices
When to Use MongoDB
Agility and Scalability with MongoDB
The of Operational Analytics Data Store
Webinar: When to Use MongoDB
What does Netflix, NTT and Rubicon Project have in common? Apache Druid.
MongoDB and Spark
MongoDB and Hadoop: Driving Business Insights
Using MongoDB As a Tick Database
MongoDB for Time Series Data Part 1: Setting the Stage for Sensor Management
Using MongoDB + Hadoop Together
Back to Basics 2017: Introduction to Sharding
HBaseCon 2015: HBase @ CyberAgent
Webinar: “ditch Oracle NOW”: Best Practices for Migrating to MongoDB
Dan Sullivan - Data Analytics and Text Mining with MongoDB - NoSQL matters Du...
RedisConf18 - Redis and Elasticsearch
Eagle6 Enterprise Situational Awareness
Ad

Similar to Webinar: Managing Real Time Risk Analytics with MongoDB (20)

PDF
MongoDB in FS
PPTX
Mongo db and hadoop driving business insights - final
PPTX
Augmenting Mongo DB with treasure data
PPTX
Augmenting Mongo DB with Treasure Data
PDF
Accra MongoDB User Group
PPTX
Webinar: How Banks Use MongoDB as a Tick Database
PDF
Buildingsocialanalyticstoolwithmongodb
PPTX
Dataweek-Talk-2014
PPSX
Hadoop-Quick introduction
PDF
Tugdual Grall - Real World Use Cases: Hadoop and NoSQL in Production
PPTX
MongoDB and Hadoop
PPTX
MongoDB et Hadoop
PPTX
MongoDB and Hadoop: Driving Business Insights
PPTX
Big Data on azure
PPTX
Nosql Now 2012: MongoDB Use Cases
PDF
MongoDB .local Houston 2019: Building an IoT Streaming Analytics Platform to ...
PPTX
Dev Jumpstart: Build Your First App with MongoDB
PDF
MongoDB and Hadoop: Driving Business Insights
PPTX
Azure doc db (slideshare)
PPTX
Introduction to BIg Data and Hadoop
MongoDB in FS
Mongo db and hadoop driving business insights - final
Augmenting Mongo DB with treasure data
Augmenting Mongo DB with Treasure Data
Accra MongoDB User Group
Webinar: How Banks Use MongoDB as a Tick Database
Buildingsocialanalyticstoolwithmongodb
Dataweek-Talk-2014
Hadoop-Quick introduction
Tugdual Grall - Real World Use Cases: Hadoop and NoSQL in Production
MongoDB and Hadoop
MongoDB et Hadoop
MongoDB and Hadoop: Driving Business Insights
Big Data on azure
Nosql Now 2012: MongoDB Use Cases
MongoDB .local Houston 2019: Building an IoT Streaming Analytics Platform to ...
Dev Jumpstart: Build Your First App with MongoDB
MongoDB and Hadoop: Driving Business Insights
Azure doc db (slideshare)
Introduction to BIg Data and Hadoop
Ad

More from MongoDB (20)

PDF
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
PDF
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
PDF
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
PDF
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
PDF
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
PDF
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
PDF
MongoDB SoCal 2020: MongoDB Atlas Jump Start
PDF
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
PDF
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
PDF
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
PDF
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
PDF
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
PDF
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
PDF
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
PDF
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
PDF
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
PDF
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
PDF
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...

Recently uploaded (20)

PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPT
Teaching material agriculture food technology
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Electronic commerce courselecture one. Pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Approach and Philosophy of On baking technology
Diabetes mellitus diagnosis method based random forest with bat algorithm
Teaching material agriculture food technology
The Rise and Fall of 3GPP – Time for a Sabbatical?
Dropbox Q2 2025 Financial Results & Investor Presentation
Chapter 3 Spatial Domain Image Processing.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Programs and apps: productivity, graphics, security and other tools
Network Security Unit 5.pdf for BCA BBA.
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Spectral efficient network and resource selection model in 5G networks
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
20250228 LYD VKU AI Blended-Learning.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Electronic commerce courselecture one. Pdf
MIND Revenue Release Quarter 2 2025 Press Release
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Reach Out and Touch Someone: Haptics and Empathic Computing
Approach and Philosophy of On baking technology

Webinar: Managing Real Time Risk Analytics with MongoDB

  • 1. Webinar : Managing Real Time Risk Analytics with MongoDB will begin at 14:00 GMT / 7:00 AM PDT / 2:00 PM UTC Audio should start immediately when you log into the event via Audio Broadcast. You will need a VOID headset and reliable internet connection for Audio Broadcast. If you are having issues connecting, please dial 1-877-668-4493; Access code: 666 722 454. There is a Q&A following the webinar. You can enter questions in the chat box to the Host and Presenter. A recording of the webinar will be available 24 hours after the eventi s complete. For any other issues please email webinars@10gen.com.
  • 2. Easy to Start, Easy to Develop, Easy to Scale Managing Real Time Risk Analytics with MongoDB 10gen, Inc. November 2012
  • 3. @dmroberts daniel.roberts@10gen.com Solution Architect Based in London http://www.10gen.com/
  • 4. Last Time •Document-Oriented •High Volume Data Feeds •Dynamic schema •Tick Data capture •Agile •Risk Analytics •Flexible •Product Catalogs & Trade •High Performance Capture •Highly Available •P&L Reporting •Horizontal Scale Out •Portfolio Management •Reference Data Management •Quantitative Analysis •Automated Trading
  • 5. Key Features for reporting / analytics •Dynamic Query Language •Aggregation Framework •Dynamic & Flexible Schemas •Atomic Updates to documents •Upserts •Horizonal Scale Out •Map Reduce •Hadoop Integration
  • 7. Risk Analytics & Reporting Use Case: •Collect and aggregate risk data •Calculate risk / exposures •Potentially real time Why MongoDB? •Collect data from a single or multiple sources •Different formats •Documents used to create ‘pre-aggregated’ reports •Real Time •Aggregation Framework for reporting •e.g. exposure for a counter party •Internal MR or Hadoop connector •Batch process risk data
  • 8. Portfolio / Position reporting Use Case: •Store positions or portfolio information •Query to find current positions/portfolios •Query by client or trader Why MongoDB? •Customer/client my have many different products •Aggregation Framework to calculate values and views •Work on extremely large data sets •Current and historic data
  • 9. Reporting / Analytics requirements •How quickly do you need answers? •How often do you need updates? •Requirements will drive which methods to utilise. •Generally the high the latency tolerance the greater the insight. •Choices •Batch calculations - large complex data volumes •Pre-Aggregated - specific and very fast •Real-time calculations - As needed reports and calculations
  • 10. Batch Processing •MongoDB internal Map Reduce •Hadoop Map Reduce with MongoDB connector raw •Insight after batch run hourly •For instance every hour or day •Output to documents/collection daily •Fast read once data produced monthly •Results not up to last millisecond •Can generate insight from huge datasets •Rolled up stats •Source collections -> reporting collection
  • 11. Sharded MongoDB + Hadoop Shard 1 Shard 2 Shard 3 Shard 4 Shard 5 c z t f v w y a s u g e h d b x Hadoop Hadoop Hadoop Hadoop Hadoop Node Node Node Node Node Hadoop Hadoop Hadoop Hadoop Node Node Node Node
  • 12. Use Query Language •Query across documents using MongoDB JSON query language •Infer results in the application code. •Dynamic - but what happens when we have 1 billion documents. •Indexing strategy key •var data = db.pl.find({ positionId: 1234 })[0] { "_id" : ObjectId("50990a10fd421cb025407cb1"), "positionId" : 1234, "security" : "ORCL", "quantity" : 1000, "price" : 30.23, "currency" : "USD" } data.price * data.quantity = 30230.00
  • 13. Leverage schema design •Group useful data together into documents •Utilise upsert and $inc functionality of MongoDB •Pre-aggregate reports •$inc incrementing counters is light weight. •Fast pre calculated data •Low latency retrieval •http://docs.mongodb.org/manual/use-cases/pre-aggregated-reports/
  • 14. Pre-Aggregated Reports - Daily trade volumes // daily buckets, each hour a sub-document { _id: "2012-11-06-1231", security:‘ORCL’ ts: ISODate("2012-11-06T00:00:00.000Z") daily: 67345234, minute: { 0: { 0: 2034, 1: 735, ... 59: 2644 }, ... 7: { 0: 15434, 1: 334, ... 59: 64234 } } } // Increment counters in document. Automatically insert new document (upsert : true) > db.trades.update( { _id: "2012-11-06-1231", security:‘ORCL’ }, { $inc: { "minute.4.09": 1034, “daily” : 1034 } }, true)
  • 15. Aggregation Framework •Much simpler and faster than MongoDB map reduce •Replaces common MR use cases in MongoDB •Native operators in the MongoDB core db.pl.aggregate([ ! {$match:{"clientId" : 4321}}, { $project : { value : { $multiply:["$quantity", "$price"] } } } ]);
  • 16. Aggregation FIX Execution report Calculating average price for a fulfilled order: db.ExecutionReport.aggregate( { $match : {"Instrument.Symbol":"MSFT"}, $group : { _id : "$ClOrdID", reportsPerOrd : { $sum : 1 }, totalNumOrdered : { $sum : "$OrderQtyData.OrderQty"}, avgPrice : { $avg : "$AvgPx" } } });
  • 17. Summary •Number of choices for Aggregating data. •MongoDB Map Reduce •Pre-Compute - Schema Design •Hadoop Connector •Aggregation Framework
  • 18. download at mongodb.org @dmroberts daniel.roberts@10gen.com Free online training - http://education.10gen.com/ www.meetup.com/London-MongoDB-User-Group/ Facebook Twitter LinkedIn http://bit.ly/mongodb @dmroberts http://linkd.in/joinmongo