Top Banner
22

Moving MongoDB to the Cloud - Percona · distributing MongoDB replica set members across different zones and regions. • With automated backup and disaster recovery, the impact of

Oct 17, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Moving MongoDB to the Cloud - Percona · distributing MongoDB replica set members across different zones and regions. • With automated backup and disaster recovery, the impact of
Page 2: Moving MongoDB to the Cloud - Percona · distributing MongoDB replica set members across different zones and regions. • With automated backup and disaster recovery, the impact of

Moving MongoDB to the CloudVinicius M. Grippa

Senior Support Engineer for MySQL/MongoDB

[email protected]

Page 3: Moving MongoDB to the Cloud - Percona · distributing MongoDB replica set members across different zones and regions. • With automated backup and disaster recovery, the impact of

• Support Engineer at Percona since 2017.

• Working with MySQL for over six years.

• Working with databases for over nine years.

• Speaker at Percona Live conferences and meetups about MySQL/MongoDB.

• Social media

• https://www.linkedin.com/in/vinicius-grippa/

[email protected] / [email protected]

About me

Page 4: Moving MongoDB to the Cloud - Percona · distributing MongoDB replica set members across different zones and regions. • With automated backup and disaster recovery, the impact of

• Founded in 2006

• 190+ staff worldwide

• Percona blog has 100k+ readers per month

• Percona tools have been used over a billion times in the past 3 years

• Percona conferences attract thousands of attendees from some of the world’s largest companies (#PerconaLive)

• Percona software is installed on millions of servers

About Percona

Page 5: Moving MongoDB to the Cloud - Percona · distributing MongoDB replica set members across different zones and regions. • With automated backup and disaster recovery, the impact of

MongoDB in the Cloud

5

Page 6: Moving MongoDB to the Cloud - Percona · distributing MongoDB replica set members across different zones and regions. • With automated backup and disaster recovery, the impact of

A few MongoDB host options:

• On-premises data centers

• Cloud providers such as AWS, Azure, and others

• Hosted Databases (ObjectRocket, Rackspace)

• Hybrid of on-premises data center and cloud providers

MongoDB Hosting Options

Page 7: Moving MongoDB to the Cloud - Percona · distributing MongoDB replica set members across different zones and regions. • With automated backup and disaster recovery, the impact of

• Cloud in general is cost-effective

• No need to employ additional staff to manage your hardware and configurations — The Provider will take care of that.

• No need to pay for the extra effort to implement security on your DB application.

• Cloud data centers are geographically dispersed, which ensures high availability by distributing MongoDB replica set members across different zones and regions.

• With automated backup and disaster recovery, the impact of failures can be mitigated with reduced downtime and high availability. This can easily be achieved at a low cost.

Reasons to Move To Cloud

Page 8: Moving MongoDB to the Cloud - Percona · distributing MongoDB replica set members across different zones and regions. • With automated backup and disaster recovery, the impact of

• The type of the instance (CPU, Memory, Dissk (EBS and Ephemeral))

• High availability strategy (Regions, AZ, Geo-Distributed)

• Security design, including encryption, SSL, VPN, networking, firewalls, and security groups for the VPCs and MongoDB (certificates, bind, authentication)

• Migration / Rollback strategy

• Backup and recovery strategy

Strategy Planning

Page 9: Moving MongoDB to the Cloud - Percona · distributing MongoDB replica set members across different zones and regions. • With automated backup and disaster recovery, the impact of

Strategies to Migrate

9

Page 10: Moving MongoDB to the Cloud - Percona · distributing MongoDB replica set members across different zones and regions. • With automated backup and disaster recovery, the impact of

• Perform connectivity check.

• On AWS, start MongoDB with the same configuration as your on-premises data center MongoDB configuration.

• Add the AWS server into your own data center replica set using rs.add() and wait until initial sync completes.

• Once the initial sync is completed, you can perform a rs.stepdown() and evaluate the performance. Once the tests are concluded, remove the member from the on-premises data center using rs.remove().

Strategy #1 - Adding AWS MongoDB Server as a Replica Set Member - No Downtime Required

Page 11: Moving MongoDB to the Cloud - Percona · distributing MongoDB replica set members across different zones and regions. • With automated backup and disaster recovery, the impact of

• Take backup (Percona HotBackup, PBM) or mongodump off the database from the on-premises data center.

• Install and configure brand new MongoDB on AWS, and restore the database to AWS. Step 3: Direct your application to AWS.

Strategy #2 - Backup and Restore to AWS — Downtime is Required

Page 12: Moving MongoDB to the Cloud - Percona · distributing MongoDB replica set members across different zones and regions. • With automated backup and disaster recovery, the impact of

Attention Points

12

Page 13: Moving MongoDB to the Cloud - Percona · distributing MongoDB replica set members across different zones and regions. • With automated backup and disaster recovery, the impact of

What do we need to consider?

• Latency

• Downtime

• Security

• Performance

Page 14: Moving MongoDB to the Cloud - Percona · distributing MongoDB replica set members across different zones and regions. • With automated backup and disaster recovery, the impact of

Latency

• Read Concern - control the consistency and isolation properties of the data read from replica sets and replica set shards.

• Write Concern - describes the level of acknowledgment requested from MongoDB for write operations to a standalone mongod or to replica sets or to sharded clusters.

• Config Servers (if sharded) - When writing to the config servers, MongoDB uses a write concern of "majority".

• Application Location and configuration string

Page 15: Moving MongoDB to the Cloud - Percona · distributing MongoDB replica set members across different zones and regions. • With automated backup and disaster recovery, the impact of

Downtime

It is important to have defined the backup/rollback strategy otherwise the downtime can be even higher. Especially when using shards and it is common to have terabytes of data involved.

Page 16: Moving MongoDB to the Cloud - Percona · distributing MongoDB replica set members across different zones and regions. • With automated backup and disaster recovery, the impact of

What do we need to consider?

Security is extremely important!

Consider setting the server behind a private network.

Don't expose MongoDB port (if needed change the default port, use authentication, SSL, certificates X.509, and roles)

Page 17: Moving MongoDB to the Cloud - Percona · distributing MongoDB replica set members across different zones and regions. • With automated backup and disaster recovery, the impact of

What do we need to consider?

Monitor your environment!

Page 18: Moving MongoDB to the Cloud - Percona · distributing MongoDB replica set members across different zones and regions. • With automated backup and disaster recovery, the impact of
Page 19: Moving MongoDB to the Cloud - Percona · distributing MongoDB replica set members across different zones and regions. • With automated backup and disaster recovery, the impact of

What we should NOT do?

19

Page 20: Moving MongoDB to the Cloud - Percona · distributing MongoDB replica set members across different zones and regions. • With automated backup and disaster recovery, the impact of

What we should not do?

• Upgrade/Downgrade MongoDB version

• Upgrade/Downgrade Driver version

• Adjust MongoDB/OS parameters

20

Page 21: Moving MongoDB to the Cloud - Percona · distributing MongoDB replica set members across different zones and regions. • With automated backup and disaster recovery, the impact of
Page 22: Moving MongoDB to the Cloud - Percona · distributing MongoDB replica set members across different zones and regions. • With automated backup and disaster recovery, the impact of

谢谢Thank you

GrazieObrigadoGracias

Open Source Database Experts