SlideShare una empresa de Scribd logo
1 de 29
Replication and High Availability




         MongoDB Athens User Group
           Athens, Greece 16/1/2013
                 Alex Giamas
         alexandergiamas@yahoo.com
History

●   Oracle shop
●   Non existent OLAP
●   Queries in live DB




                         (c) Alex Giamas, Persado Inc, All rights reserved
Initial investigation

●   CouchDB
●   Riak
●   Hbase
●   Cassandra
●   MongoDB
●   Voldemort




                        (c) Alex Giamas, Persado Inc, All rights reserved
History

●   Missed all the fun while being in the States
●   Hadoop / HBase / llama / Pig
●   Sharded MySQL
●   Voldemort
●   Huge RAC deployments
●   Following MongoDB since 1.4 (Replica sets? Nah..
    Sharding?..alpha)
Reporting and Analytics
●   Settled on MongoDB
●   Document oriented
●   No clue about schema at the time
●   No clue about what are we going to do with client data




                                               (c) Alex Giamas, Persado Inc, All rights reserved
Prototyping, version 0.5

●   MT, MO, User collections
●   Sync Map Reduce for reporting
●   One DB to rule them all




                                    (c) Alex Giamas, Persado Inc, All rights reserved
Show stoppers

●   Single server deployment
●   Global write lock
●   MR in real time




                               (c) Alex Giamas, Persado Inc, All rights reserved
Results

●   Demo Christmas Eve 2010




                              (c) Alex Giamas, Persado Inc, All rights reserved
Results

●   Demo Christmas Eve 2010




●   Slow....




                              (c) Alex Giamas, Persado Inc, All rights reserved
Reporting, version 1.0

●   Spring Batch for async computations
●   Quartz scheduler firing every 3 minutes
●   Separate nodes for OLTP and OLAP Dbs
●   Custom cloneCollection()




                                              (c) Alex Giamas, Persado Inc, All rights reserved
Real world kicks in

●   Everything designed for online integration
●   Huge client coming in offering offline integration
●   Ride the cloud wagon!




                                                 (c) Alex Giamas, Persado Inc, All rights reserved
Reporting Version 2 (the real world)
●   Files coming in via FTP containing all sorts of time
    inconsistencies
●   No longer a linear timeline of events, more like a soup of
    results




                                                  (c) Alex Giamas, Persado Inc, All rights reserved
MongoDB on EC2
●   2 replica sets of 2 nodes+arb
●   Arbiters crossed wrt replica sets
●   Third node could be different availability zone




                                                 (c) Alex Giamas, Persado Inc, All rights reserved
Replica Sets Configuration




                       (c) Alex Giamas, Persado Inc, All rights reserved
Replica Sets Configuration



                  “server seen down”




                                       (c) Alex Giamas, Persado Inc, All rights reserved
Replica Sets Configuration

                     “server seen down”




                                          (c) Alex Giamas, Persado Inc, All rights reserved
Replica Sets Configuration

●   Can afford 1 failure with fully functional cluster
●   Can afford 2 failures with partially functional cluster**




    ** Terms and conditions may apply




                                                   (c) Alex Giamas, Persado Inc, All rights reserved
Replica Sets Configuration

●   Rolling upgrades without DB downtime
●   Schemaless, document oriented offers great flexibility in
    application terms




                                                 (c) Alex Giamas, Persado Inc, All rights reserved
Replica Sets Configuration

●   Unix level tweaks:
    –   raise ulimit
    –   raise tcp timeout
    –   Noatime nodiratime
    –   XFS, ext4
    –   LVM for snapshotting
●   Mongo level tips:
    –   Use journaling. USE JOURNALING




                                         (c) Alex Giamas, Persado Inc, All rights reserved
Replica Sets Configuration

  EC2 specific tips:
   –   Can and will steal back time, plan for it
   –   Can get flaky at times..
   –   Design around EBS




                                                   (c) Alex Giamas, Persado Inc, All rights reserved
Replica Sets Configuration

●   EC2 storage:
    –   Local storage. Ephemeral
    –   EBS storage. Lasts but not strong durability guarantees.
    –   S3 storage. Lasts more, slower




                                                         (c) Alex Giamas, Persado Inc, All rights reserved
Replica Sets Configuration

●   Settled for EBS storage.
●   Nightly backups, 30 day window




                                     (c) Alex Giamas, Persado Inc, All rights reserved
Reporting Version 3

●   Aggregation Framework effort led by Chris Westin
    –   Simpler way to perform Map Reduce jobs without all the pain of JS
    –   Integrates cleanly with our business logic
●   Initial design on sharding
    –   More on that next..




                                                       (c) Alex Giamas, Persado Inc, All rights reserved
Reporting Version 3

●   Aggregation framework for both storing and retrieving
    aggregate data
    –   New collection for double checking results with MR.
●   Faster, simpler, most of the times fits in our problem domain.




●   Worked better in dev than production versions ;)




                                                        (c) Alex Giamas, Persado Inc, All rights reserved
Reporting Version 3

●   More fine grained write semantics.
    –   WriteConcern.SAFE for most write queries
    –   .REPLICAS_SAFE for non idempotent queries that are costly to
        recompute
●   Do you feel lucky punk?
    –   Reactive Mongo
         ●   Asynchronous & Non-Blocking Scala Driver for MongoDB
    –   Brings the best of WriteConcern.SAFE and WriteConcern.NORMAL




                                                           (c) Alex Giamas, Persado Inc, All rights reserved
Replication and High Availability Take aways

●   Use delayed members
●   Size your oplog
●   Use writeconcern and readpreference to balance between
    providing fresh data and overloading servers
●   Failover happens automagically but not instantaneously
●   Think your security model




                                               (c) Alex Giamas, Persado Inc, All rights reserved
Replication and High Availability Take aways

●   More important: Think who has access to your systems.
    –   No commit, no rollback
●   Prepare people for change
    –   Educate non engineers
    –   Use morphia




                                              (c) Alex Giamas, Persado Inc, All rights reserved
Replication and High Availability Take aways

●   Audit – audit – audit
    –   Monitor closely your MongoDB servers for potential bottlenecks
         ●   mms.10gen.com great tool to do so
    –   Github is your friend:
         ●   https://github.com/mongolab/dex




                                                       (c) Alex Giamas, Persado Inc, All rights reserved
Q&A

      Ask me anything...
      or drop me a line:
 alexandergiamas@yahoo.com
alexandros.giamas@persado.com




                           (c) Alex Giamas, Persado Inc, All rights reserved

Más contenido relacionado

La actualidad más candente

Achieving the ultimate performance with KVM
Achieving the ultimate performance with KVMAchieving the ultimate performance with KVM
Achieving the ultimate performance with KVMStorPool Storage
 
Postgresql for Alfresco: The practical guide
Postgresql for Alfresco: The practical guidePostgresql for Alfresco: The practical guide
Postgresql for Alfresco: The practical guidethijslemmens
 
Understanding Apache Kafka P99 Latency at Scale
Understanding Apache Kafka P99 Latency at ScaleUnderstanding Apache Kafka P99 Latency at Scale
Understanding Apache Kafka P99 Latency at ScaleScyllaDB
 
High-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uringHigh-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uringScyllaDB
 
Trying and evaluating the new features of GlusterFS 3.5
Trying and evaluating the new features of GlusterFS 3.5Trying and evaluating the new features of GlusterFS 3.5
Trying and evaluating the new features of GlusterFS 3.5Keisuke Takahashi
 
Glauber Costa on OSv as NoSQL platform
Glauber Costa on OSv as NoSQL platformGlauber Costa on OSv as NoSQL platform
Glauber Costa on OSv as NoSQL platformDon Marti
 
What every data programmer needs to know about disks
What every data programmer needs to know about disksWhat every data programmer needs to know about disks
What every data programmer needs to know about disksiammutex
 
Antonios Giannopoulos Percona 2016 WiredTiger Configuration Variables
Antonios Giannopoulos Percona 2016 WiredTiger Configuration VariablesAntonios Giannopoulos Percona 2016 WiredTiger Configuration Variables
Antonios Giannopoulos Percona 2016 WiredTiger Configuration VariablesAntonios Giannopoulos
 
JVM and Garbage Collection Tuning
JVM and Garbage Collection TuningJVM and Garbage Collection Tuning
JVM and Garbage Collection TuningKai Koenig
 
Ceph Day Beijing - Ceph RDMA Update
Ceph Day Beijing - Ceph RDMA UpdateCeph Day Beijing - Ceph RDMA Update
Ceph Day Beijing - Ceph RDMA UpdateDanielle Womboldt
 
Automatic Operation Bot for Ceph - You Ji
Automatic Operation Bot for Ceph - You JiAutomatic Operation Bot for Ceph - You Ji
Automatic Operation Bot for Ceph - You JiCeph Community
 
Application Caching: The Hidden Microservice (SAConf)
Application Caching: The Hidden Microservice (SAConf)Application Caching: The Hidden Microservice (SAConf)
Application Caching: The Hidden Microservice (SAConf)Scott Mansfield
 
リニア放送型動画サービスの 
Web フロントエンド
リニア放送型動画サービスの 
Web フロントエンドリニア放送型動画サービスの 
Web フロントエンド
リニア放送型動画サービスの 
Web フロントエンドYusuke Goto
 
Efficient kernel backporting
Efficient kernel backportingEfficient kernel backporting
Efficient kernel backportingLF Events
 
2021.02 new in Ceph Pacific Dashboard
2021.02 new in Ceph Pacific Dashboard2021.02 new in Ceph Pacific Dashboard
2021.02 new in Ceph Pacific DashboardCeph Community
 

La actualidad más candente (20)

Redis Persistence
Redis  PersistenceRedis  Persistence
Redis Persistence
 
Achieving the ultimate performance with KVM
Achieving the ultimate performance with KVMAchieving the ultimate performance with KVM
Achieving the ultimate performance with KVM
 
JavaOne summary
JavaOne summaryJavaOne summary
JavaOne summary
 
Postgresql for Alfresco: The practical guide
Postgresql for Alfresco: The practical guidePostgresql for Alfresco: The practical guide
Postgresql for Alfresco: The practical guide
 
Understanding Apache Kafka P99 Latency at Scale
Understanding Apache Kafka P99 Latency at ScaleUnderstanding Apache Kafka P99 Latency at Scale
Understanding Apache Kafka P99 Latency at Scale
 
High-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uringHigh-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uring
 
Basics of JVM Tuning
Basics of JVM TuningBasics of JVM Tuning
Basics of JVM Tuning
 
Trying and evaluating the new features of GlusterFS 3.5
Trying and evaluating the new features of GlusterFS 3.5Trying and evaluating the new features of GlusterFS 3.5
Trying and evaluating the new features of GlusterFS 3.5
 
MySQL Head-to-Head
MySQL Head-to-HeadMySQL Head-to-Head
MySQL Head-to-Head
 
Glauber Costa on OSv as NoSQL platform
Glauber Costa on OSv as NoSQL platformGlauber Costa on OSv as NoSQL platform
Glauber Costa on OSv as NoSQL platform
 
What every data programmer needs to know about disks
What every data programmer needs to know about disksWhat every data programmer needs to know about disks
What every data programmer needs to know about disks
 
EVCache & Moneta (GoSF)
EVCache & Moneta (GoSF)EVCache & Moneta (GoSF)
EVCache & Moneta (GoSF)
 
Antonios Giannopoulos Percona 2016 WiredTiger Configuration Variables
Antonios Giannopoulos Percona 2016 WiredTiger Configuration VariablesAntonios Giannopoulos Percona 2016 WiredTiger Configuration Variables
Antonios Giannopoulos Percona 2016 WiredTiger Configuration Variables
 
JVM and Garbage Collection Tuning
JVM and Garbage Collection TuningJVM and Garbage Collection Tuning
JVM and Garbage Collection Tuning
 
Ceph Day Beijing - Ceph RDMA Update
Ceph Day Beijing - Ceph RDMA UpdateCeph Day Beijing - Ceph RDMA Update
Ceph Day Beijing - Ceph RDMA Update
 
Automatic Operation Bot for Ceph - You Ji
Automatic Operation Bot for Ceph - You JiAutomatic Operation Bot for Ceph - You Ji
Automatic Operation Bot for Ceph - You Ji
 
Application Caching: The Hidden Microservice (SAConf)
Application Caching: The Hidden Microservice (SAConf)Application Caching: The Hidden Microservice (SAConf)
Application Caching: The Hidden Microservice (SAConf)
 
リニア放送型動画サービスの 
Web フロントエンド
リニア放送型動画サービスの 
Web フロントエンドリニア放送型動画サービスの 
Web フロントエンド
リニア放送型動画サービスの 
Web フロントエンド
 
Efficient kernel backporting
Efficient kernel backportingEfficient kernel backporting
Efficient kernel backporting
 
2021.02 new in Ceph Pacific Dashboard
2021.02 new in Ceph Pacific Dashboard2021.02 new in Ceph Pacific Dashboard
2021.02 new in Ceph Pacific Dashboard
 

Destacado

20160821 coscup-my sql57docstorelab01
20160821 coscup-my sql57docstorelab0120160821 coscup-my sql57docstorelab01
20160821 coscup-my sql57docstorelab01Ivan Ma
 
20161029 py con-mysq-lv3
20161029 py con-mysq-lv320161029 py con-mysq-lv3
20161029 py con-mysq-lv3Ivan Ma
 
Hkosc group replication-lecture_lab07
Hkosc group replication-lecture_lab07Hkosc group replication-lecture_lab07
Hkosc group replication-lecture_lab07Ivan Ma
 
MySQL Parallel Replication: inventory, use-cases and limitations
MySQL Parallel Replication: inventory, use-cases and limitationsMySQL Parallel Replication: inventory, use-cases and limitations
MySQL Parallel Replication: inventory, use-cases and limitationsJean-François Gagné
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group ReplicationBogdan Kecman
 
MySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitationsMySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitationsJean-François Gagné
 
MySQL High Availability with Group Replication
MySQL High Availability with Group ReplicationMySQL High Availability with Group Replication
MySQL High Availability with Group ReplicationNuno Carvalho
 
MySQL Group Replicatio in a nutshell - MySQL InnoDB Cluster
MySQL Group Replicatio  in a nutshell - MySQL InnoDB ClusterMySQL Group Replicatio  in a nutshell - MySQL InnoDB Cluster
MySQL Group Replicatio in a nutshell - MySQL InnoDB ClusterFrederic Descamps
 
MySQL Group Replication - an Overview
MySQL Group Replication - an OverviewMySQL Group Replication - an Overview
MySQL Group Replication - an OverviewMatt Lord
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group ReplicationUlf Wendel
 

Destacado (10)

20160821 coscup-my sql57docstorelab01
20160821 coscup-my sql57docstorelab0120160821 coscup-my sql57docstorelab01
20160821 coscup-my sql57docstorelab01
 
20161029 py con-mysq-lv3
20161029 py con-mysq-lv320161029 py con-mysq-lv3
20161029 py con-mysq-lv3
 
Hkosc group replication-lecture_lab07
Hkosc group replication-lecture_lab07Hkosc group replication-lecture_lab07
Hkosc group replication-lecture_lab07
 
MySQL Parallel Replication: inventory, use-cases and limitations
MySQL Parallel Replication: inventory, use-cases and limitationsMySQL Parallel Replication: inventory, use-cases and limitations
MySQL Parallel Replication: inventory, use-cases and limitations
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
 
MySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitationsMySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitations
 
MySQL High Availability with Group Replication
MySQL High Availability with Group ReplicationMySQL High Availability with Group Replication
MySQL High Availability with Group Replication
 
MySQL Group Replicatio in a nutshell - MySQL InnoDB Cluster
MySQL Group Replicatio  in a nutshell - MySQL InnoDB ClusterMySQL Group Replicatio  in a nutshell - MySQL InnoDB Cluster
MySQL Group Replicatio in a nutshell - MySQL InnoDB Cluster
 
MySQL Group Replication - an Overview
MySQL Group Replication - an OverviewMySQL Group Replication - an Overview
MySQL Group Replication - an Overview
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
 

Similar a Mongo DB Athens user group replication and high availability

Red Hat Gluster Storage Performance
Red Hat Gluster Storage PerformanceRed Hat Gluster Storage Performance
Red Hat Gluster Storage PerformanceRed_Hat_Storage
 
Announcing Amazon Aurora with PostgreSQL Compatibility - January 2017 AWS Onl...
Announcing Amazon Aurora with PostgreSQL Compatibility - January 2017 AWS Onl...Announcing Amazon Aurora with PostgreSQL Compatibility - January 2017 AWS Onl...
Announcing Amazon Aurora with PostgreSQL Compatibility - January 2017 AWS Onl...Amazon Web Services
 
CASSANDRA MEETUP - Choosing the right cloud instances for success
CASSANDRA MEETUP - Choosing the right cloud instances for successCASSANDRA MEETUP - Choosing the right cloud instances for success
CASSANDRA MEETUP - Choosing the right cloud instances for successErick Ramirez
 
DAT340_Hands-On Journey for Migrating Oracle Databases to the Amazon Aurora P...
DAT340_Hands-On Journey for Migrating Oracle Databases to the Amazon Aurora P...DAT340_Hands-On Journey for Migrating Oracle Databases to the Amazon Aurora P...
DAT340_Hands-On Journey for Migrating Oracle Databases to the Amazon Aurora P...Amazon Web Services
 
How to Upgrade Major Version of Your Production PostgreSQL
How to Upgrade Major Version of Your Production PostgreSQLHow to Upgrade Major Version of Your Production PostgreSQL
How to Upgrade Major Version of Your Production PostgreSQLKeisuke Suzuki
 
Amazon Aurora Storage Demystified: How It All Works (DAT363) - AWS re:Invent ...
Amazon Aurora Storage Demystified: How It All Works (DAT363) - AWS re:Invent ...Amazon Aurora Storage Demystified: How It All Works (DAT363) - AWS re:Invent ...
Amazon Aurora Storage Demystified: How It All Works (DAT363) - AWS re:Invent ...Amazon Web Services
 
Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2aspyker
 
Introducing Amazon Aurora with PostgreSQL Compatibility - AWS Online Tech Talks
Introducing Amazon Aurora with PostgreSQL Compatibility - AWS Online Tech TalksIntroducing Amazon Aurora with PostgreSQL Compatibility - AWS Online Tech Talks
Introducing Amazon Aurora with PostgreSQL Compatibility - AWS Online Tech TalksAmazon Web Services
 
PGConf APAC 2018 - PostgreSQL performance comparison in various clouds
PGConf APAC 2018 - PostgreSQL performance comparison in various cloudsPGConf APAC 2018 - PostgreSQL performance comparison in various clouds
PGConf APAC 2018 - PostgreSQL performance comparison in various cloudsPGConf APAC
 
SRV407 Deep Dive on Amazon Aurora
SRV407 Deep Dive on Amazon AuroraSRV407 Deep Dive on Amazon Aurora
SRV407 Deep Dive on Amazon AuroraAmazon Web Services
 
Report from the Field on the PostgreSQL-compatible Edition of Amazon Aurora -...
Report from the Field on the PostgreSQL-compatible Edition of Amazon Aurora -...Report from the Field on the PostgreSQL-compatible Edition of Amazon Aurora -...
Report from the Field on the PostgreSQL-compatible Edition of Amazon Aurora -...Amazon Web Services
 
DAT316_Report from the field on Aurora PostgreSQL Performance
DAT316_Report from the field on Aurora PostgreSQL PerformanceDAT316_Report from the field on Aurora PostgreSQL Performance
DAT316_Report from the field on Aurora PostgreSQL PerformanceAmazon Web Services
 
Build on Amazon Aurora with MySQL Compatibility (DAT348-R4) - AWS re:Invent 2018
Build on Amazon Aurora with MySQL Compatibility (DAT348-R4) - AWS re:Invent 2018Build on Amazon Aurora with MySQL Compatibility (DAT348-R4) - AWS re:Invent 2018
Build on Amazon Aurora with MySQL Compatibility (DAT348-R4) - AWS re:Invent 2018Amazon Web Services
 
NEW LAUNCH! Introducing PostgreSQL compatibility for Amazon Aurora
NEW LAUNCH! Introducing PostgreSQL compatibility for Amazon AuroraNEW LAUNCH! Introducing PostgreSQL compatibility for Amazon Aurora
NEW LAUNCH! Introducing PostgreSQL compatibility for Amazon AuroraAmazon Web Services
 
To Serverless and Beyond
To Serverless and BeyondTo Serverless and Beyond
To Serverless and BeyondScyllaDB
 
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...Amazon Web Services
 

Similar a Mongo DB Athens user group replication and high availability (20)

Shootout at the AWS Corral
Shootout at the AWS CorralShootout at the AWS Corral
Shootout at the AWS Corral
 
AWS Graviton3 and GP3
AWS Graviton3 and GP3AWS Graviton3 and GP3
AWS Graviton3 and GP3
 
Red Hat Gluster Storage Performance
Red Hat Gluster Storage PerformanceRed Hat Gluster Storage Performance
Red Hat Gluster Storage Performance
 
Announcing Amazon Aurora with PostgreSQL Compatibility - January 2017 AWS Onl...
Announcing Amazon Aurora with PostgreSQL Compatibility - January 2017 AWS Onl...Announcing Amazon Aurora with PostgreSQL Compatibility - January 2017 AWS Onl...
Announcing Amazon Aurora with PostgreSQL Compatibility - January 2017 AWS Onl...
 
CASSANDRA MEETUP - Choosing the right cloud instances for success
CASSANDRA MEETUP - Choosing the right cloud instances for successCASSANDRA MEETUP - Choosing the right cloud instances for success
CASSANDRA MEETUP - Choosing the right cloud instances for success
 
DAT340_Hands-On Journey for Migrating Oracle Databases to the Amazon Aurora P...
DAT340_Hands-On Journey for Migrating Oracle Databases to the Amazon Aurora P...DAT340_Hands-On Journey for Migrating Oracle Databases to the Amazon Aurora P...
DAT340_Hands-On Journey for Migrating Oracle Databases to the Amazon Aurora P...
 
How to Upgrade Major Version of Your Production PostgreSQL
How to Upgrade Major Version of Your Production PostgreSQLHow to Upgrade Major Version of Your Production PostgreSQL
How to Upgrade Major Version of Your Production PostgreSQL
 
Amazon Aurora Storage Demystified: How It All Works (DAT363) - AWS re:Invent ...
Amazon Aurora Storage Demystified: How It All Works (DAT363) - AWS re:Invent ...Amazon Aurora Storage Demystified: How It All Works (DAT363) - AWS re:Invent ...
Amazon Aurora Storage Demystified: How It All Works (DAT363) - AWS re:Invent ...
 
Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2
 
Amazon Aurora 深度探討
Amazon Aurora 深度探討Amazon Aurora 深度探討
Amazon Aurora 深度探討
 
Introducing Amazon Aurora with PostgreSQL Compatibility - AWS Online Tech Talks
Introducing Amazon Aurora with PostgreSQL Compatibility - AWS Online Tech TalksIntroducing Amazon Aurora with PostgreSQL Compatibility - AWS Online Tech Talks
Introducing Amazon Aurora with PostgreSQL Compatibility - AWS Online Tech Talks
 
PGConf APAC 2018 - PostgreSQL performance comparison in various clouds
PGConf APAC 2018 - PostgreSQL performance comparison in various cloudsPGConf APAC 2018 - PostgreSQL performance comparison in various clouds
PGConf APAC 2018 - PostgreSQL performance comparison in various clouds
 
SRV407 Deep Dive on Amazon Aurora
SRV407 Deep Dive on Amazon AuroraSRV407 Deep Dive on Amazon Aurora
SRV407 Deep Dive on Amazon Aurora
 
Shootout at the PAAS Corral
Shootout at the PAAS CorralShootout at the PAAS Corral
Shootout at the PAAS Corral
 
Report from the Field on the PostgreSQL-compatible Edition of Amazon Aurora -...
Report from the Field on the PostgreSQL-compatible Edition of Amazon Aurora -...Report from the Field on the PostgreSQL-compatible Edition of Amazon Aurora -...
Report from the Field on the PostgreSQL-compatible Edition of Amazon Aurora -...
 
DAT316_Report from the field on Aurora PostgreSQL Performance
DAT316_Report from the field on Aurora PostgreSQL PerformanceDAT316_Report from the field on Aurora PostgreSQL Performance
DAT316_Report from the field on Aurora PostgreSQL Performance
 
Build on Amazon Aurora with MySQL Compatibility (DAT348-R4) - AWS re:Invent 2018
Build on Amazon Aurora with MySQL Compatibility (DAT348-R4) - AWS re:Invent 2018Build on Amazon Aurora with MySQL Compatibility (DAT348-R4) - AWS re:Invent 2018
Build on Amazon Aurora with MySQL Compatibility (DAT348-R4) - AWS re:Invent 2018
 
NEW LAUNCH! Introducing PostgreSQL compatibility for Amazon Aurora
NEW LAUNCH! Introducing PostgreSQL compatibility for Amazon AuroraNEW LAUNCH! Introducing PostgreSQL compatibility for Amazon Aurora
NEW LAUNCH! Introducing PostgreSQL compatibility for Amazon Aurora
 
To Serverless and Beyond
To Serverless and BeyondTo Serverless and Beyond
To Serverless and Beyond
 
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
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 CVKhem
 
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...Enterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
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?Antenna Manufacturer Coco
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
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?Igalia
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
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...apidays
 
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 2024The Digital Insurer
 
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 RobisonAnna Loughnan Colquhoun
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Último (20)

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
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
 
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...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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?
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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?
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

Mongo DB Athens user group replication and high availability

  • 1. Replication and High Availability MongoDB Athens User Group Athens, Greece 16/1/2013 Alex Giamas alexandergiamas@yahoo.com
  • 2. History ● Oracle shop ● Non existent OLAP ● Queries in live DB (c) Alex Giamas, Persado Inc, All rights reserved
  • 3. Initial investigation ● CouchDB ● Riak ● Hbase ● Cassandra ● MongoDB ● Voldemort (c) Alex Giamas, Persado Inc, All rights reserved
  • 4. History ● Missed all the fun while being in the States ● Hadoop / HBase / llama / Pig ● Sharded MySQL ● Voldemort ● Huge RAC deployments ● Following MongoDB since 1.4 (Replica sets? Nah.. Sharding?..alpha)
  • 5. Reporting and Analytics ● Settled on MongoDB ● Document oriented ● No clue about schema at the time ● No clue about what are we going to do with client data (c) Alex Giamas, Persado Inc, All rights reserved
  • 6. Prototyping, version 0.5 ● MT, MO, User collections ● Sync Map Reduce for reporting ● One DB to rule them all (c) Alex Giamas, Persado Inc, All rights reserved
  • 7. Show stoppers ● Single server deployment ● Global write lock ● MR in real time (c) Alex Giamas, Persado Inc, All rights reserved
  • 8. Results ● Demo Christmas Eve 2010 (c) Alex Giamas, Persado Inc, All rights reserved
  • 9. Results ● Demo Christmas Eve 2010 ● Slow.... (c) Alex Giamas, Persado Inc, All rights reserved
  • 10. Reporting, version 1.0 ● Spring Batch for async computations ● Quartz scheduler firing every 3 minutes ● Separate nodes for OLTP and OLAP Dbs ● Custom cloneCollection() (c) Alex Giamas, Persado Inc, All rights reserved
  • 11. Real world kicks in ● Everything designed for online integration ● Huge client coming in offering offline integration ● Ride the cloud wagon! (c) Alex Giamas, Persado Inc, All rights reserved
  • 12. Reporting Version 2 (the real world) ● Files coming in via FTP containing all sorts of time inconsistencies ● No longer a linear timeline of events, more like a soup of results (c) Alex Giamas, Persado Inc, All rights reserved
  • 13. MongoDB on EC2 ● 2 replica sets of 2 nodes+arb ● Arbiters crossed wrt replica sets ● Third node could be different availability zone (c) Alex Giamas, Persado Inc, All rights reserved
  • 14. Replica Sets Configuration (c) Alex Giamas, Persado Inc, All rights reserved
  • 15. Replica Sets Configuration “server seen down” (c) Alex Giamas, Persado Inc, All rights reserved
  • 16. Replica Sets Configuration “server seen down” (c) Alex Giamas, Persado Inc, All rights reserved
  • 17. Replica Sets Configuration ● Can afford 1 failure with fully functional cluster ● Can afford 2 failures with partially functional cluster** ** Terms and conditions may apply (c) Alex Giamas, Persado Inc, All rights reserved
  • 18. Replica Sets Configuration ● Rolling upgrades without DB downtime ● Schemaless, document oriented offers great flexibility in application terms (c) Alex Giamas, Persado Inc, All rights reserved
  • 19. Replica Sets Configuration ● Unix level tweaks: – raise ulimit – raise tcp timeout – Noatime nodiratime – XFS, ext4 – LVM for snapshotting ● Mongo level tips: – Use journaling. USE JOURNALING (c) Alex Giamas, Persado Inc, All rights reserved
  • 20. Replica Sets Configuration EC2 specific tips: – Can and will steal back time, plan for it – Can get flaky at times.. – Design around EBS (c) Alex Giamas, Persado Inc, All rights reserved
  • 21. Replica Sets Configuration ● EC2 storage: – Local storage. Ephemeral – EBS storage. Lasts but not strong durability guarantees. – S3 storage. Lasts more, slower (c) Alex Giamas, Persado Inc, All rights reserved
  • 22. Replica Sets Configuration ● Settled for EBS storage. ● Nightly backups, 30 day window (c) Alex Giamas, Persado Inc, All rights reserved
  • 23. Reporting Version 3 ● Aggregation Framework effort led by Chris Westin – Simpler way to perform Map Reduce jobs without all the pain of JS – Integrates cleanly with our business logic ● Initial design on sharding – More on that next.. (c) Alex Giamas, Persado Inc, All rights reserved
  • 24. Reporting Version 3 ● Aggregation framework for both storing and retrieving aggregate data – New collection for double checking results with MR. ● Faster, simpler, most of the times fits in our problem domain. ● Worked better in dev than production versions ;) (c) Alex Giamas, Persado Inc, All rights reserved
  • 25. Reporting Version 3 ● More fine grained write semantics. – WriteConcern.SAFE for most write queries – .REPLICAS_SAFE for non idempotent queries that are costly to recompute ● Do you feel lucky punk? – Reactive Mongo ● Asynchronous & Non-Blocking Scala Driver for MongoDB – Brings the best of WriteConcern.SAFE and WriteConcern.NORMAL (c) Alex Giamas, Persado Inc, All rights reserved
  • 26. Replication and High Availability Take aways ● Use delayed members ● Size your oplog ● Use writeconcern and readpreference to balance between providing fresh data and overloading servers ● Failover happens automagically but not instantaneously ● Think your security model (c) Alex Giamas, Persado Inc, All rights reserved
  • 27. Replication and High Availability Take aways ● More important: Think who has access to your systems. – No commit, no rollback ● Prepare people for change – Educate non engineers – Use morphia (c) Alex Giamas, Persado Inc, All rights reserved
  • 28. Replication and High Availability Take aways ● Audit – audit – audit – Monitor closely your MongoDB servers for potential bottlenecks ● mms.10gen.com great tool to do so – Github is your friend: ● https://github.com/mongolab/dex (c) Alex Giamas, Persado Inc, All rights reserved
  • 29. Q&A Ask me anything... or drop me a line: alexandergiamas@yahoo.com alexandros.giamas@persado.com (c) Alex Giamas, Persado Inc, All rights reserved

Notas del editor

  1. Single server deployment really fast for OLTP, would block in OLAP queries, blocking the whole server
  2. falling asleep during demo @ dashboard view...
  3. - Arbitrarily chosen to be 3 minutes - avoid write lock, give MR the computational resources it needs without affecting OLTP - cloneCollection() didn't support many of the features we needed back then, i.e. Custom business logic to clone and update target doc
  4. Fought my way through the third node
  5. If having 3 data nodes, you can have read only cluster If 2 nodes and 1 arbiter then you can only afford to lose one node + arbiter (obviously)
  6. (actually 0% unplanned downtime in the 1+ year operating the cluster ) Caveat: indexing in dynamic fields not possible, need to plan ahead if you will need to index these fields
  7. LVM for snapshotting : you may or may not need fsync+lock
  8. Because of low I/O esp at small/medium machines. Use LVM with RAID 0
  9. https://docs.google.com/drawings/d/1SQ-LaMJjHo3DHlYun43a1H1M4eA-75ZyZBHb5gbxY2Q/edit
  10. 30 days is pretty much the billing period
  11. old colleague
  12. Mention the whole $isoDate mess that was dropped between dev and production versions. Explaion odd vs even numbered versioning.
  13. Delayed members can save you from screwups such as db.drop() when you think you are in the default 'test' db but you are in fact in the production DB. Oplog is 5% by default max(5%, 1G). You may need less or more than that. 20-30 secs for failover to happen using Java driver.