SlideShare a Scribd company logo
1 of 27
MongoDB Resilience Design Pattern for Enterprise
Donovan Hsieh & Feng Qu
June, 2017
Speakers Bio
Donovan Hsieh - Sr. Enterprise Data
Architect @ eBay Inc.
• Have worked on
• Major RDBMS & Enterprise Data
Architecture / Modeling
• New passion is
• Highly available, fault tolerant distributed
computing, (Near) Real time Big Data &
Enterprise class NoSQL
• Speaker at 2015, 2016, 2017 EDW, NoSQL Now
& Dama Canada Conferences
• Speaker at 2016 Data Governance & Information
Quality Conference
Feng Qu – Sr. MTS @ eBay Inc.
• Have worked on
• Oracle since 1995
• NoSQL(Cassandra, MongoDB and
Couchbase) since 2011
• Led company wide NoSQL projects
• 2014 and 2015 Cassandra MVP
• Speaker at 2013, 2014 & 2015
Cassandra annual Summit
• Speaker at 2016 Couchbase Connect
• Speaker at 2016 & 2017 EDW
Conferences
Presentation Outline
• Why Resiliency Design Pattern for NoSQL Databases?
• Doesn’t NoSQL Support Auto-Failover Out-of-Box?
• NoSQL Resiliency Design Pattern Consideration
• NoSQL Resiliency Design Pattern Approach
• MongoDB Architecture Overview
• MongoDB Resilience Design Pattern Examples
• Other Resilience Design Pattern Examples
• Future Work & Direction
• Key Takeaways & Conclusion
• Q & A
Why Resiliency Design Pattern for NoSQL?
• Optimize operation & management efficiency to achieve
highest possible Production Availability
• Production Availability is more than just database clusters or
nodes availability
• Facilitate development with availability architectural blueprint &
SLA
• Application shouldn’t be burdened with unpreventable
infrastructure failure
Maximize
Doesn’t NoSQL Support AutoFailover OutofBox?
• Depending on types of NoSQL database & deployment
topology, e.g.,
• Built-in Disaster Recovery (DR)
• Single Point of Failure (SPOF) for reads and/or writes
• Node or cluster failover time
• Client connection stacking
• Graceful cluster nodes rebalancing & migration
• Ease of management for large scale clusters
• Consistent point-in-time backup & recovery
• Not all NoSQL databases are created equal in terms of
Availability, Consistency, Durability & Recoverability
Eight Fallacies of Distributed Computing
1. The network is reliable
2. Latency is zero
3. Bandwidth is infinite
4. The network is secure
5. Topology doesn't change
6. There is one administrator
7. Transport cost is zero
8. The network is homogeneous
9. NoSQL applications are resilient to failure
- Peter Deutsch & James Gosling
NoSQL Resiliency Design Pattern Consideration
• It’s not one dimension but rather a coherent set of inter-
connected cogs working together:
• Use case qualification
• Application persistence error handling using suitable NoSQL
vendors’ client drivers and SDKs
• Technology stack & engineering framework (e.g., Data Access
Layer or Netflix Hystrix)
• Infrastructure (e.g., cloud) setup
• Operation & management best practice + SOP
NoSQL Resiliency Design Pattern Approach
Identify meaningful NoSQL database architectural
abstraction based on relevant CAP theorem, ACID / BASE
properties & performance characteristics
Define different pattern types & standardize minimal
NoSQL Cluster deployment pattern for
- Common small-to-medium, non-mission critical use cases
Define enhanced design patterns to support mission
critical use cases that require high
- Availability, Consistency, Durability, Scalability & Performance
Define other design patterns to support non-conforming
use cases
- Standalone w/out DR, application sharding, etc.,
NoSQL Resilience Design Pattern Types
Type Pattern
Workload General Purpose Mixed Read & Write
Performance High Performance Read and / or Write
Durability
100% Durability
High Local and / or Cross Datacenter Durability
High Availability (HA) High Availability Local Read & Write
High Availability Multi Datacenter Read & Write
High Read & Write
Consistency
High Local Datacenter Read & Write Consistency
High Multi Datacenter Read & Write Consistency
Others Administration, Backup & Restore, Application Sharding …
MongoDB
Resilience
Architecture
MongoDB Resilience Architecture
S/A
S/A
MongoDB Resilience Architecture – Primary Node Failover
S/A
S/A
MongoDB Resilience Architecture – Datacenter Failover
Std. Minimal MongoDB Deployment Pattern
S/A
S/A
Special qualified use
case w/o DR
3+ nodes
MongoDB Resilience Architecture Recap
NoSQL
Database
Cluster
Type
Std. Minimal Deployment Pattern
Datacenter 1 Datacenter 2 Datacenter 3
MongoDB Multi-DC Replica Set
with DR
3+ (1 primary,
2+ secondary)
2+ (secondary) 2+ (secondary
or arbiter)
NoSQL
Database
Datacenter High
Availability
High
Consistency
High
Durability
DR
MongoDB Local DC No for Write
Yes for Read
Yes Yes No
Multi DC Yes
MongoDB
Resilience Design
Pattern Examples
Read Intensive / Highly Available Read Pattern
•High read to low write ratio and can tolerate primary node failure
•A Replica Set can have up to 50 members to scale up high read traffic if
needed, still limited to 7 voting members though
17
Extreme High Read / Write Pattern
•Use sharded MongoDB to support horizontal write & read scaling
High Performance Local Read Pattern
•Load balance read traffic before application servers
•Size up proper # of local secondary nodes
•Use SSD if active working set > RAM size
•Use readPreference=nearest or readPreference=secondaryPreferred
+ suitable localThreshold value
Non-Synchronous Writes
Write Durability Pattern – Quorum Write
•Use WriteConcern (“majority”, …), write waits for confirmation from majority
secondary nodes across different datacenters
•During primary node failover, secondary node having the latest committed
write will be elected as the new primary.
S/A
S/A
Strong Consistency Pattern – Quorum R & W
•Support strong read & write consistency across multiple datacenters using writeConcern/
readConcern=Majority which is based on CAP Theorem R+W>N Consistency Property
•Caveat
–May incur additional wait time because of multi-datacenter read & write confirmation
–Application should set proper timeout to circumvent longer than normal wait should any
member of nodes reading and / or writing fail for any reason
Strong Consistency – Cross DC Tagged R/W
•Supports strong read & write consistency from local tagged secondary
node(s) without waiting for majority read confirmation
•Caveat
–Write still incurs wait time because of multi-datacenter write confirmation
–Requires non-standard replica set configuration setting
–Developer should set proper timeout to circumvent from indefinite wait
Strong Consistency Pattern – R/W from Primary
•Supports strong read & write consistency for application that cannot
tolerate quorum read/write wait time
•Secondary nodes are only used for primary node failover while arbiter
nodes are only used for quorum voting
Other NoSQL
Design Pattern
Examples
NoSQL DB Agnostic Application Sharding Pattern
•Reduce HA risk associated with managing very large scale NoSQL
clusters
•Requires middle-tier Data Access Layer with built-in hash, range &
modular sharding
•On top of built-in native NoSQL sharding
Future Work & Direction
• End-to-end Integration proven NoSQL design patterns with
• Application framework (e.g., Data Access Layer)
• Cloud provisioning & management infrastructure
• Formalize above NoSQL design patterns as officially supported
internal development products rather than engineering patterns
• Collaborate with NoSQL vendors and develop new design
patterns for new features & capabilities
Practical Design Patterns for Building Applications Resilient to Infrastructure Failure

More Related Content

What's hot

Using Compass to Diagnose Performance Problems in Your Cluster
Using Compass to Diagnose Performance Problems in Your ClusterUsing Compass to Diagnose Performance Problems in Your Cluster
Using Compass to Diagnose Performance Problems in Your Cluster
MongoDB
 

What's hot (20)

Jumpstart: Your Introduction to MongoDB
Jumpstart: Your Introduction to MongoDBJumpstart: Your Introduction to MongoDB
Jumpstart: Your Introduction to MongoDB
 
Building the Real-Time Performance Panel
Building the Real-Time Performance PanelBuilding the Real-Time Performance Panel
Building the Real-Time Performance Panel
 
Using Aggregation for Analytics
Using Aggregation for Analytics Using Aggregation for Analytics
Using Aggregation for Analytics
 
An Elastic Metadata Store for eBay’s Media Platform
An Elastic Metadata Store for eBay’s Media PlatformAn Elastic Metadata Store for eBay’s Media Platform
An Elastic Metadata Store for eBay’s Media Platform
 
Using Compass to Diagnose Performance Problems in Your Cluster
Using Compass to Diagnose Performance Problems in Your ClusterUsing Compass to Diagnose Performance Problems in Your Cluster
Using Compass to Diagnose Performance Problems in Your Cluster
 
Containerizing MongoDB with kubernetes
Containerizing MongoDB with kubernetesContainerizing MongoDB with kubernetes
Containerizing MongoDB with kubernetes
 
Powering Microservices with Docker, Kubernetes, Kafka, & MongoDB
Powering Microservices with Docker, Kubernetes, Kafka, & MongoDBPowering Microservices with Docker, Kubernetes, Kafka, & MongoDB
Powering Microservices with Docker, Kubernetes, Kafka, & MongoDB
 
Sizing Your MongoDB Cluster
Sizing Your MongoDB ClusterSizing Your MongoDB Cluster
Sizing Your MongoDB Cluster
 
Engineering an Encrypted Storage Engine
Engineering an Encrypted Storage EngineEngineering an Encrypted Storage Engine
Engineering an Encrypted Storage Engine
 
Conceptos Avanzados 1: Motores de Almacenamiento
Conceptos Avanzados 1: Motores de AlmacenamientoConceptos Avanzados 1: Motores de Almacenamiento
Conceptos Avanzados 1: Motores de Almacenamiento
 
MongoDB Capacity Planning
MongoDB Capacity PlanningMongoDB Capacity Planning
MongoDB Capacity Planning
 
Cloud Backup Overview
Cloud Backup Overview Cloud Backup Overview
Cloud Backup Overview
 
RedisConf18 - Redis on Flash
RedisConf18 - Redis on FlashRedisConf18 - Redis on Flash
RedisConf18 - Redis on Flash
 
AWS Lambda, Step Functions & MongoDB Atlas Tutorial
AWS Lambda, Step Functions & MongoDB Atlas TutorialAWS Lambda, Step Functions & MongoDB Atlas Tutorial
AWS Lambda, Step Functions & MongoDB Atlas Tutorial
 
Managing Multi-Tenant SaaS Applications at Scale
Managing Multi-Tenant SaaS Applications at ScaleManaging Multi-Tenant SaaS Applications at Scale
Managing Multi-Tenant SaaS Applications at Scale
 
MongoDB Europe 2016 - Star in a Reasonably Priced Car - Which Driver is Best?
MongoDB Europe 2016 - Star in a Reasonably Priced Car - Which Driver is Best?MongoDB Europe 2016 - Star in a Reasonably Priced Car - Which Driver is Best?
MongoDB Europe 2016 - Star in a Reasonably Priced Car - Which Driver is Best?
 
Webinar: Choosing the Right Shard Key for High Performance and Scale
Webinar: Choosing the Right Shard Key for High Performance and ScaleWebinar: Choosing the Right Shard Key for High Performance and Scale
Webinar: Choosing the Right Shard Key for High Performance and Scale
 
Advanced Schema Design Patterns
Advanced Schema Design Patterns Advanced Schema Design Patterns
Advanced Schema Design Patterns
 
NoSQL benchmarking
NoSQL benchmarkingNoSQL benchmarking
NoSQL benchmarking
 
MongoDB vs Mysql. A devops point of view
MongoDB vs Mysql. A devops point of viewMongoDB vs Mysql. A devops point of view
MongoDB vs Mysql. A devops point of view
 

Similar to Practical Design Patterns for Building Applications Resilient to Infrastructure Failure

NoSQLDatabases
NoSQLDatabasesNoSQLDatabases
NoSQLDatabases
Adi Challa
 
Big Data (NJ SQL Server User Group)
Big Data (NJ SQL Server User Group)Big Data (NJ SQL Server User Group)
Big Data (NJ SQL Server User Group)
Don Demcsak
 
NoSQL Options Compared
NoSQL Options ComparedNoSQL Options Compared
NoSQL Options Compared
Sergey Bushik
 

Similar to Practical Design Patterns for Building Applications Resilient to Infrastructure Failure (20)

NoSQL – Data Center Centric Application Enablement
NoSQL – Data Center Centric Application EnablementNoSQL – Data Center Centric Application Enablement
NoSQL – Data Center Centric Application Enablement
 
NoSQL_Night
NoSQL_NightNoSQL_Night
NoSQL_Night
 
NoSQLDatabases
NoSQLDatabasesNoSQLDatabases
NoSQLDatabases
 
Relational databases vs Non-relational databases
Relational databases vs Non-relational databasesRelational databases vs Non-relational databases
Relational databases vs Non-relational databases
 
Big Data (NJ SQL Server User Group)
Big Data (NJ SQL Server User Group)Big Data (NJ SQL Server User Group)
Big Data (NJ SQL Server User Group)
 
NoSQL and MongoDB
NoSQL and MongoDBNoSQL and MongoDB
NoSQL and MongoDB
 
Minnebar 2013 - Scaling with Cassandra
Minnebar 2013 - Scaling with CassandraMinnebar 2013 - Scaling with Cassandra
Minnebar 2013 - Scaling with Cassandra
 
How and when to use NoSQL
How and when to use NoSQLHow and when to use NoSQL
How and when to use NoSQL
 
Azure DocumentDB Overview
Azure DocumentDB OverviewAzure DocumentDB Overview
Azure DocumentDB Overview
 
Evolution of Distributed Database Technologies in the Digital era
Evolution of Distributed Database Technologies in the Digital eraEvolution of Distributed Database Technologies in the Digital era
Evolution of Distributed Database Technologies in the Digital era
 
Polyglot Persistence - Two Great Tastes That Taste Great Together
Polyglot Persistence - Two Great Tastes That Taste Great TogetherPolyglot Persistence - Two Great Tastes That Taste Great Together
Polyglot Persistence - Two Great Tastes That Taste Great Together
 
Sql vs nosql
Sql vs nosqlSql vs nosql
Sql vs nosql
 
IBM - Introduction to Cloudant
IBM - Introduction to CloudantIBM - Introduction to Cloudant
IBM - Introduction to Cloudant
 
0812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part2
0812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part20812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part2
0812 2014 01_toronto-smac meetup_i_os_cloudant_worklight_part2
 
Cambridge Breakfast Seminar
Cambridge Breakfast SeminarCambridge Breakfast Seminar
Cambridge Breakfast Seminar
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
 
Getting started with postgresql
Getting started with postgresqlGetting started with postgresql
Getting started with postgresql
 
NoSQL Options Compared
NoSQL Options ComparedNoSQL Options Compared
NoSQL Options Compared
 
Serhiy Kalinets "Embracing architectural challenges in the modern .NET world"
Serhiy Kalinets "Embracing architectural challenges in the modern .NET world"Serhiy Kalinets "Embracing architectural challenges in the modern .NET world"
Serhiy Kalinets "Embracing architectural challenges in the modern .NET world"
 
No sql
No sqlNo sql
No sql
 

More from MongoDB

More from MongoDB (20)

MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
 
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
 
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
 
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDBMongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
 
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 MongoDB SoCal 2020: MongoDB Atlas Jump Start MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
 
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
 
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your MindsetMongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
 
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas JumpstartMongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
 
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
 
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
 
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
 
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep DiveMongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
 
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & GolangMongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
 
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
 
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 

Practical Design Patterns for Building Applications Resilient to Infrastructure Failure

  • 1. MongoDB Resilience Design Pattern for Enterprise Donovan Hsieh & Feng Qu June, 2017
  • 2. Speakers Bio Donovan Hsieh - Sr. Enterprise Data Architect @ eBay Inc. • Have worked on • Major RDBMS & Enterprise Data Architecture / Modeling • New passion is • Highly available, fault tolerant distributed computing, (Near) Real time Big Data & Enterprise class NoSQL • Speaker at 2015, 2016, 2017 EDW, NoSQL Now & Dama Canada Conferences • Speaker at 2016 Data Governance & Information Quality Conference Feng Qu – Sr. MTS @ eBay Inc. • Have worked on • Oracle since 1995 • NoSQL(Cassandra, MongoDB and Couchbase) since 2011 • Led company wide NoSQL projects • 2014 and 2015 Cassandra MVP • Speaker at 2013, 2014 & 2015 Cassandra annual Summit • Speaker at 2016 Couchbase Connect • Speaker at 2016 & 2017 EDW Conferences
  • 3. Presentation Outline • Why Resiliency Design Pattern for NoSQL Databases? • Doesn’t NoSQL Support Auto-Failover Out-of-Box? • NoSQL Resiliency Design Pattern Consideration • NoSQL Resiliency Design Pattern Approach • MongoDB Architecture Overview • MongoDB Resilience Design Pattern Examples • Other Resilience Design Pattern Examples • Future Work & Direction • Key Takeaways & Conclusion • Q & A
  • 4. Why Resiliency Design Pattern for NoSQL? • Optimize operation & management efficiency to achieve highest possible Production Availability • Production Availability is more than just database clusters or nodes availability • Facilitate development with availability architectural blueprint & SLA • Application shouldn’t be burdened with unpreventable infrastructure failure Maximize
  • 5. Doesn’t NoSQL Support AutoFailover OutofBox? • Depending on types of NoSQL database & deployment topology, e.g., • Built-in Disaster Recovery (DR) • Single Point of Failure (SPOF) for reads and/or writes • Node or cluster failover time • Client connection stacking • Graceful cluster nodes rebalancing & migration • Ease of management for large scale clusters • Consistent point-in-time backup & recovery • Not all NoSQL databases are created equal in terms of Availability, Consistency, Durability & Recoverability
  • 6. Eight Fallacies of Distributed Computing 1. The network is reliable 2. Latency is zero 3. Bandwidth is infinite 4. The network is secure 5. Topology doesn't change 6. There is one administrator 7. Transport cost is zero 8. The network is homogeneous 9. NoSQL applications are resilient to failure - Peter Deutsch & James Gosling
  • 7. NoSQL Resiliency Design Pattern Consideration • It’s not one dimension but rather a coherent set of inter- connected cogs working together: • Use case qualification • Application persistence error handling using suitable NoSQL vendors’ client drivers and SDKs • Technology stack & engineering framework (e.g., Data Access Layer or Netflix Hystrix) • Infrastructure (e.g., cloud) setup • Operation & management best practice + SOP
  • 8. NoSQL Resiliency Design Pattern Approach Identify meaningful NoSQL database architectural abstraction based on relevant CAP theorem, ACID / BASE properties & performance characteristics Define different pattern types & standardize minimal NoSQL Cluster deployment pattern for - Common small-to-medium, non-mission critical use cases Define enhanced design patterns to support mission critical use cases that require high - Availability, Consistency, Durability, Scalability & Performance Define other design patterns to support non-conforming use cases - Standalone w/out DR, application sharding, etc.,
  • 9. NoSQL Resilience Design Pattern Types Type Pattern Workload General Purpose Mixed Read & Write Performance High Performance Read and / or Write Durability 100% Durability High Local and / or Cross Datacenter Durability High Availability (HA) High Availability Local Read & Write High Availability Multi Datacenter Read & Write High Read & Write Consistency High Local Datacenter Read & Write Consistency High Multi Datacenter Read & Write Consistency Others Administration, Backup & Restore, Application Sharding …
  • 12. MongoDB Resilience Architecture – Primary Node Failover S/A S/A
  • 13. MongoDB Resilience Architecture – Datacenter Failover Std. Minimal MongoDB Deployment Pattern S/A S/A
  • 14. Special qualified use case w/o DR 3+ nodes MongoDB Resilience Architecture Recap NoSQL Database Cluster Type Std. Minimal Deployment Pattern Datacenter 1 Datacenter 2 Datacenter 3 MongoDB Multi-DC Replica Set with DR 3+ (1 primary, 2+ secondary) 2+ (secondary) 2+ (secondary or arbiter) NoSQL Database Datacenter High Availability High Consistency High Durability DR MongoDB Local DC No for Write Yes for Read Yes Yes No Multi DC Yes
  • 16. Read Intensive / Highly Available Read Pattern •High read to low write ratio and can tolerate primary node failure •A Replica Set can have up to 50 members to scale up high read traffic if needed, still limited to 7 voting members though
  • 17. 17 Extreme High Read / Write Pattern •Use sharded MongoDB to support horizontal write & read scaling
  • 18. High Performance Local Read Pattern •Load balance read traffic before application servers •Size up proper # of local secondary nodes •Use SSD if active working set > RAM size •Use readPreference=nearest or readPreference=secondaryPreferred + suitable localThreshold value
  • 20. Write Durability Pattern – Quorum Write •Use WriteConcern (“majority”, …), write waits for confirmation from majority secondary nodes across different datacenters •During primary node failover, secondary node having the latest committed write will be elected as the new primary. S/A S/A
  • 21. Strong Consistency Pattern – Quorum R & W •Support strong read & write consistency across multiple datacenters using writeConcern/ readConcern=Majority which is based on CAP Theorem R+W>N Consistency Property •Caveat –May incur additional wait time because of multi-datacenter read & write confirmation –Application should set proper timeout to circumvent longer than normal wait should any member of nodes reading and / or writing fail for any reason
  • 22. Strong Consistency – Cross DC Tagged R/W •Supports strong read & write consistency from local tagged secondary node(s) without waiting for majority read confirmation •Caveat –Write still incurs wait time because of multi-datacenter write confirmation –Requires non-standard replica set configuration setting –Developer should set proper timeout to circumvent from indefinite wait
  • 23. Strong Consistency Pattern – R/W from Primary •Supports strong read & write consistency for application that cannot tolerate quorum read/write wait time •Secondary nodes are only used for primary node failover while arbiter nodes are only used for quorum voting
  • 25. NoSQL DB Agnostic Application Sharding Pattern •Reduce HA risk associated with managing very large scale NoSQL clusters •Requires middle-tier Data Access Layer with built-in hash, range & modular sharding •On top of built-in native NoSQL sharding
  • 26. Future Work & Direction • End-to-end Integration proven NoSQL design patterns with • Application framework (e.g., Data Access Layer) • Cloud provisioning & management infrastructure • Formalize above NoSQL design patterns as officially supported internal development products rather than engineering patterns • Collaborate with NoSQL vendors and develop new design patterns for new features & capabilities