SlideShare une entreprise Scribd logo
1  sur  40
MongoDB
      at
Community Engine
About me

Lead platform engineer
mathieu.kempe@communityengine.com
@mathieukempe
Agenda

Brain dump on our experience with MongoDB
• Why NoSQL
• Why we chose MongoDB
• Moving away from an hybrid solution
• MongoDB and Amazon
• SOLR and MongoDB
• Ease of development
• Zero downtime database deployment
About Community Engine
• Social network based on locality and
  small business
• Launching in April
• Built on:
    • ASP.NET MVC 3
    • Amazon Web services
    • MongoDB
    • SOLR
    • Mahout
    • …
NoSQL?

• How to store the big amounts of data required
  in social networking applications
• Data complexity, NoSQL handle hierarchical
  and graph data structures better
• Change management is always difficult with
  RDBMS
• Scaling
Why we chose MongoDB?

• Reviewed different products RavenDB, CouchDB...
• Selected MongoDB because we had the best
  experience
   – Very easy to install and get started
   – Great developer experience
   – Replication very easy to setup
   – Good documentation
   – Much of the convenience of SQL, Dynamic
     Queries, Indexing
Why Hybrid?

• Team had a lot of experience with SQL Server
  and Entity Framework
• Reporting
• Transaction
No more SQL Server
• Simplify our infrastructure
• Easier to Backup
• Better performance, not slowed down by SQL
  Server, too many queries joined in the
  application
• Development speed
• Lower cost
Transaction?

Transactions we could go around that using the atomic
  document updates and a good schema design

MongoDB supports atomic operations on single
 document.

When transactions across documents are needed
Two phase commits
Hosting with Amazon Web Service

• Elasticity and scalability
• Configure MongoDB using Amazon EC2 instance
  bundled into an AMI.
• 64 bits EC2 instance
• Raid10 + EBS volumes
• Multi-datacenter 3-node replica set in different
  availability zone
• Use secondaries for zero downtime backup
• We are not yet using sharded replica sets
What about durability?


Use journaling
Use replica sets
Critical writes

Verify that replication is working at write time

mongodb://host1,host2,host3/?safe=true;w=2;

•safe=true : Use safemode
•w=2: wmode, connect to a replica set waiting for
replication to succeed on the majority of nodes
Why we kept SOLR?

•   Right tool for the right job
•   Proven technology
•   SOLR best solution for Full Text Indexing
•   Faceted search, Spelling suggestions…
•   Team already skilled with SOLR
•   SOLR scales well
MongoDB/SOLR How we do it
MongoDB/SOLR How we do it
MongoDB/SOLR How we do it
MongoDB/SOLR How we do it
MongoDB/SOLR How we do it
Ease of development
Hierarchical data in SQL Server
Single table
Mongo Database Schema

Using Type discriminator

{
     "_id" : ObjectId("4f504e7acd3e1c190ce04198"),
     "_t" : "PhotoSpark",
     "Photo" : "MyMotorcycle.png "
    "DateCreated" : ISODate("2012-02-24T09:23:12.246Z")
}
{
     "_id" : ObjectId("4f504e7ccd3e1c190ce04199"),
     "_t" : "PostSpark",
     "Body" : "Hello World“
    " DateCreated" : ISODate("2012-02-28T10:44:12.858Z")
}
Views
                      


                                         




                                         




                
Deployment of database with zero downtime

• We release every week
• We aim at zero downtime
• Our domain model change often
Deployment of database with zero downtime

Make sure that our code can handle both
 "versions" of the data structure
When saving we updates to the new structure
Deployment of database with zero downtime

• Use a migration script
Deployment of database with zero downtime

  Expansion Script   Deploy new version   Compression Script




                                                               t
Questions?
Thank you!

mathieu.kempe@communityengine.com
@mathieukempe

Contenu connexe

Tendances

Application of nodejs in epsilon mobile
Application of nodejs in epsilon mobileApplication of nodejs in epsilon mobile
Application of nodejs in epsilon mobile
Tony Vo
 
Containerization - The DevOps Revolution
Containerization - The DevOps RevolutionContainerization - The DevOps Revolution
Containerization - The DevOps Revolution
Yulian Slobodyan
 
Антон Бойко "Разделяй и властвуй — набор практик для построения масштабируемо...
Антон Бойко "Разделяй и властвуй — набор практик для построения масштабируемо...Антон Бойко "Разделяй и властвуй — набор практик для построения масштабируемо...
Антон Бойко "Разделяй и властвуй — набор практик для построения масштабируемо...
Marina Peregud
 

Tendances (19)

Docker y azure container service
Docker y azure container serviceDocker y azure container service
Docker y azure container service
 
Know thy cost (or where performance problems lurk)
Know thy cost (or where performance problems lurk)Know thy cost (or where performance problems lurk)
Know thy cost (or where performance problems lurk)
 
Architecting on The Cloud
Architecting on The CloudArchitecting on The Cloud
Architecting on The Cloud
 
Application of nodejs in epsilon mobile
Application of nodejs in epsilon mobileApplication of nodejs in epsilon mobile
Application of nodejs in epsilon mobile
 
Cloudsolutionday 2016: Docker & FAAS at getvero.com
Cloudsolutionday 2016: Docker & FAAS at getvero.comCloudsolutionday 2016: Docker & FAAS at getvero.com
Cloudsolutionday 2016: Docker & FAAS at getvero.com
 
Containerization - The DevOps Revolution
Containerization - The DevOps RevolutionContainerization - The DevOps Revolution
Containerization - The DevOps Revolution
 
Aws 12 Month Free Tier for Web Designers and Developers
Aws 12 Month Free Tier for Web Designers and DevelopersAws 12 Month Free Tier for Web Designers and Developers
Aws 12 Month Free Tier for Web Designers and Developers
 
Cnam cours azure web sites
Cnam cours azure web sitesCnam cours azure web sites
Cnam cours azure web sites
 
Running MongoDB in the Cloud
Running MongoDB in the CloudRunning MongoDB in the Cloud
Running MongoDB in the Cloud
 
Building Codealike: a journey into the developers analytics world
Building Codealike: a journey into the developers analytics worldBuilding Codealike: a journey into the developers analytics world
Building Codealike: a journey into the developers analytics world
 
How Microsoft learned to love Java
How Microsoft learned to love JavaHow Microsoft learned to love Java
How Microsoft learned to love Java
 
Optimizing Your WordPress Site
Optimizing Your WordPress SiteOptimizing Your WordPress Site
Optimizing Your WordPress Site
 
Антон Бойко "Разделяй и властвуй — набор практик для построения масштабируемо...
Антон Бойко "Разделяй и властвуй — набор практик для построения масштабируемо...Антон Бойко "Разделяй и властвуй — набор практик для построения масштабируемо...
Антон Бойко "Разделяй и властвуй — набор практик для построения масштабируемо...
 
How and when to use NoSQL
How and when to use NoSQLHow and when to use NoSQL
How and when to use NoSQL
 
Customer Presentaion-LittleBigPlanet: Taking an Idea to Market Using AWS
Customer Presentaion-LittleBigPlanet: Taking an Idea to Market Using AWSCustomer Presentaion-LittleBigPlanet: Taking an Idea to Market Using AWS
Customer Presentaion-LittleBigPlanet: Taking an Idea to Market Using AWS
 
Matt Chung (Independent) - Serverless application with AWS Lambda
Matt Chung (Independent) - Serverless application with AWS Lambda Matt Chung (Independent) - Serverless application with AWS Lambda
Matt Chung (Independent) - Serverless application with AWS Lambda
 
How to Build High Performance : WordPress
How to Build High Performance : WordPressHow to Build High Performance : WordPress
How to Build High Performance : WordPress
 
Visualization of RDS metrics using AWS CLI and JQuery at AWS Usergroup Leipzig
Visualization of RDS metrics using AWS CLI and JQuery at AWS Usergroup LeipzigVisualization of RDS metrics using AWS CLI and JQuery at AWS Usergroup Leipzig
Visualization of RDS metrics using AWS CLI and JQuery at AWS Usergroup Leipzig
 
Azure virtual machine-network
Azure virtual machine-networkAzure virtual machine-network
Azure virtual machine-network
 

Similaire à Mongo DB at Community Engine

web development with mern stack in power point
web development with mern stack in power pointweb development with mern stack in power point
web development with mern stack in power point
RAMKUMARRIT20
 
Final year presentation topicssssss in 1
Final year presentation topicssssss in 1Final year presentation topicssssss in 1
Final year presentation topicssssss in 1
RAMKUMARRIT20
 
Mongo db first steps with csharp
Mongo db first steps with csharpMongo db first steps with csharp
Mongo db first steps with csharp
Serdar Buyuktemiz
 
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
 

Similaire à Mongo DB at Community Engine (20)

MongoDB.pptx
MongoDB.pptxMongoDB.pptx
MongoDB.pptx
 
MongoDB World 2019: Using the MongoDB Enterprise Kubernetes Operator to Scale...
MongoDB World 2019: Using the MongoDB Enterprise Kubernetes Operator to Scale...MongoDB World 2019: Using the MongoDB Enterprise Kubernetes Operator to Scale...
MongoDB World 2019: Using the MongoDB Enterprise Kubernetes Operator to Scale...
 
Managing Your Cloud Assets
Managing Your Cloud AssetsManaging Your Cloud Assets
Managing Your Cloud Assets
 
MongoDB MUG Delhi NCR - December 19 2020 (Cloud Security)
MongoDB MUG Delhi NCR - December 19 2020 (Cloud Security)MongoDB MUG Delhi NCR - December 19 2020 (Cloud Security)
MongoDB MUG Delhi NCR - December 19 2020 (Cloud Security)
 
Building FoundationDB
Building FoundationDBBuilding FoundationDB
Building FoundationDB
 
Microservices
MicroservicesMicroservices
Microservices
 
Aws-What You Need to Know_Simon Elisha
Aws-What You Need to Know_Simon ElishaAws-What You Need to Know_Simon Elisha
Aws-What You Need to Know_Simon Elisha
 
The Perils and Triumphs of using Cassandra at a .NET/Microsoft Shop
The Perils and Triumphs of using Cassandra at a .NET/Microsoft ShopThe Perils and Triumphs of using Cassandra at a .NET/Microsoft Shop
The Perils and Triumphs of using Cassandra at a .NET/Microsoft Shop
 
20120306 dublin js
20120306 dublin js20120306 dublin js
20120306 dublin js
 
Meanstack overview
Meanstack overviewMeanstack overview
Meanstack overview
 
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
 
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
 
Windows Azure introduction
Windows Azure introductionWindows Azure introduction
Windows Azure introduction
 
Introduction to MERN Stack
Introduction to MERN StackIntroduction to MERN Stack
Introduction to MERN Stack
 
web development with mern stack in power point
web development with mern stack in power pointweb development with mern stack in power point
web development with mern stack in power point
 
Final year presentation topicssssss in 1
Final year presentation topicssssss in 1Final year presentation topicssssss in 1
Final year presentation topicssssss in 1
 
Scaling with mongo db (with notes)
Scaling with mongo db (with notes)Scaling with mongo db (with notes)
Scaling with mongo db (with notes)
 
Mongo db first steps with csharp
Mongo db first steps with csharpMongo db first steps with csharp
Mongo db first steps with csharp
 
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?
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.js
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

Mongo DB at Community Engine

  • 1. MongoDB at Community Engine
  • 2. About me Lead platform engineer mathieu.kempe@communityengine.com @mathieukempe
  • 3. Agenda Brain dump on our experience with MongoDB • Why NoSQL • Why we chose MongoDB • Moving away from an hybrid solution • MongoDB and Amazon • SOLR and MongoDB • Ease of development • Zero downtime database deployment
  • 4. About Community Engine • Social network based on locality and small business • Launching in April • Built on: • ASP.NET MVC 3 • Amazon Web services • MongoDB • SOLR • Mahout • …
  • 5. NoSQL? • How to store the big amounts of data required in social networking applications • Data complexity, NoSQL handle hierarchical and graph data structures better • Change management is always difficult with RDBMS • Scaling
  • 6. Why we chose MongoDB? • Reviewed different products RavenDB, CouchDB... • Selected MongoDB because we had the best experience – Very easy to install and get started – Great developer experience – Replication very easy to setup – Good documentation – Much of the convenience of SQL, Dynamic Queries, Indexing
  • 7.
  • 8. Why Hybrid? • Team had a lot of experience with SQL Server and Entity Framework • Reporting • Transaction
  • 9.
  • 10. No more SQL Server • Simplify our infrastructure • Easier to Backup • Better performance, not slowed down by SQL Server, too many queries joined in the application • Development speed • Lower cost
  • 11. Transaction? Transactions we could go around that using the atomic document updates and a good schema design MongoDB supports atomic operations on single document. When transactions across documents are needed Two phase commits
  • 12. Hosting with Amazon Web Service • Elasticity and scalability • Configure MongoDB using Amazon EC2 instance bundled into an AMI. • 64 bits EC2 instance • Raid10 + EBS volumes • Multi-datacenter 3-node replica set in different availability zone • Use secondaries for zero downtime backup • We are not yet using sharded replica sets
  • 13.
  • 14. What about durability? Use journaling Use replica sets
  • 15. Critical writes Verify that replication is working at write time mongodb://host1,host2,host3/?safe=true;w=2; •safe=true : Use safemode •w=2: wmode, connect to a replica set waiting for replication to succeed on the majority of nodes
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21. Why we kept SOLR? • Right tool for the right job • Proven technology • SOLR best solution for Full Text Indexing • Faceted search, Spelling suggestions… • Team already skilled with SOLR • SOLR scales well
  • 28. Hierarchical data in SQL Server
  • 30. Mongo Database Schema Using Type discriminator { "_id" : ObjectId("4f504e7acd3e1c190ce04198"), "_t" : "PhotoSpark", "Photo" : "MyMotorcycle.png " "DateCreated" : ISODate("2012-02-24T09:23:12.246Z") } { "_id" : ObjectId("4f504e7ccd3e1c190ce04199"), "_t" : "PostSpark", "Body" : "Hello World“ " DateCreated" : ISODate("2012-02-28T10:44:12.858Z") }
  • 31.
  • 32.
  • 33.
  • 34. Views                                                                    
  • 35. Deployment of database with zero downtime • We release every week • We aim at zero downtime • Our domain model change often
  • 36. Deployment of database with zero downtime Make sure that our code can handle both "versions" of the data structure When saving we updates to the new structure
  • 37. Deployment of database with zero downtime • Use a migration script
  • 38. Deployment of database with zero downtime Expansion Script Deploy new version Compression Script t

Notes de l'éditeur

  1. Brain dump on why we started to use MongoDB Why we moved away from a solution using MongoDB and SQL Server
  2. Moved to this infra
  3. If the primary crash we have the data in at least one of the secondary Second node has priority greater than or equal to other eligible nodes in the set
  4. Update is different as we do sometime Update in place Update in place are a query and an update in one command