SlideShare ist ein Scribd-Unternehmen logo
1 von 29
MongoSF
April 30, 2010




      1
Hot Potato Overview

• What: Hot Potato connects audiences around shared interests

• When: Founded early 2009 / PoC: Dec 2009 / Beta: 2 months ago

• Where: Williamsburg, Brooklyn!

• Who: Lincoln, Justin, Saadiq, Jeremy, Jace, Matt, Mike, Will




                                            2
hotpotato.com




                3
Hot Potato on the iPhone




                     4
Technology Stack

Design principles: Simple and stateless


API
 • Scala / MongoDB

API Clients
 • Web application (Python/Django)
 • iPhone (Obj-C)



                               5
Hot Potato API - Why MongoDB?

• Good documentation and excellent support
• Fully Featured (like an RDBMS) but with a migration path to scale-
out
• Replication
• Easy administration / scripting
• Fast

• Auto-sharding coming soon




                                    6
Hot Potato API - Why MongoDB?




                   7
Hot Potato API - Why MongoDB?

RDBMS Optimization process




                             7
Hot Potato API - Why MongoDB?

RDBMS Optimization process
1. too many reads -> add cache




                                 7
Hot Potato API - Why MongoDB?

RDBMS Optimization process
1. too many reads -> add cache
2. too many joins -> de-normalize your data




                                  7
Hot Potato API - Why MongoDB?

RDBMS Optimization process
1. too many reads -> add cache
2. too many joins -> de-normalize your data
3. too many writes -> scale up hardware, CPU, RAM, IO




                                  7
Hot Potato API - Why MongoDB?

RDBMS Optimization process
1. too many reads -> add cache
2. too many joins -> de-normalize your data
3. too many writes -> scale up hardware, CPU, RAM, IO
4. too much db load -> eliminate triggers, stored procedures




                                  7
Hot Potato API - Why MongoDB?

RDBMS Optimization process
1. too many reads -> add cache
2. too many joins -> de-normalize your data
3. too many writes -> scale up hardware, CPU, RAM, IO
4. too much db load -> eliminate triggers, stored procedures
5. too much db load -> pre-materialize complex queries




                                  7
Hot Potato API - Why MongoDB?

RDBMS Optimization process
1. too many reads -> add cache
2. too many joins -> de-normalize your data
3. too many writes -> scale up hardware, CPU, RAM, IO
4. too much db load -> eliminate triggers, stored procedures
5. too much db load -> pre-materialize complex queries
6. writes bottleneck -> drop secondary indexes




                                  7
Hot Potato API - Why MongoDB?

RDBMS Optimization process
1. too many reads -> add cache
2. too many joins -> de-normalize your data
3. too many writes -> scale up hardware, CPU, RAM, IO
4. too much db load -> eliminate triggers, stored procedures
5. too much db load -> pre-materialize complex queries
6. writes bottleneck -> drop secondary indexes


At this point you are using the RDBMS as a KV store. The full-
featured nature of the RDBMS is merely getting in the way of scaling.


                                  7
Hot Potato API - Why MongoDB?




                   8
Hot Potato API - Why MongoDB?
Mongo comparison




                    8
Hot Potato API - Why MongoDB?
Mongo comparison
1. reads start out fast, can be externally cached, can also be
horizontally scaled




                                    8
Hot Potato API - Why MongoDB?
Mongo comparison
1. reads start out fast, can be externally cached, can also be
horizontally scaled
2. mongo doesn’t support joins - data starts de-normalized




                                    8
Hot Potato API - Why MongoDB?
Mongo comparison
1. reads start out fast, can be externally cached, can also be
horizontally scaled
2. mongo doesn’t support joins - data starts de-normalized
3. writes start out fast, can be horizontally scaled




                                     8
Hot Potato API - Why MongoDB?
Mongo comparison
1. reads start out fast, can be externally cached, can also be
horizontally scaled
2. mongo doesn’t support joins - data starts de-normalized
3. writes start out fast, can be horizontally scaled
4. much less opportunity for logic in the db




                                     8
Hot Potato API - Why MongoDB?
Mongo comparison
1. reads start out fast, can be externally cached, can also be
horizontally scaled
2. mongo doesn’t support joins - data starts de-normalized
3. writes start out fast, can be horizontally scaled
4. much less opportunity for logic in the db
5. map/reduce for pre-materialization/aggregation, which can be
horizontally scaled




                                     8
Hot Potato API - Why MongoDB?
Mongo comparison
1. reads start out fast, can be externally cached, can also be
horizontally scaled
2. mongo doesn’t support joins - data starts de-normalized
3. writes start out fast, can be horizontally scaled
4. much less opportunity for logic in the db
5. map/reduce for pre-materialization/aggregation, which can be
horizontally scaled
6. indexes can be removed over time as usage becomes more KV-like




                                     8
Hot Potato API - Why MongoDB?
Mongo comparison
1. reads start out fast, can be externally cached, can also be
horizontally scaled
2. mongo doesn’t support joins - data starts de-normalized
3. writes start out fast, can be horizontally scaled
4. much less opportunity for logic in the db
5. map/reduce for pre-materialization/aggregation, which can be
horizontally scaled
6. indexes can be removed over time as usage becomes more KV-like


The gradual scaling process is more natural with Mongo. Horizontal
scaling is not an after-thought or bolt on addition. Mongo works
perfectly well as a KV store if you ever get to that point.
                                     8
Hot Potato API - Why Scala?

• Runs on JVM (Stable, Fast)
• Access to Java’s many libraries
• Language benefits
 • Terse
 • Supports Immutability
 • Functional
 • Concurrent
 • Easy to write DSLs


                             9
Three key Scala features



• Pattern Matching / Case classes

• Implicit conversions

• Actors


                         10
Building a DSL for Mongo
Documents are a flexible building block:
• Insertion
• Updates
• Queries
• Sorting
• parts of Map / Reduce
• Indexes




                            11
Building a DSL for Mongo
Goals
 • Stay close to the MongoDB Java API
 • Keep it flexible
 • Focus on document creation
  • New documents, queries, updates
  • Protect against mis-named fields

Key classes and objects
  • Collection - wraps MongoDB DBCollection
  • MongoAST - defines the types for building Mongo documents
  • MongoDSL - defines DSL syntax

                                12
Usage Patterns

Asynchronous atomic updates

• Simple observer pattern implemented with Lift Actors
 • HpActor, HpActorPool, Notifier

• Main action object with a Notifier
 • Example: checkins

• Listeners that use MongoDB atomic updates
 • Example: EventAdjuster
                            13

Weitere ähnliche Inhalte

Was ist angesagt?

Branch Management in Git Fusion
Branch Management in Git FusionBranch Management in Git Fusion
Branch Management in Git FusionPerforce
 
Scale Apache with Nginx
Scale Apache with NginxScale Apache with Nginx
Scale Apache with NginxBud Siddhisena
 
Understanding Presto - Presto meetup @ Tokyo #1
Understanding Presto - Presto meetup @ Tokyo #1Understanding Presto - Presto meetup @ Tokyo #1
Understanding Presto - Presto meetup @ Tokyo #1Sadayuki Furuhashi
 
MongoDB Pros and Cons
MongoDB Pros and ConsMongoDB Pros and Cons
MongoDB Pros and Consjohnrjenson
 
Lessons Learned Migrating 2+ Billion Documents at Craigslist
Lessons Learned Migrating 2+ Billion Documents at CraigslistLessons Learned Migrating 2+ Billion Documents at Craigslist
Lessons Learned Migrating 2+ Billion Documents at CraigslistJeremy Zawodny
 
MongoDB memory management demystified
MongoDB memory management demystifiedMongoDB memory management demystified
MongoDB memory management demystifiedAlon Horev
 
Perforce BTrees: The Arcane and the Profane
Perforce BTrees: The Arcane and the ProfanePerforce BTrees: The Arcane and the Profane
Perforce BTrees: The Arcane and the ProfanePerforce
 
Choosing a Web Architecture for Perl
Choosing a Web Architecture for PerlChoosing a Web Architecture for Perl
Choosing a Web Architecture for PerlPerrin Harkins
 
Hardware Provisioning
Hardware ProvisioningHardware Provisioning
Hardware ProvisioningMongoDB
 
Tarantool: как сэкономить миллион долларов на базе данных на высоконагруженно...
Tarantool: как сэкономить миллион долларов на базе данных на высоконагруженно...Tarantool: как сэкономить миллион долларов на базе данных на высоконагруженно...
Tarantool: как сэкономить миллион долларов на базе данных на высоконагруженно...Ontico
 
Rails on HBase
Rails on HBaseRails on HBase
Rails on HBasezpinter
 
Presto in my_use_case
Presto in my_use_casePresto in my_use_case
Presto in my_use_casewyukawa
 
Search in WordPress - how it works and howto customize it
Search in WordPress - how it works and howto customize itSearch in WordPress - how it works and howto customize it
Search in WordPress - how it works and howto customize itOtto Kekäläinen
 
Scalable Text File Service with MongoDB (Intuit)
Scalable Text File Service with MongoDB (Intuit)Scalable Text File Service with MongoDB (Intuit)
Scalable Text File Service with MongoDB (Intuit)MongoDB
 
PostgreSQL - масштабирование в моде, Valentine Gogichashvili (Zalando SE)
PostgreSQL - масштабирование в моде, Valentine Gogichashvili (Zalando SE)PostgreSQL - масштабирование в моде, Valentine Gogichashvili (Zalando SE)
PostgreSQL - масштабирование в моде, Valentine Gogichashvili (Zalando SE)Ontico
 
Development to Production with Sharded MongoDB Clusters
Development to Production with Sharded MongoDB ClustersDevelopment to Production with Sharded MongoDB Clusters
Development to Production with Sharded MongoDB ClustersSeveralnines
 
Day 2 General Session Presentations RedisConf
Day 2 General Session Presentations RedisConfDay 2 General Session Presentations RedisConf
Day 2 General Session Presentations RedisConfRedis Labs
 

Was ist angesagt? (20)

Branch Management in Git Fusion
Branch Management in Git FusionBranch Management in Git Fusion
Branch Management in Git Fusion
 
Scale Apache with Nginx
Scale Apache with NginxScale Apache with Nginx
Scale Apache with Nginx
 
Understanding Presto - Presto meetup @ Tokyo #1
Understanding Presto - Presto meetup @ Tokyo #1Understanding Presto - Presto meetup @ Tokyo #1
Understanding Presto - Presto meetup @ Tokyo #1
 
MongoDB Pros and Cons
MongoDB Pros and ConsMongoDB Pros and Cons
MongoDB Pros and Cons
 
Lessons Learned Migrating 2+ Billion Documents at Craigslist
Lessons Learned Migrating 2+ Billion Documents at CraigslistLessons Learned Migrating 2+ Billion Documents at Craigslist
Lessons Learned Migrating 2+ Billion Documents at Craigslist
 
Ui perf
Ui perfUi perf
Ui perf
 
MongoDB memory management demystified
MongoDB memory management demystifiedMongoDB memory management demystified
MongoDB memory management demystified
 
Perforce BTrees: The Arcane and the Profane
Perforce BTrees: The Arcane and the ProfanePerforce BTrees: The Arcane and the Profane
Perforce BTrees: The Arcane and the Profane
 
Choosing a Web Architecture for Perl
Choosing a Web Architecture for PerlChoosing a Web Architecture for Perl
Choosing a Web Architecture for Perl
 
Hardware Provisioning
Hardware ProvisioningHardware Provisioning
Hardware Provisioning
 
Presto+MySQLで分散SQL
Presto+MySQLで分散SQLPresto+MySQLで分散SQL
Presto+MySQLで分散SQL
 
Tarantool: как сэкономить миллион долларов на базе данных на высоконагруженно...
Tarantool: как сэкономить миллион долларов на базе данных на высоконагруженно...Tarantool: как сэкономить миллион долларов на базе данных на высоконагруженно...
Tarantool: как сэкономить миллион долларов на базе данных на высоконагруженно...
 
Rails on HBase
Rails on HBaseRails on HBase
Rails on HBase
 
Presto in my_use_case
Presto in my_use_casePresto in my_use_case
Presto in my_use_case
 
Rails on HBase
Rails on HBaseRails on HBase
Rails on HBase
 
Search in WordPress - how it works and howto customize it
Search in WordPress - how it works and howto customize itSearch in WordPress - how it works and howto customize it
Search in WordPress - how it works and howto customize it
 
Scalable Text File Service with MongoDB (Intuit)
Scalable Text File Service with MongoDB (Intuit)Scalable Text File Service with MongoDB (Intuit)
Scalable Text File Service with MongoDB (Intuit)
 
PostgreSQL - масштабирование в моде, Valentine Gogichashvili (Zalando SE)
PostgreSQL - масштабирование в моде, Valentine Gogichashvili (Zalando SE)PostgreSQL - масштабирование в моде, Valentine Gogichashvili (Zalando SE)
PostgreSQL - масштабирование в моде, Valentine Gogichashvili (Zalando SE)
 
Development to Production with Sharded MongoDB Clusters
Development to Production with Sharded MongoDB ClustersDevelopment to Production with Sharded MongoDB Clusters
Development to Production with Sharded MongoDB Clusters
 
Day 2 General Session Presentations RedisConf
Day 2 General Session Presentations RedisConfDay 2 General Session Presentations RedisConf
Day 2 General Session Presentations RedisConf
 

Andere mochten auch

Practical Ruby Projects (Alex Sharp)
Practical Ruby Projects (Alex Sharp)Practical Ruby Projects (Alex Sharp)
Practical Ruby Projects (Alex Sharp)MongoSF
 
Debugging Ruby (Aman Gupta)
Debugging Ruby (Aman Gupta)Debugging Ruby (Aman Gupta)
Debugging Ruby (Aman Gupta)MongoSF
 
MongoHQ (Jason McCay & Ben Wyrosdick)
MongoHQ (Jason McCay & Ben Wyrosdick)MongoHQ (Jason McCay & Ben Wyrosdick)
MongoHQ (Jason McCay & Ben Wyrosdick)MongoSF
 
Administration (Eliot Horowitz)
Administration (Eliot Horowitz)Administration (Eliot Horowitz)
Administration (Eliot Horowitz)MongoSF
 
Implementing MongoDB at Shutterfly (Kenny Gorman)
Implementing MongoDB at Shutterfly (Kenny Gorman)Implementing MongoDB at Shutterfly (Kenny Gorman)
Implementing MongoDB at Shutterfly (Kenny Gorman)MongoSF
 
Schema design with MongoDB (Dwight Merriman)
Schema design with MongoDB (Dwight Merriman)Schema design with MongoDB (Dwight Merriman)
Schema design with MongoDB (Dwight Merriman)MongoSF
 
Real time ecommerce analytics with MongoDB at Gilt Groupe (Michael Bryzek & M...
Real time ecommerce analytics with MongoDB at Gilt Groupe (Michael Bryzek & M...Real time ecommerce analytics with MongoDB at Gilt Groupe (Michael Bryzek & M...
Real time ecommerce analytics with MongoDB at Gilt Groupe (Michael Bryzek & M...MongoSF
 
MongoDB Replication (Dwight Merriman)
MongoDB Replication (Dwight Merriman)MongoDB Replication (Dwight Merriman)
MongoDB Replication (Dwight Merriman)MongoSF
 

Andere mochten auch (20)

Testing Experience Magazine Vol.12 Dec 2010
Testing Experience Magazine Vol.12 Dec 2010Testing Experience Magazine Vol.12 Dec 2010
Testing Experience Magazine Vol.12 Dec 2010
 
A Regression Analysis Approach for Building a Prediction Model for System Tes...
A Regression Analysis Approach for Building a Prediction Model for System Tes...A Regression Analysis Approach for Building a Prediction Model for System Tes...
A Regression Analysis Approach for Building a Prediction Model for System Tes...
 
Practical Ruby Projects (Alex Sharp)
Practical Ruby Projects (Alex Sharp)Practical Ruby Projects (Alex Sharp)
Practical Ruby Projects (Alex Sharp)
 
A Proposal of Postgraduate Programme for Software Testing Specialization
A Proposal of Postgraduate Programme for Software Testing SpecializationA Proposal of Postgraduate Programme for Software Testing Specialization
A Proposal of Postgraduate Programme for Software Testing Specialization
 
Robert Pattinson
Robert PattinsonRobert Pattinson
Robert Pattinson
 
Robert Pattinson
Robert PattinsonRobert Pattinson
Robert Pattinson
 
Debugging Ruby (Aman Gupta)
Debugging Ruby (Aman Gupta)Debugging Ruby (Aman Gupta)
Debugging Ruby (Aman Gupta)
 
MongoHQ (Jason McCay & Ben Wyrosdick)
MongoHQ (Jason McCay & Ben Wyrosdick)MongoHQ (Jason McCay & Ben Wyrosdick)
MongoHQ (Jason McCay & Ben Wyrosdick)
 
Performance Testing: Analyzing Differences of Response Time between Performan...
Performance Testing: Analyzing Differences of Response Time between Performan...Performance Testing: Analyzing Differences of Response Time between Performan...
Performance Testing: Analyzing Differences of Response Time between Performan...
 
A Method for Predicting Defects in System Testing for V-Model
A Method for Predicting Defects in System Testing for V-ModelA Method for Predicting Defects in System Testing for V-Model
A Method for Predicting Defects in System Testing for V-Model
 
Establishing A Defect Prediction Model Using A Combination of Product Metrics...
Establishing A Defect Prediction Model Using A Combination of Product Metrics...Establishing A Defect Prediction Model Using A Combination of Product Metrics...
Establishing A Defect Prediction Model Using A Combination of Product Metrics...
 
Breaking the Software - A Topic on Software Engineering & Testing
Breaking the Software -  A Topic on Software Engineering & TestingBreaking the Software -  A Topic on Software Engineering & Testing
Breaking the Software - A Topic on Software Engineering & Testing
 
Administration (Eliot Horowitz)
Administration (Eliot Horowitz)Administration (Eliot Horowitz)
Administration (Eliot Horowitz)
 
Implementing MongoDB at Shutterfly (Kenny Gorman)
Implementing MongoDB at Shutterfly (Kenny Gorman)Implementing MongoDB at Shutterfly (Kenny Gorman)
Implementing MongoDB at Shutterfly (Kenny Gorman)
 
Schema design with MongoDB (Dwight Merriman)
Schema design with MongoDB (Dwight Merriman)Schema design with MongoDB (Dwight Merriman)
Schema design with MongoDB (Dwight Merriman)
 
An Alternative of Secured Online Shopping System via Point-Based Contactless ...
An Alternative of Secured Online Shopping System via Point-Based Contactless ...An Alternative of Secured Online Shopping System via Point-Based Contactless ...
An Alternative of Secured Online Shopping System via Point-Based Contactless ...
 
Real time ecommerce analytics with MongoDB at Gilt Groupe (Michael Bryzek & M...
Real time ecommerce analytics with MongoDB at Gilt Groupe (Michael Bryzek & M...Real time ecommerce analytics with MongoDB at Gilt Groupe (Michael Bryzek & M...
Real time ecommerce analytics with MongoDB at Gilt Groupe (Michael Bryzek & M...
 
MongoDB Replication (Dwight Merriman)
MongoDB Replication (Dwight Merriman)MongoDB Replication (Dwight Merriman)
MongoDB Replication (Dwight Merriman)
 
Performance Testing Strategy for Cloud-Based System using Open Source Testing...
Performance Testing Strategy for Cloud-Based System using Open Source Testing...Performance Testing Strategy for Cloud-Based System using Open Source Testing...
Performance Testing Strategy for Cloud-Based System using Open Source Testing...
 
VIEWLEX # 08
VIEWLEX # 08VIEWLEX # 08
VIEWLEX # 08
 

Ähnlich wie Building a Mongo DSL in Scala at Hot Potato (Lincoln Hochberg)

2013 CPM Conference, Nov 6th, NoSQL Capacity Planning
2013 CPM Conference, Nov 6th, NoSQL Capacity Planning2013 CPM Conference, Nov 6th, NoSQL Capacity Planning
2013 CPM Conference, Nov 6th, NoSQL Capacity Planningasya999
 
Silicon Valley Code Camp 2014 - Advanced MongoDB
Silicon Valley Code Camp 2014 - Advanced MongoDBSilicon Valley Code Camp 2014 - Advanced MongoDB
Silicon Valley Code Camp 2014 - Advanced MongoDBDaniel Coupal
 
Partner Webinar: The Scaling Checklist for MongoDB - 100GB and beyond
Partner Webinar: The Scaling Checklist for MongoDB - 100GB and beyondPartner Webinar: The Scaling Checklist for MongoDB - 100GB and beyond
Partner Webinar: The Scaling Checklist for MongoDB - 100GB and beyondMongoDB
 
TDD a REST API With Node.js and MongoDB
TDD a REST API With Node.js and MongoDBTDD a REST API With Node.js and MongoDB
TDD a REST API With Node.js and MongoDBValeri Karpov
 
Developing and Testing a MongoDB and Node.js REST API
Developing and Testing a MongoDB and Node.js REST APIDeveloping and Testing a MongoDB and Node.js REST API
Developing and Testing a MongoDB and Node.js REST APIAll Things Open
 
SharePoint Saturday San Antonio: SharePoint 2010 Performance
SharePoint Saturday San Antonio: SharePoint 2010 PerformanceSharePoint Saturday San Antonio: SharePoint 2010 Performance
SharePoint Saturday San Antonio: SharePoint 2010 PerformanceBrian Culver
 
12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQLKonstantin Gredeskoul
 
Mongo db pefrormance optimization strategies
Mongo db pefrormance optimization strategiesMongo db pefrormance optimization strategies
Mongo db pefrormance optimization strategiesronwarshawsky
 
Let the Tiger Roar - MongoDB 3.0
Let the Tiger Roar - MongoDB 3.0Let the Tiger Roar - MongoDB 3.0
Let the Tiger Roar - MongoDB 3.0Norberto Leite
 
MongoDB 2.4 and spring data
MongoDB 2.4 and spring dataMongoDB 2.4 and spring data
MongoDB 2.4 and spring dataJimmy Ray
 
Bringing Some Spatial Love to your Application with OpenShift - Mongo Berlin ...
Bringing Some Spatial Love to your Application with OpenShift - Mongo Berlin ...Bringing Some Spatial Love to your Application with OpenShift - Mongo Berlin ...
Bringing Some Spatial Love to your Application with OpenShift - Mongo Berlin ...OpenShift Origin
 
Benchmarking, Load Testing, and Preventing Terrible Disasters
Benchmarking, Load Testing, and Preventing Terrible DisastersBenchmarking, Load Testing, and Preventing Terrible Disasters
Benchmarking, Load Testing, and Preventing Terrible DisastersMongoDB
 
Mongo db first steps with csharp
Mongo db first steps with csharpMongo db first steps with csharp
Mongo db first steps with csharpSerdar Buyuktemiz
 
Designing your API Server for mobile apps
Designing your API Server for mobile appsDesigning your API Server for mobile apps
Designing your API Server for mobile appsMugunth Kumar
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBRavi Teja
 
MEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona WorkshopMEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona WorkshopValeri Karpov
 
2019 StartIT - Boosting your performance with Blackfire
2019 StartIT - Boosting your performance with Blackfire2019 StartIT - Boosting your performance with Blackfire
2019 StartIT - Boosting your performance with BlackfireMarko Mitranić
 
MongoDC 2012: "Operationalizing" MongoDB@AOL
MongoDC 2012: "Operationalizing" MongoDB@AOLMongoDC 2012: "Operationalizing" MongoDB@AOL
MongoDC 2012: "Operationalizing" MongoDB@AOLMongoDB
 
Operationalizing MongoDB at AOL
Operationalizing MongoDB at AOLOperationalizing MongoDB at AOL
Operationalizing MongoDB at AOLradiocats
 
Salvatore Incandela "Loyalty cashback - Scaling with MongoDB"
Salvatore Incandela "Loyalty cashback - Scaling with MongoDB"Salvatore Incandela "Loyalty cashback - Scaling with MongoDB"
Salvatore Incandela "Loyalty cashback - Scaling with MongoDB"Paybay
 

Ähnlich wie Building a Mongo DSL in Scala at Hot Potato (Lincoln Hochberg) (20)

2013 CPM Conference, Nov 6th, NoSQL Capacity Planning
2013 CPM Conference, Nov 6th, NoSQL Capacity Planning2013 CPM Conference, Nov 6th, NoSQL Capacity Planning
2013 CPM Conference, Nov 6th, NoSQL Capacity Planning
 
Silicon Valley Code Camp 2014 - Advanced MongoDB
Silicon Valley Code Camp 2014 - Advanced MongoDBSilicon Valley Code Camp 2014 - Advanced MongoDB
Silicon Valley Code Camp 2014 - Advanced MongoDB
 
Partner Webinar: The Scaling Checklist for MongoDB - 100GB and beyond
Partner Webinar: The Scaling Checklist for MongoDB - 100GB and beyondPartner Webinar: The Scaling Checklist for MongoDB - 100GB and beyond
Partner Webinar: The Scaling Checklist for MongoDB - 100GB and beyond
 
TDD a REST API With Node.js and MongoDB
TDD a REST API With Node.js and MongoDBTDD a REST API With Node.js and MongoDB
TDD a REST API With Node.js and MongoDB
 
Developing and Testing a MongoDB and Node.js REST API
Developing and Testing a MongoDB and Node.js REST APIDeveloping and Testing a MongoDB and Node.js REST API
Developing and Testing a MongoDB and Node.js REST API
 
SharePoint Saturday San Antonio: SharePoint 2010 Performance
SharePoint Saturday San Antonio: SharePoint 2010 PerformanceSharePoint Saturday San Antonio: SharePoint 2010 Performance
SharePoint Saturday San Antonio: SharePoint 2010 Performance
 
12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL
 
Mongo db pefrormance optimization strategies
Mongo db pefrormance optimization strategiesMongo db pefrormance optimization strategies
Mongo db pefrormance optimization strategies
 
Let the Tiger Roar - MongoDB 3.0
Let the Tiger Roar - MongoDB 3.0Let the Tiger Roar - MongoDB 3.0
Let the Tiger Roar - MongoDB 3.0
 
MongoDB 2.4 and spring data
MongoDB 2.4 and spring dataMongoDB 2.4 and spring data
MongoDB 2.4 and spring data
 
Bringing Some Spatial Love to your Application with OpenShift - Mongo Berlin ...
Bringing Some Spatial Love to your Application with OpenShift - Mongo Berlin ...Bringing Some Spatial Love to your Application with OpenShift - Mongo Berlin ...
Bringing Some Spatial Love to your Application with OpenShift - Mongo Berlin ...
 
Benchmarking, Load Testing, and Preventing Terrible Disasters
Benchmarking, Load Testing, and Preventing Terrible DisastersBenchmarking, Load Testing, and Preventing Terrible Disasters
Benchmarking, Load Testing, and Preventing Terrible Disasters
 
Mongo db first steps with csharp
Mongo db first steps with csharpMongo db first steps with csharp
Mongo db first steps with csharp
 
Designing your API Server for mobile apps
Designing your API Server for mobile appsDesigning your API Server for mobile apps
Designing your API Server for mobile apps
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
MEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona WorkshopMEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona Workshop
 
2019 StartIT - Boosting your performance with Blackfire
2019 StartIT - Boosting your performance with Blackfire2019 StartIT - Boosting your performance with Blackfire
2019 StartIT - Boosting your performance with Blackfire
 
MongoDC 2012: "Operationalizing" MongoDB@AOL
MongoDC 2012: "Operationalizing" MongoDB@AOLMongoDC 2012: "Operationalizing" MongoDB@AOL
MongoDC 2012: "Operationalizing" MongoDB@AOL
 
Operationalizing MongoDB at AOL
Operationalizing MongoDB at AOLOperationalizing MongoDB at AOL
Operationalizing MongoDB at AOL
 
Salvatore Incandela "Loyalty cashback - Scaling with MongoDB"
Salvatore Incandela "Loyalty cashback - Scaling with MongoDB"Salvatore Incandela "Loyalty cashback - Scaling with MongoDB"
Salvatore Incandela "Loyalty cashback - Scaling with MongoDB"
 

Mehr von MongoSF

Webinar: Typische MongoDB Anwendungsfälle (Common MongoDB Use Cases) 
Webinar: Typische MongoDB Anwendungsfälle (Common MongoDB Use Cases) Webinar: Typische MongoDB Anwendungsfälle (Common MongoDB Use Cases) 
Webinar: Typische MongoDB Anwendungsfälle (Common MongoDB Use Cases) MongoSF
 
C# Development (Sam Corder)
C# Development (Sam Corder)C# Development (Sam Corder)
C# Development (Sam Corder)MongoSF
 
Flexible Event Tracking (Paul Gebheim)
Flexible Event Tracking (Paul Gebheim)Flexible Event Tracking (Paul Gebheim)
Flexible Event Tracking (Paul Gebheim)MongoSF
 
Ruby Development and MongoMapper (John Nunemaker)
Ruby Development and MongoMapper (John Nunemaker)Ruby Development and MongoMapper (John Nunemaker)
Ruby Development and MongoMapper (John Nunemaker)MongoSF
 
Administration
AdministrationAdministration
AdministrationMongoSF
 
Sharding with MongoDB (Eliot Horowitz)
Sharding with MongoDB (Eliot Horowitz)Sharding with MongoDB (Eliot Horowitz)
Sharding with MongoDB (Eliot Horowitz)MongoSF
 
Indexing and Query Optimizer (Aaron Staple)
Indexing and Query Optimizer (Aaron Staple)Indexing and Query Optimizer (Aaron Staple)
Indexing and Query Optimizer (Aaron Staple)MongoSF
 
Zero to Mongo in 60 Hours
Zero to Mongo in 60 HoursZero to Mongo in 60 Hours
Zero to Mongo in 60 HoursMongoSF
 
PHP Development with MongoDB (Fitz Agard)
PHP Development with MongoDB (Fitz Agard)PHP Development with MongoDB (Fitz Agard)
PHP Development with MongoDB (Fitz Agard)MongoSF
 
Java Development with MongoDB (James Williams)
Java Development with MongoDB (James Williams)Java Development with MongoDB (James Williams)
Java Development with MongoDB (James Williams)MongoSF
 
From MySQL to MongoDB at Wordnik (Tony Tam)
From MySQL to MongoDB at Wordnik (Tony Tam)From MySQL to MongoDB at Wordnik (Tony Tam)
From MySQL to MongoDB at Wordnik (Tony Tam)MongoSF
 
Map/reduce, geospatial indexing, and other cool features (Kristina Chodorow)
Map/reduce, geospatial indexing, and other cool features (Kristina Chodorow)Map/reduce, geospatial indexing, and other cool features (Kristina Chodorow)
Map/reduce, geospatial indexing, and other cool features (Kristina Chodorow)MongoSF
 

Mehr von MongoSF (12)

Webinar: Typische MongoDB Anwendungsfälle (Common MongoDB Use Cases) 
Webinar: Typische MongoDB Anwendungsfälle (Common MongoDB Use Cases) Webinar: Typische MongoDB Anwendungsfälle (Common MongoDB Use Cases) 
Webinar: Typische MongoDB Anwendungsfälle (Common MongoDB Use Cases) 
 
C# Development (Sam Corder)
C# Development (Sam Corder)C# Development (Sam Corder)
C# Development (Sam Corder)
 
Flexible Event Tracking (Paul Gebheim)
Flexible Event Tracking (Paul Gebheim)Flexible Event Tracking (Paul Gebheim)
Flexible Event Tracking (Paul Gebheim)
 
Ruby Development and MongoMapper (John Nunemaker)
Ruby Development and MongoMapper (John Nunemaker)Ruby Development and MongoMapper (John Nunemaker)
Ruby Development and MongoMapper (John Nunemaker)
 
Administration
AdministrationAdministration
Administration
 
Sharding with MongoDB (Eliot Horowitz)
Sharding with MongoDB (Eliot Horowitz)Sharding with MongoDB (Eliot Horowitz)
Sharding with MongoDB (Eliot Horowitz)
 
Indexing and Query Optimizer (Aaron Staple)
Indexing and Query Optimizer (Aaron Staple)Indexing and Query Optimizer (Aaron Staple)
Indexing and Query Optimizer (Aaron Staple)
 
Zero to Mongo in 60 Hours
Zero to Mongo in 60 HoursZero to Mongo in 60 Hours
Zero to Mongo in 60 Hours
 
PHP Development with MongoDB (Fitz Agard)
PHP Development with MongoDB (Fitz Agard)PHP Development with MongoDB (Fitz Agard)
PHP Development with MongoDB (Fitz Agard)
 
Java Development with MongoDB (James Williams)
Java Development with MongoDB (James Williams)Java Development with MongoDB (James Williams)
Java Development with MongoDB (James Williams)
 
From MySQL to MongoDB at Wordnik (Tony Tam)
From MySQL to MongoDB at Wordnik (Tony Tam)From MySQL to MongoDB at Wordnik (Tony Tam)
From MySQL to MongoDB at Wordnik (Tony Tam)
 
Map/reduce, geospatial indexing, and other cool features (Kristina Chodorow)
Map/reduce, geospatial indexing, and other cool features (Kristina Chodorow)Map/reduce, geospatial indexing, and other cool features (Kristina Chodorow)
Map/reduce, geospatial indexing, and other cool features (Kristina Chodorow)
 

Kürzlich hochgeladen

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 

Kürzlich hochgeladen (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 

Building a Mongo DSL in Scala at Hot Potato (Lincoln Hochberg)

  • 2. Hot Potato Overview • What: Hot Potato connects audiences around shared interests • When: Founded early 2009 / PoC: Dec 2009 / Beta: 2 months ago • Where: Williamsburg, Brooklyn! • Who: Lincoln, Justin, Saadiq, Jeremy, Jace, Matt, Mike, Will 2
  • 4. Hot Potato on the iPhone 4
  • 5. Technology Stack Design principles: Simple and stateless API • Scala / MongoDB API Clients • Web application (Python/Django) • iPhone (Obj-C) 5
  • 6. Hot Potato API - Why MongoDB? • Good documentation and excellent support • Fully Featured (like an RDBMS) but with a migration path to scale- out • Replication • Easy administration / scripting • Fast • Auto-sharding coming soon 6
  • 7. Hot Potato API - Why MongoDB? 7
  • 8. Hot Potato API - Why MongoDB? RDBMS Optimization process 7
  • 9. Hot Potato API - Why MongoDB? RDBMS Optimization process 1. too many reads -> add cache 7
  • 10. Hot Potato API - Why MongoDB? RDBMS Optimization process 1. too many reads -> add cache 2. too many joins -> de-normalize your data 7
  • 11. Hot Potato API - Why MongoDB? RDBMS Optimization process 1. too many reads -> add cache 2. too many joins -> de-normalize your data 3. too many writes -> scale up hardware, CPU, RAM, IO 7
  • 12. Hot Potato API - Why MongoDB? RDBMS Optimization process 1. too many reads -> add cache 2. too many joins -> de-normalize your data 3. too many writes -> scale up hardware, CPU, RAM, IO 4. too much db load -> eliminate triggers, stored procedures 7
  • 13. Hot Potato API - Why MongoDB? RDBMS Optimization process 1. too many reads -> add cache 2. too many joins -> de-normalize your data 3. too many writes -> scale up hardware, CPU, RAM, IO 4. too much db load -> eliminate triggers, stored procedures 5. too much db load -> pre-materialize complex queries 7
  • 14. Hot Potato API - Why MongoDB? RDBMS Optimization process 1. too many reads -> add cache 2. too many joins -> de-normalize your data 3. too many writes -> scale up hardware, CPU, RAM, IO 4. too much db load -> eliminate triggers, stored procedures 5. too much db load -> pre-materialize complex queries 6. writes bottleneck -> drop secondary indexes 7
  • 15. Hot Potato API - Why MongoDB? RDBMS Optimization process 1. too many reads -> add cache 2. too many joins -> de-normalize your data 3. too many writes -> scale up hardware, CPU, RAM, IO 4. too much db load -> eliminate triggers, stored procedures 5. too much db load -> pre-materialize complex queries 6. writes bottleneck -> drop secondary indexes At this point you are using the RDBMS as a KV store. The full- featured nature of the RDBMS is merely getting in the way of scaling. 7
  • 16. Hot Potato API - Why MongoDB? 8
  • 17. Hot Potato API - Why MongoDB? Mongo comparison 8
  • 18. Hot Potato API - Why MongoDB? Mongo comparison 1. reads start out fast, can be externally cached, can also be horizontally scaled 8
  • 19. Hot Potato API - Why MongoDB? Mongo comparison 1. reads start out fast, can be externally cached, can also be horizontally scaled 2. mongo doesn’t support joins - data starts de-normalized 8
  • 20. Hot Potato API - Why MongoDB? Mongo comparison 1. reads start out fast, can be externally cached, can also be horizontally scaled 2. mongo doesn’t support joins - data starts de-normalized 3. writes start out fast, can be horizontally scaled 8
  • 21. Hot Potato API - Why MongoDB? Mongo comparison 1. reads start out fast, can be externally cached, can also be horizontally scaled 2. mongo doesn’t support joins - data starts de-normalized 3. writes start out fast, can be horizontally scaled 4. much less opportunity for logic in the db 8
  • 22. Hot Potato API - Why MongoDB? Mongo comparison 1. reads start out fast, can be externally cached, can also be horizontally scaled 2. mongo doesn’t support joins - data starts de-normalized 3. writes start out fast, can be horizontally scaled 4. much less opportunity for logic in the db 5. map/reduce for pre-materialization/aggregation, which can be horizontally scaled 8
  • 23. Hot Potato API - Why MongoDB? Mongo comparison 1. reads start out fast, can be externally cached, can also be horizontally scaled 2. mongo doesn’t support joins - data starts de-normalized 3. writes start out fast, can be horizontally scaled 4. much less opportunity for logic in the db 5. map/reduce for pre-materialization/aggregation, which can be horizontally scaled 6. indexes can be removed over time as usage becomes more KV-like 8
  • 24. Hot Potato API - Why MongoDB? Mongo comparison 1. reads start out fast, can be externally cached, can also be horizontally scaled 2. mongo doesn’t support joins - data starts de-normalized 3. writes start out fast, can be horizontally scaled 4. much less opportunity for logic in the db 5. map/reduce for pre-materialization/aggregation, which can be horizontally scaled 6. indexes can be removed over time as usage becomes more KV-like The gradual scaling process is more natural with Mongo. Horizontal scaling is not an after-thought or bolt on addition. Mongo works perfectly well as a KV store if you ever get to that point. 8
  • 25. Hot Potato API - Why Scala? • Runs on JVM (Stable, Fast) • Access to Java’s many libraries • Language benefits • Terse • Supports Immutability • Functional • Concurrent • Easy to write DSLs 9
  • 26. Three key Scala features • Pattern Matching / Case classes • Implicit conversions • Actors 10
  • 27. Building a DSL for Mongo Documents are a flexible building block: • Insertion • Updates • Queries • Sorting • parts of Map / Reduce • Indexes 11
  • 28. Building a DSL for Mongo Goals • Stay close to the MongoDB Java API • Keep it flexible • Focus on document creation • New documents, queries, updates • Protect against mis-named fields Key classes and objects • Collection - wraps MongoDB DBCollection • MongoAST - defines the types for building Mongo documents • MongoDSL - defines DSL syntax 12
  • 29. Usage Patterns Asynchronous atomic updates • Simple observer pattern implemented with Lift Actors • HpActor, HpActorPool, Notifier • Main action object with a Notifier • Example: checkins • Listeners that use MongoDB atomic updates • Example: EventAdjuster 13

Hinweis der Redaktion