Exploring the replication in MongoDB. Date: Oct

Similar documents
How to Scale MongoDB. Apr

MongoDB: Replica Sets and Sharded Cluster. Monday, November 5, :30 AM - 5:00 PM - Bull

MySQL Replication. Rick Golba and Stephane Combaudon April 15, 2015

Become a MongoDB Replica Set Expert in Under 5 Minutes:

Scaling MongoDB. Percona Webinar - Wed October 18th 11:00 AM PDT Adamo Tonete MongoDB Senior Service Technical Service Engineer.

Reduce MongoDB Data Size. Steven Wang

Working with MongoDB as MySQL DBA. Date: Oct

The course modules of MongoDB developer and administrator online certification training:

MongoDB Distributed Write and Read

MongoDB Backup & Recovery Field Guide

MongoDB. David Murphy MongoDB Practice Manager, Percona

VMWARE VREALIZE OPERATIONS MANAGEMENT PACK FOR. MongoDB. User Guide

MONGODB INTERVIEW QUESTIONS

MySQL High Availability. Michael Messina Senior Managing Consultant, Rolta-AdvizeX /

Course Content MongoDB

MongoDB Architecture

Scaling MongoDB: Avoiding Common Pitfalls. Jon Tobin Senior Systems

Choosing a MySQL High Availability Solution. Marcos Albe, Percona Inc. Live Webinar June 2017

~3333 write ops/s ms response

MySQL High Availability Solutions. Alex Poritskiy Percona

What s new in Mongo 4.0. Vinicius Grippa Percona

Percona XtraDB Cluster

Why Do Developers Prefer MongoDB?

Scaling with mongodb

NoSQL Databases MongoDB vs Cassandra. Kenny Huynh, Andre Chik, Kevin Vu

MongoDB Backup and Recovery Field Guide. Tim Vaillancourt Sr Technical Operations Architect, Percona

MongoDB. copyright 2011 Trainologic LTD

Running MongoDB in Production, Part I

API Gateway 8.0 Multi-Regional Deployment

MongoDB: Comparing WiredTiger In-Memory Engine to Redis. Jason Terpko DBA, Rackspace/ObjectRocket 1

Overview. CPS Architecture Overview. Operations, Administration and Management (OAM) CPS Architecture Overview, page 1 Geographic Redundancy, page 5

Various MySQL High Availability (HA) Solutions

Plug-in Configuration

MongoDB Monitoring and Performance for The Savvy DBA

Performance comparisons and trade-offs for various MySQL replication schemes

SQL, NoSQL, MongoDB. CSE-291 (Cloud Computing) Fall 2016 Gregory Kesden

The Hazards of Multi-writing in a Dual-Master Setup

Mike Kania Truss

MySQL High Availability

MySQL HA Solutions Selecting the best approach to protect access to your data

EMC RecoverPoint. EMC RecoverPoint Support

GR Reference Models. GR Reference Models. Without Session Replication

MySQL Group Replication. Bogdan Kecman MySQL Principal Technical Engineer

MySQL Replication Advanced Features In 20 minutes

MySQL Replication Options. Peter Zaitsev, CEO, Percona Moscow MySQL User Meetup Moscow,Russia

Percona Live Santa Clara, California April 24th 27th, 2017

Future-Proofing MySQL for the Worldwide Data Revolution

MongoDB Shell: A Primer

MMS Backup Manual Release 1.4

MySQL Replication Update

Choosing a MySQL HA Solution Today. Choosing the best solution among a myriad of options

Mix n Match Async and Group Replication for Advanced Replication Setups. Pedro Gomes Software Engineer

Document Sub Title. Yotpo. Technical Overview 07/18/ Yotpo

MySQL usage of web applications from 1 user to 100 million. Peter Boros RAMP conference 2013

Chapter 24 NOSQL Databases and Big Data Storage Systems

Group13: Siddhant Deshmukh, Sudeep Rege, Sharmila Prakash, Dhanusha Varik

MySQL HA Solutions. Keeping it simple, kinda! By: Chris Schneider MySQL Architect Ning.com

Basic vs. Reliable Multicast

MongoDB and Mysql: Which one is a better fit for me? Room 204-2:20PM-3:10PM

FromDual Annual Company Meeting

MySQL HA vs. HA. DOAG Konferenz 2016, Nürnberg. Oli Sennhauser. Senior MySQL Consultant, FromDual GmbH.

Percona XtraDB Cluster MySQL Scaling and High Availability with PXC 5.7 Tibor Korocz

Distributed Coordination with ZooKeeper - Theory and Practice. Simon Tao EMC Labs of China Oct. 24th, 2015

Everything You Need to Know About MySQL Group Replication

Jailbreaking MySQL Replication Featuring Tungsten Replicator. Robert Hodges, CEO, Continuent

Distributed Data Management Replication

Plug-in Configuration

MySQL Cluster Ed 2. Duration: 4 Days

Which technology to choose in AWS?

<Insert Picture Here> MySQL Web Reference Architectures Building Massively Scalable Web Infrastructure

MySQL Architecture Design Patterns for Performance, Scalability, and Availability

Migrating to XtraDB Cluster 2014 Edition

Microsoft SQL AlwaysOn and High Availability

HA for OpenStack: Connecting the dots

How Facebook Got Consistency with MySQL in the Cloud Sam Dunster

April 21, 2017 Revision GridDB Reliability and Robustness

Optimizing BOINC project databases

Scaling for Humongous amounts of data with MongoDB

Lessons from database failures

Introduction to MySQL InnoDB Cluster

High availability with MariaDB TX: The definitive guide

Galera in MariaDB 10.4 State of the Art and Plans

What s new in Percona Xtradb Cluster 5.6. Jay Janssen Lead Consultant February 5th, 2014

GridDB Technical Design Document Version 1.0

Run your own Open source. (MMS) to avoid vendor lock-in. David Murphy MongoDB Practice Manager, Percona

BERLIN. 2015, Amazon Web Services, Inc. or its affiliates. All rights reserved

How to make MySQL work with Raft. Diancheng Wang & Guangchao Bai Staff Database Alibaba Cloud

Custom Reference Data REST API

Jargons, Concepts, Scope and Systems. Key Value Stores, Document Stores, Extensible Record Stores. Overview of different scalable relational systems

Highly Available Database Architectures in AWS. Santa Clara, California April 23th 25th, 2018 Mike Benshoof, Technical Account Manager, Percona

1 Copyright 2011, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 8

High Noon at AWS. ~ Amazon MySQL RDS versus Tungsten Clustering running MySQL on AWS EC2

How to evaluate which MySQL High Availability solution best suits you

MySQL Architecture Options:

High Availability Solutions for the MySQL Database

Microsoft SQL AlwaysOn and High Availability

MySQL Cluster Web Scalability, % Availability. Andrew

A Guide to Architecting the Active/Active Data Center

AWS_SOA-C00 Exam. Volume: 758 Questions

What s New in MySQL 5.7 Geir Høydalsvik, Sr. Director, MySQL Engineering. Copyright 2015, Oracle and/or its affiliates. All rights reserved.

Transcription:

Exploring the replication in MongoDB Date: Oct-4-2016

About us Database Consultant @Pythian OSDB managed services since 2014 Lead Database Consultant @Pythian OSDB managed services since 2014 https://tr.linkedin.com/in/okanbuyukyilmaz https://mk.linkedin.com/in/igorle @igorle

Overview Why Replication, replication definition How replication works, replication concepts Replica set features, deployment architectures Replica set configuration options Key metrics to monitor when running replica set MySQL replication compared to MongoDB replication Galera replication compared to MongoDB replication

Definition Group of mongod processes that maintain the same data set Redundancy and high availability Increased read capacity

Replication concept Write operations go to the Primary node All changes are recorded into operations log - oplog Asynchronous replication Secondaries replicate the Primary oplog Secondary can use sync source other Secondary One Arbiter node per replica set Automatic failover. Any node can become Primary

Replication concept

Replica set oplog Special capped collection that keeps a rolling record of all operations that modify the data stored in the databases Idempotent Default oplog size For Unix and Windows systems Storage Engine Default Oplog Size Lower Bound Upper Bound In-memory 5% of physical memory 50MB 50GB WiredTiger 5% of free disk space 990MB 50GB MMAPv1 5% of free disk space 990MB 50GB

Replica set oplog Workloads that might require larger oplog size updates to multiple documents at once Deletions equal the same amount of data as inserts Significant number of in-place updates Oplog status rs.printreplicationinfo() - on a Secondary node rs.printslavereplicationinfo() - on a Primary node db.getreplicationinfo() - by using the local database

Deployment MongoDB configuration file: /etc/mongod.conf Before MongoDB 3.0 replset=myrepl oplogsize=4096mb YAML format since 3.0 replication: replsetname: MyRepl oplogsizemb: 4096

Deployment 3 node replica set Node1 Node2 Node3

Deployment Node1 /usr/bin/mongod -f mongod.conf > rs.initialize() Primary Node2 Node3

Deployment rs.add() rs.add( node2:27017 ) Node3

Deployment rs.add() rs.add( node3:27017 )

Replica set maintenance rs.status() rs.conf() rs.reconfig() rs.remove() rs.stepdown() rs.freeze() rs.ismaster() rs.syncfrom() rs.printreplicationinfo() rs.printslavereplicationinfo()

Configuration options 50 members per replica set (7 voting members) Arbiter node Hidden node Priority 0 node Delayed node Build indexes Fault tolerance Write concern Read preference

Configuration options rstest:primary> rs.conf() { "_id" : "rstest", "version" : 2, "members" : [ { "_id" : 0, "host" : "node1:27017", "arbiteronly" : false, "buildindexes" : true, "hidden" : false, "priority" : 1, "tags" : {"dc" : "apac"}, "slavedelay" : 0, "votes" : 1 },

Arbiter node Votes in elections Does not hold copy of data { "_id" : <num> "host" : <hostname:port>, "arbiteronly" : true,. } hidden : true

Hidden node { Never becomes primary Not visible to application Use cases "_id" : <num> reporting backups "host" : <hostname:port>, "priority" : 0, } "hidden" : true hidden : true

Priority 0 node Priority - floating point (i.e. decimal) number between 0 and 1000 Hidden members and Delayed slave with priority 0 by default Never becomes primary Visible to application { "_id" : <num> "host" : <hostname:port>, "priority" : 0 }

Delayed node { } must be priority 0 member should be hidden member (not mandatory) has votes 1 by default considerations (oplog size) mainly used for backups "_id" : <num>, "host" : <hostname:port>, "priority" : 0, "slavedelay" : <seconds>, "hidden" : true

Build indexes members[n].buildindexes : false Can be only set when adding a member to a replica set Can not be changed on running node Indexes on _id will still exist Priority must be set to 0, recommended as hidden:true Useful when Node is used for backups using mongodump Node does not receive queries from clients Adding indexes and maintenance overburdens the host system

Fault tolerance Number of members Majority Required to Elect new Primary Fault Tolerance 3 2 1 4 3 1 5 3 2 6 4 2 7 4 3

Write concern

Write concern Write concern specification { w: <value>, j: <boolean>, wtimeout: <number> } w - number Option for majority j - write operation has been written to the journal wtimeout - time limit, in milliseconds, for the write concern Replica set get write concern setting rstest:primary> rs.conf().settings['getlasterrordefaults'] { "w" : 1, "wtimeout" : 0 }

Read preference primary primarypreferred secondary secondarypreferred nearest

Key metrics to monitor for RS Replica set has no Primary Number of healthy/unhealthy members Replication Oplog Window Replication lag

What is MySQL Mysql is Transactional Relational Well documented Open source

MySQL replication Mysql Replication can be... Asynchronous Built-in replication feature Semi-synchronous by plugin rpl_semi_sync_master Synchronous Galera setup with wsrep api

MySQL replication Group of mysqld processes that maintain the same data set Write operations go to the Master node, reads can go to Slave All changes are recorded into binary log on the master Asynchronous replication, Semi-Synchronous replication Slave node replicates the events by copying binary logs as relay logs IO Thread, SQL Thread Binary Logs format - Statement, Row, Mixed Expire logs days dynamic Replication filters

MySQL replication MySQL Master MySQL Process MySQL Slave MySQL Process IO Thread MySQL Data SQL Thread MySQL Data Binary Logs Relay logs

Questions?

We re Hiring! https://pythian.com