SlideShare a Scribd company logo
1 of 29
Download to read offline
@vparihar

Scalability and High Availability with ReplicaSet
Vivek Parihar
AVP Engineering,Weboinse Lab
Who Am I?
●
●
●
●
●
●

A Weboniser and Rubyist
Blogger(vparihar01.github.com)
MongoDb user
Geek
DevOps
Mainly write Ruby, but have great passion for Javascript
and Cloud Platforms
● ...
Agenda
●
●
●
●
●
●
●

{10: Reasons, To: Love
}
Scalability with
What is Sharding?
What is Replica Set?
Replication Process
Advantaged of Replica Set vs Master/Slave
How to set up replica set on production
{10: Reasons , To: Love
I.RELATIVELY EASY TO SETUP
In simple 3 steps MongoDb is start running on your machine
Step-1. sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
Step-2. sudo apt-get install mongodb-10gen
Step-3. sudo /etc/init.d/mongodb start

}
{10: Reasons , To: Love

}

II.It’s fast
On average

7 times faster
{10: Reasons , To: Love
III. Easy Scalability
{ Does Anyone know about scaling MySql? }

}
{10: Reasons , To: Love
IV. High Availability

}
{10: Reasons , To: Love
V. High Performance

}
{10: Reasons , To: Love
VI. Flexible Schema
{no schema: no problem}

}
{10: Reasons , To: Love MongoDb}
VII. Built in Sharding and Replication
{10: Reasons , To: Love

}

VIII. Courses are excellent to start working as a
developer/DBA with.
{10: Reasons , To: Love

}

IX. Deploy New Instances on Demand
{10: Reasons , To: Love

}

X. BASE Rather Than ACID
ACID

BASE

Atomicity

Basically Available

Consistency

Soft State

Isolation

Eventual Consistency

Durable
Horizontal Scaling Vs Vertical Scaling
Scalability with
●
●
●
●
●
●

Horizontal Scaling
Auto-Sharding
Vertical Scaling
Replica Set
Performance {For: Read, For: Write}
Storage
Horizontal Scaling
● By adding more machines into the existing pool.
● In a database world horizontal-scaling is often based on
partitioning of the data i.e. each node contains only part
of the data.
● MongoDB achieves this through auto-sharding.
Vertical Scaling
● Typically refers to adding more processors ,ram and
storage to a Symmetric Multiple Processing to extend
processing capability.
● In a database world vertical-scaling is done through
multi-core i.e. spreading the load between the CPU and
RAM resources of that machine.
What is Sharding?
● Sharding is a method for storing data across multiple
machines.
● Also known as Horizontal Scaling
● Divides the data set and distributes the data over
multiple servers, or shards.
What is Sharding?
Each shard is an independent database, and collectively,
the shards make up a single logical database.
Sharding offerings:
● Automatic balancing for changes in load and data
distribution
● Easy addition of new machines
● Scaling out to one thousand nodes
● No single points of failure
● Automatic failover
What is Replication?
● Replication is the process of synchronizing data across
multiple servers.
● Mongo achieves Replication through Replica Sets
● Replica sets are a form of asynchronous master/slave
replication
● A replica set consists of two or more nodes that are
copies of each other. (i.e.: replicas)
Purpose of Replication
Data Redundancy
●

Replica sets provide an automated method

for storing multiple copies of your data.
Purpose of Replication
Automated Failover / High Avalability
●

If primary fails then replica set will

attempt to select another member
to become the new primary.
●

This means that the failure of a

primary can be handled by the client
without any configuration changes
●

Use heartbeat signal to detect failure
Purpose of Replication
●

Distributed Read Load/Read Scaling
By default, the primary node of a replica set is accessed for all reads and
writes.

●

Disaster Recovery
Replica sets allows for a “delayed secondary” node.
This node can provide a window for recovering from disastrous
events such as:
○ bad deployments
○ dropped tables and collections
Replication Process
● Members of a replica set replicate data continuously
● MongoDB applies database operations on the primary
and then records the operations on the primary’s oplog.
● All replica set members contain a copy of the oplog,
allowing them to maintain the current state of the
database.
Advantages of Replica Set vs Master/Slave
● Replica sets are basically just master-slave with
automatic failover.
● So, you have a pool of servers with one primary (the
master) and N secondaries (slaves). If the primary
crashes or disappears, the other servers will hold an
election to choose a new primary.
Demo -: How to set up replica set on Production!
Click on below link to see the demo-:

http://youtu.be/BFSGcBHcirU
Thanks
Would Love to answer your queries...
Vivek Parihar
@vparihar

More Related Content

What's hot

Clickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlare
Clickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlareClickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlare
Clickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlareAltinity Ltd
 
Indexing & Query Optimization
Indexing & Query OptimizationIndexing & Query Optimization
Indexing & Query OptimizationMongoDB
 
ReadConcern and WriteConcern
ReadConcern and WriteConcernReadConcern and WriteConcern
ReadConcern and WriteConcernMongoDB
 
Parallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDBParallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDBMydbops
 
MongoDB Performance Tuning
MongoDB Performance TuningMongoDB Performance Tuning
MongoDB Performance TuningPuneet Behl
 
MongoDB at Baidu
MongoDB at BaiduMongoDB at Baidu
MongoDB at BaiduMat Keep
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBRavi Teja
 
MongoDB - Sharded Cluster Tutorial
MongoDB - Sharded Cluster TutorialMongoDB - Sharded Cluster Tutorial
MongoDB - Sharded Cluster TutorialJason Terpko
 
Introducing MongoDB Atlas
Introducing MongoDB AtlasIntroducing MongoDB Atlas
Introducing MongoDB AtlasMongoDB
 
Chapter 5 design of keyvalue databses from nosql for mere mortals
Chapter 5 design of keyvalue databses from nosql for mere mortalsChapter 5 design of keyvalue databses from nosql for mere mortals
Chapter 5 design of keyvalue databses from nosql for mere mortalsnehabsairam
 
Introduction to Cassandra: Replication and Consistency
Introduction to Cassandra: Replication and ConsistencyIntroduction to Cassandra: Replication and Consistency
Introduction to Cassandra: Replication and ConsistencyBenjamin Black
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBNodeXperts
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBMike Dirolf
 
An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDBCésar Trigo
 
Jvm performance tuning
Jvm performance tuningJvm performance tuning
Jvm performance tuningIgor Igoroshka
 

What's hot (20)

Clickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlare
Clickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlareClickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlare
Clickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlare
 
Introduction to Galera Cluster
Introduction to Galera ClusterIntroduction to Galera Cluster
Introduction to Galera Cluster
 
Indexing & Query Optimization
Indexing & Query OptimizationIndexing & Query Optimization
Indexing & Query Optimization
 
ReadConcern and WriteConcern
ReadConcern and WriteConcernReadConcern and WriteConcern
ReadConcern and WriteConcern
 
MongodB Internals
MongodB InternalsMongodB Internals
MongodB Internals
 
Parallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDBParallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDB
 
MongoDB Performance Tuning
MongoDB Performance TuningMongoDB Performance Tuning
MongoDB Performance Tuning
 
MongoDB at Baidu
MongoDB at BaiduMongoDB at Baidu
MongoDB at Baidu
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
MongoDB - Sharded Cluster Tutorial
MongoDB - Sharded Cluster TutorialMongoDB - Sharded Cluster Tutorial
MongoDB - Sharded Cluster Tutorial
 
Introduction to mongodb
Introduction to mongodbIntroduction to mongodb
Introduction to mongodb
 
Introducing MongoDB Atlas
Introducing MongoDB AtlasIntroducing MongoDB Atlas
Introducing MongoDB Atlas
 
Chapter 5 design of keyvalue databses from nosql for mere mortals
Chapter 5 design of keyvalue databses from nosql for mere mortalsChapter 5 design of keyvalue databses from nosql for mere mortals
Chapter 5 design of keyvalue databses from nosql for mere mortals
 
Introduction to Cassandra: Replication and Consistency
Introduction to Cassandra: Replication and ConsistencyIntroduction to Cassandra: Replication and Consistency
Introduction to Cassandra: Replication and Consistency
 
Nosql data models
Nosql data modelsNosql data models
Nosql data models
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Key-Value NoSQL Database
Key-Value NoSQL DatabaseKey-Value NoSQL Database
Key-Value NoSQL Database
 
An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
 
Jvm performance tuning
Jvm performance tuningJvm performance tuning
Jvm performance tuning
 

Similar to MongoDb scalability and high availability with Replica-Set

Evolution of MongoDB Replicaset and Its Best Practices
Evolution of MongoDB Replicaset and Its Best PracticesEvolution of MongoDB Replicaset and Its Best Practices
Evolution of MongoDB Replicaset and Its Best PracticesMydbops
 
Evolution Of MongoDB Replicaset
Evolution Of MongoDB ReplicasetEvolution Of MongoDB Replicaset
Evolution Of MongoDB ReplicasetM Malai
 
Backing up Wikipedia Databases
Backing up Wikipedia DatabasesBacking up Wikipedia Databases
Backing up Wikipedia DatabasesJaime Crespo
 
kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadKrivoy Rog IT Community
 
MongoDB: Advantages of an Open Source NoSQL Database
MongoDB: Advantages of an Open Source NoSQL DatabaseMongoDB: Advantages of an Open Source NoSQL Database
MongoDB: Advantages of an Open Source NoSQL DatabaseFITC
 
Scaling Up with PHP and AWS
Scaling Up with PHP and AWSScaling Up with PHP and AWS
Scaling Up with PHP and AWSHeath Dutton ☕
 
Screaming Fast Wpmu
Screaming Fast WpmuScreaming Fast Wpmu
Screaming Fast Wpmudjcp
 
High performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodbHigh performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodbWei Shan Ang
 
PostgreSQL Sharding and HA: Theory and Practice (PGConf.ASIA 2017)
PostgreSQL Sharding and HA: Theory and Practice (PGConf.ASIA 2017)PostgreSQL Sharding and HA: Theory and Practice (PGConf.ASIA 2017)
PostgreSQL Sharding and HA: Theory and Practice (PGConf.ASIA 2017)Aleksander Alekseev
 
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
 
Pg chameleon, mysql to postgresql replica made easy
Pg chameleon, mysql to postgresql replica made easyPg chameleon, mysql to postgresql replica made easy
Pg chameleon, mysql to postgresql replica made easyFederico Campoli
 
MariaDB Server Performance Tuning & Optimization
MariaDB Server Performance Tuning & OptimizationMariaDB Server Performance Tuning & Optimization
MariaDB Server Performance Tuning & OptimizationMariaDB plc
 
Zero Downtime JEE Architectures
Zero Downtime JEE ArchitecturesZero Downtime JEE Architectures
Zero Downtime JEE ArchitecturesAlexander Penev
 
MySQL's NoSQL -- SCaLE 13x Feb. 20, 2015
MySQL's NoSQL -- SCaLE 13x Feb. 20, 2015MySQL's NoSQL -- SCaLE 13x Feb. 20, 2015
MySQL's NoSQL -- SCaLE 13x Feb. 20, 2015Dave Stokes
 
MySQL Cluster Asynchronous replication (2014)
MySQL Cluster Asynchronous replication (2014) MySQL Cluster Asynchronous replication (2014)
MySQL Cluster Asynchronous replication (2014) Frazer Clement
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialThe Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialJean-François Gagné
 
MySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated EnvironmentMySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated EnvironmentJean-François Gagné
 

Similar to MongoDb scalability and high availability with Replica-Set (20)

Evolution of MongoDB Replicaset and Its Best Practices
Evolution of MongoDB Replicaset and Its Best PracticesEvolution of MongoDB Replicaset and Its Best Practices
Evolution of MongoDB Replicaset and Its Best Practices
 
Evolution Of MongoDB Replicaset
Evolution Of MongoDB ReplicasetEvolution Of MongoDB Replicaset
Evolution Of MongoDB Replicaset
 
Backing up Wikipedia Databases
Backing up Wikipedia DatabasesBacking up Wikipedia Databases
Backing up Wikipedia Databases
 
kranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High loadkranonit S06E01 Игорь Цинько: High load
kranonit S06E01 Игорь Цинько: High load
 
MongoDB: Advantages of an Open Source NoSQL Database
MongoDB: Advantages of an Open Source NoSQL DatabaseMongoDB: Advantages of an Open Source NoSQL Database
MongoDB: Advantages of an Open Source NoSQL Database
 
Scaling Up with PHP and AWS
Scaling Up with PHP and AWSScaling Up with PHP and AWS
Scaling Up with PHP and AWS
 
Scaling symfony apps
Scaling symfony appsScaling symfony apps
Scaling symfony apps
 
Screaming Fast Wpmu
Screaming Fast WpmuScreaming Fast Wpmu
Screaming Fast Wpmu
 
High performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodbHigh performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodb
 
PostgreSQL Sharding and HA: Theory and Practice (PGConf.ASIA 2017)
PostgreSQL Sharding and HA: Theory and Practice (PGConf.ASIA 2017)PostgreSQL Sharding and HA: Theory and Practice (PGConf.ASIA 2017)
PostgreSQL Sharding and HA: Theory and Practice (PGConf.ASIA 2017)
 
Running MySQL in AWS
Running MySQL in AWSRunning MySQL in AWS
Running MySQL in AWS
 
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
 
Pg chameleon, mysql to postgresql replica made easy
Pg chameleon, mysql to postgresql replica made easyPg chameleon, mysql to postgresql replica made easy
Pg chameleon, mysql to postgresql replica made easy
 
MariaDB Server Performance Tuning & Optimization
MariaDB Server Performance Tuning & OptimizationMariaDB Server Performance Tuning & Optimization
MariaDB Server Performance Tuning & Optimization
 
Zero Downtime JEE Architectures
Zero Downtime JEE ArchitecturesZero Downtime JEE Architectures
Zero Downtime JEE Architectures
 
MySQL's NoSQL -- SCaLE 13x Feb. 20, 2015
MySQL's NoSQL -- SCaLE 13x Feb. 20, 2015MySQL's NoSQL -- SCaLE 13x Feb. 20, 2015
MySQL's NoSQL -- SCaLE 13x Feb. 20, 2015
 
Optimizing Linux Servers
Optimizing Linux ServersOptimizing Linux Servers
Optimizing Linux Servers
 
MySQL Cluster Asynchronous replication (2014)
MySQL Cluster Asynchronous replication (2014) MySQL Cluster Asynchronous replication (2014)
MySQL Cluster Asynchronous replication (2014)
 
The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialThe Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication Tutorial
 
MySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated EnvironmentMySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated Environment
 

More from Vivek Parihar

A Git Workflow Model or Branching Strategy
A Git Workflow Model or Branching StrategyA Git Workflow Model or Branching Strategy
A Git Workflow Model or Branching StrategyVivek Parihar
 
Programming languages and concepts by vivek parihar
Programming languages and concepts by vivek pariharProgramming languages and concepts by vivek parihar
Programming languages and concepts by vivek pariharVivek Parihar
 
Case Study to build a tablet based app that is a shopping assistant.
Case Study to build a tablet based app that is a shopping assistant.Case Study to build a tablet based app that is a shopping assistant.
Case Study to build a tablet based app that is a shopping assistant.Vivek Parihar
 
Too much into acquisition without fixing retention problem: Let's Re-prioriti...
Too much into acquisition without fixing retention problem: Let's Re-prioriti...Too much into acquisition without fixing retention problem: Let's Re-prioriti...
Too much into acquisition without fixing retention problem: Let's Re-prioriti...Vivek Parihar
 
Devops for beginners
Devops for beginnersDevops for beginners
Devops for beginnersVivek Parihar
 
How fast can you onboard a new team member with VAGRANT ?
How fast can you onboard a new team member with VAGRANT ?How fast can you onboard a new team member with VAGRANT ?
How fast can you onboard a new team member with VAGRANT ?Vivek Parihar
 
Centralized logging system using mongoDB
Centralized logging system using mongoDBCentralized logging system using mongoDB
Centralized logging system using mongoDBVivek Parihar
 
Mobile First Approach - The key to cross platform interface design
Mobile First Approach - The key to cross platform interface designMobile First Approach - The key to cross platform interface design
Mobile First Approach - The key to cross platform interface designVivek Parihar
 
10 Deployments a day - A brief on extreme release protocols
10 Deployments a day - A brief on extreme release protocols10 Deployments a day - A brief on extreme release protocols
10 Deployments a day - A brief on extreme release protocolsVivek Parihar
 
Cloud foundry presentation
Cloud foundry presentation Cloud foundry presentation
Cloud foundry presentation Vivek Parihar
 

More from Vivek Parihar (11)

A Git Workflow Model or Branching Strategy
A Git Workflow Model or Branching StrategyA Git Workflow Model or Branching Strategy
A Git Workflow Model or Branching Strategy
 
Programming languages and concepts by vivek parihar
Programming languages and concepts by vivek pariharProgramming languages and concepts by vivek parihar
Programming languages and concepts by vivek parihar
 
Case Study to build a tablet based app that is a shopping assistant.
Case Study to build a tablet based app that is a shopping assistant.Case Study to build a tablet based app that is a shopping assistant.
Case Study to build a tablet based app that is a shopping assistant.
 
Too much into acquisition without fixing retention problem: Let's Re-prioriti...
Too much into acquisition without fixing retention problem: Let's Re-prioriti...Too much into acquisition without fixing retention problem: Let's Re-prioriti...
Too much into acquisition without fixing retention problem: Let's Re-prioriti...
 
Devops for beginners
Devops for beginnersDevops for beginners
Devops for beginners
 
How fast can you onboard a new team member with VAGRANT ?
How fast can you onboard a new team member with VAGRANT ?How fast can you onboard a new team member with VAGRANT ?
How fast can you onboard a new team member with VAGRANT ?
 
Centralized logging system using mongoDB
Centralized logging system using mongoDBCentralized logging system using mongoDB
Centralized logging system using mongoDB
 
Mobile First Approach - The key to cross platform interface design
Mobile First Approach - The key to cross platform interface designMobile First Approach - The key to cross platform interface design
Mobile First Approach - The key to cross platform interface design
 
10 Deployments a day - A brief on extreme release protocols
10 Deployments a day - A brief on extreme release protocols10 Deployments a day - A brief on extreme release protocols
10 Deployments a day - A brief on extreme release protocols
 
Cloud foundry presentation
Cloud foundry presentation Cloud foundry presentation
Cloud foundry presentation
 
Hu mongous db v2
Hu mongous db v2Hu mongous db v2
Hu mongous db v2
 

Recently uploaded

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
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
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 DevelopmentsTrustArc
 
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 2024Rafal Los
 
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 Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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 2024The Digital Insurer
 
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
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
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
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
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
 

Recently uploaded (20)

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?
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
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
 
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 Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
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
 
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...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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?
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
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
 

MongoDb scalability and high availability with Replica-Set

  • 1. @vparihar Scalability and High Availability with ReplicaSet Vivek Parihar AVP Engineering,Weboinse Lab
  • 2. Who Am I? ● ● ● ● ● ● A Weboniser and Rubyist Blogger(vparihar01.github.com) MongoDb user Geek DevOps Mainly write Ruby, but have great passion for Javascript and Cloud Platforms ● ...
  • 3. Agenda ● ● ● ● ● ● ● {10: Reasons, To: Love } Scalability with What is Sharding? What is Replica Set? Replication Process Advantaged of Replica Set vs Master/Slave How to set up replica set on production
  • 4. {10: Reasons , To: Love I.RELATIVELY EASY TO SETUP In simple 3 steps MongoDb is start running on your machine Step-1. sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 Step-2. sudo apt-get install mongodb-10gen Step-3. sudo /etc/init.d/mongodb start }
  • 5. {10: Reasons , To: Love } II.It’s fast On average 7 times faster
  • 6. {10: Reasons , To: Love III. Easy Scalability { Does Anyone know about scaling MySql? } }
  • 7. {10: Reasons , To: Love IV. High Availability }
  • 8. {10: Reasons , To: Love V. High Performance }
  • 9. {10: Reasons , To: Love VI. Flexible Schema {no schema: no problem} }
  • 10. {10: Reasons , To: Love MongoDb} VII. Built in Sharding and Replication
  • 11. {10: Reasons , To: Love } VIII. Courses are excellent to start working as a developer/DBA with.
  • 12. {10: Reasons , To: Love } IX. Deploy New Instances on Demand
  • 13. {10: Reasons , To: Love } X. BASE Rather Than ACID ACID BASE Atomicity Basically Available Consistency Soft State Isolation Eventual Consistency Durable
  • 14. Horizontal Scaling Vs Vertical Scaling
  • 15. Scalability with ● ● ● ● ● ● Horizontal Scaling Auto-Sharding Vertical Scaling Replica Set Performance {For: Read, For: Write} Storage
  • 16. Horizontal Scaling ● By adding more machines into the existing pool. ● In a database world horizontal-scaling is often based on partitioning of the data i.e. each node contains only part of the data. ● MongoDB achieves this through auto-sharding.
  • 17. Vertical Scaling ● Typically refers to adding more processors ,ram and storage to a Symmetric Multiple Processing to extend processing capability. ● In a database world vertical-scaling is done through multi-core i.e. spreading the load between the CPU and RAM resources of that machine.
  • 18.
  • 19. What is Sharding? ● Sharding is a method for storing data across multiple machines. ● Also known as Horizontal Scaling ● Divides the data set and distributes the data over multiple servers, or shards.
  • 20. What is Sharding? Each shard is an independent database, and collectively, the shards make up a single logical database.
  • 21. Sharding offerings: ● Automatic balancing for changes in load and data distribution ● Easy addition of new machines ● Scaling out to one thousand nodes ● No single points of failure ● Automatic failover
  • 22. What is Replication? ● Replication is the process of synchronizing data across multiple servers. ● Mongo achieves Replication through Replica Sets ● Replica sets are a form of asynchronous master/slave replication ● A replica set consists of two or more nodes that are copies of each other. (i.e.: replicas)
  • 23. Purpose of Replication Data Redundancy ● Replica sets provide an automated method for storing multiple copies of your data.
  • 24. Purpose of Replication Automated Failover / High Avalability ● If primary fails then replica set will attempt to select another member to become the new primary. ● This means that the failure of a primary can be handled by the client without any configuration changes ● Use heartbeat signal to detect failure
  • 25. Purpose of Replication ● Distributed Read Load/Read Scaling By default, the primary node of a replica set is accessed for all reads and writes. ● Disaster Recovery Replica sets allows for a “delayed secondary” node. This node can provide a window for recovering from disastrous events such as: ○ bad deployments ○ dropped tables and collections
  • 26. Replication Process ● Members of a replica set replicate data continuously ● MongoDB applies database operations on the primary and then records the operations on the primary’s oplog. ● All replica set members contain a copy of the oplog, allowing them to maintain the current state of the database.
  • 27. Advantages of Replica Set vs Master/Slave ● Replica sets are basically just master-slave with automatic failover. ● So, you have a pool of servers with one primary (the master) and N secondaries (slaves). If the primary crashes or disappears, the other servers will hold an election to choose a new primary.
  • 28. Demo -: How to set up replica set on Production! Click on below link to see the demo-: http://youtu.be/BFSGcBHcirU
  • 29. Thanks Would Love to answer your queries... Vivek Parihar @vparihar