2014 05-07-fr - add dev series - session 6 - deploying your application-2
-
Upload
mongodb -
Category
Technology
-
view
1.427 -
download
1
Transcript of 2014 05-07-fr - add dev series - session 6 - deploying your application-2
![Page 1: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/1.jpg)
Tugdual Grall (@tgrall) Alain Hélaïli (@AlainHelaili)
#MongoDBBasics @MongoDB
Construire une application avec MongoDB
Déploiement de l’application
![Page 2: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/2.jpg)
2
• Résumé des épisodes précédents
• Replication
• Sharding
Agenda
![Page 3: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/3.jpg)
3
• Virtual Genius Bar– Utilisez la fenêtre de chat
– Tug & Alain dispo pendant, et après…
• MUGs à Paris, Toulouse, Bordeaux, Rennes, Lyon
• Groupes LinkedIn « MongoDB France » et « MongoDB » sur Viadeo
Q & A
@tgrall, [email protected] - @AlainHelaili, [email protected]
![Page 4: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/4.jpg)
Résumé des épisodes précédents…
![Page 5: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/5.jpg)
5
• Agrégation de données…– Map Reduce– Hadoop– Rapports Pré-Agrégés– Aggregation Framework
• Tuning avec Explain
• Calcul à la volée ou calcul/stocke
• Geospatial
• Text Search
Résumé
![Page 6: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/6.jpg)
Replication
![Page 7: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/7.jpg)
Why Replication?
• How many have faced node failures?
• How many have been woken up from sleep to do a fail-over(s)?
• How many have experienced issues due to network latency?
• Different uses for data– Normal processing– Simple analytics
![Page 8: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/8.jpg)
Why Replication?
• Replication is designed for– High Availability (HA)– Disaster Recovery (DR)
• Not designed for scaling reads– You can but there are drawbacks: eventual
consistency, etc.– Use sharding for scaling!
![Page 9: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/9.jpg)
Replica Set – Creation
![Page 10: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/10.jpg)
Replica Set – Initialize
![Page 11: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/11.jpg)
Replica Set – Failure
![Page 12: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/12.jpg)
Replica Set – Failover
![Page 13: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/13.jpg)
Replica Set – Recovery
![Page 14: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/14.jpg)
Replica Set – Recovered
![Page 15: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/15.jpg)
Replica Set Roles & Configuration
![Page 16: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/16.jpg)
Replica Set RolesExample with 2 data nodes + 1 arbiter
![Page 17: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/17.jpg)
> conf = { // 5 data nodes
_id : "mySet",
members : [
{_id : 0, host : "A”, priority : 3},
{_id : 1, host : "B", priority : 2},
{_id : 2, host : "C”},
{_id : 3, host : "D", hidden : true},
{_id : 4, host : "E", hidden : true, slaveDelay : 3600}
]
}
> rs.initiate(conf)
Configuration Options
![Page 18: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/18.jpg)
Developing with Replica Sets
![Page 19: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/19.jpg)
Strong Consistency
![Page 20: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/20.jpg)
Delayed / Eventual Consistency
![Page 21: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/21.jpg)
Write Concerns
• Network acknowledgement (w = 0)
• Wait for return info/error (w = 1)
• Wait for journal sync (j = 1)
• Wait for replication (w >=2)
![Page 22: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/22.jpg)
Tagging
• Control where data is written to, and read from
• Each member can have one or more tags– tags: {dc: "ny"}– tags: {dc: "ny", subnet: "192.168", rack:
"row3rk7"}
• Replica set defines rules for write concerns
• Rules can change without changing app code
![Page 23: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/23.jpg)
{
_id : "mySet",
members : [
{_id : 0, host : "A", tags : {"dc": "ny"}},
{_id : 1, host : "B", tags : {"dc": "ny"}},
{_id : 2, host : "C", tags : {"dc": "sf"}},
{_id : 3, host : "D", tags : {"dc": "sf"}},
{_id : 4, host : "E", tags : {"dc": "cloud"}}],
settings : {
getLastErrorModes : {
allDCs : {"dc" : 3},
someDCs : {"dc" : 2}} }
}
> db.blogs.insert({...})
> db.runCommand({getLastError : 1, w : "someDCs"})
Tagging Example
![Page 24: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/24.jpg)
Read Preference Modes
• 5 modes– primary (only) - Default– primaryPreferred– secondary– secondaryPreferred– Nearest
When more than one node is possible, closest node is used for reads (all modes but primary)
![Page 25: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/25.jpg)
Tagged Read Preference
• Custom read preferences
• Control where you read from by (node) tags– E.g. { "disk": "ssd", "use": "reporting" }
• Use in conjunction with standard read preferences– Except primary
![Page 26: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/26.jpg)
Sharding
![Page 27: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/27.jpg)
Read/Write Throughput Exceeds I/O
![Page 28: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/28.jpg)
Working Set Exceeds Physical Memory
![Page 29: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/29.jpg)
Vertical Scalability (Scale Up)
![Page 30: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/30.jpg)
Horizontal Scalability (Scale Out)
![Page 31: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/31.jpg)
Partitioning
• User defines shard key
• Shard key defines range of data
• Key space is like points on a line
• Range is a segment of that line (chunk), smaller than 64MB
• Chunks are migrated from one shard to another to maintain a balanced state
![Page 32: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/32.jpg)
Shard Key
• Shard key is immutable
• Shard key values are immutable
• Shard key must be indexed
• Shard key limited to 512 bytes in size
• Shard key used to route queries– Choose a field commonly used in queries
• Only shard key can be unique across shards
![Page 33: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/33.jpg)
Shard Key Considerations
• Cardinality
• Write Distribution
• Query Isolation
• Reliability
• Index Locality
![Page 34: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/34.jpg)
Initially 1 chunk
Default max chunk size: 64mb
MongoDB automatically splits & migrates chunks when max reached
Data Distribution
![Page 35: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/35.jpg)
Queries routed to specific shards
MongoDB balances cluster
MongoDB migrates data to new nodes
Routing and Balancing
![Page 36: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/36.jpg)
Partitioning
- ∞ + ∞ shard 2 shard 3
![Page 37: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/37.jpg)
Partitioning
- ∞ + ∞
- ∞ { x : 1}, { x : 3} …. { x : 99} + ∞
shard 2 shard 3
shard 2 shard 3
![Page 38: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/38.jpg)
Partitioning
- ∞ + ∞
- ∞ { x : 1}, { x : 3} …. { x : 99} + ∞
- ∞ { x : 1} …. { x : 55}
{ x : 56} …. { x : 110} + ∞ shard 2 shard 3
shard 2 shard 3
shard 2 shard 3
![Page 39: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/39.jpg)
Partitioning
- ∞ + ∞
- ∞ { x : 1}, { x : 3} …. { x : 99} + ∞
- ∞ { x : 1} …. { x : 55}
{ x : 56} …. { x : 110} + ∞ shard 2 shard 3
shard 2 shard 3
shard 2 shard 3
![Page 40: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/40.jpg)
Partitioning
- ∞ + ∞
- ∞ { x : 1}, { x : 3} …. { x : 99} + ∞
- ∞ { x : 1} …. { x : 55}
{ x : 56} …. { x : 110} + ∞ shard 2 shard 3
shard 2 shard 3
shard 2 shard 3
![Page 41: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/41.jpg)
MongoDB Auto-Sharding
• Minimal effort required– Same interface as single mongod
• Two steps– Enable Sharding for a database– Shard collection within database
![Page 42: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/42.jpg)
Architecture
![Page 43: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/43.jpg)
What is a Shard?
• Shard is a node of the cluster
• Shard can be a single mongod or a replica set
![Page 44: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/44.jpg)
Meta Data Storage
• Config Server– Stores cluster chunk ranges and locations– Can have only 1 or 3 (production must have
3)– Not a replica set
![Page 45: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/45.jpg)
Routing and Managing Data
• Mongos– Acts as a router / balancer– No local data (persists to config database)– Can have 1 or many
![Page 46: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/46.jpg)
Sharding infrastructure
![Page 47: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/47.jpg)
Configuration
![Page 48: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/48.jpg)
Example Cluster
![Page 49: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/49.jpg)
mongod --configsvr
Starts a configuration server on the default port (27019)
Starting the Configuration Server
![Page 50: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/50.jpg)
mongos --configdb <hostname>:27019
For 3 configuration servers:mongos --configdb <host1>:<port1>,<host2>:<port2>,<host3>:<port3>
This is always how to start a new mongos, even if the cluster is already running
Start the mongos Router
![Page 51: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/51.jpg)
mongod --shardsvr
Starts a mongod with the default shard port (27018)
Shard is not yet connected to the rest of the cluster
Shard may have already been running in production
Start the shard database
![Page 52: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/52.jpg)
On mongos: – sh.addShard(‘<host>:27018’)
Adding a replica set: – sh.addShard(‘<rsname>/<seedlist>’)
Add the Shard
![Page 53: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/53.jpg)
db.runCommand({ listshards:1 }) { "shards" : [{"_id”: "shard0000”,"host”: ”<hostname>:27018” } ],
"ok" : 1 }
Verify that the shard was added
![Page 54: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/54.jpg)
Enabling Sharding
• Enable sharding on a database
sh.enableSharding(“<dbname>”)
• Shard a collection with the given key
sh.shardCollection(“<dbname>.people”,{“country”:1})
• Use a compound shard key to prevent duplicates
sh.shardCollection(“<dbname>.cars”,{“year”:1, ”uniqueid”:1})
![Page 55: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/55.jpg)
Tag Aware Sharding
• Tag aware sharding allows you to control the distribution of your data
• Tag a range of shard keys– sh.addTagRange(<collection>,<min>,<max>,<t
ag>)
• Tag a shard– sh.addShardTag(<shard>,<tag>)
![Page 56: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/56.jpg)
Routing Requests
![Page 57: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/57.jpg)
Cluster Request Routing
• Targeted Queries
• Scatter Gather Queries
• Scatter Gather Queries with Sort
![Page 58: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/58.jpg)
Cluster Request Routing: Targeted Query
![Page 59: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/59.jpg)
Routable request received
![Page 60: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/60.jpg)
Request routed to appropriate shard
![Page 61: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/61.jpg)
Shard returns results
![Page 62: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/62.jpg)
Mongos returns results to client
![Page 63: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/63.jpg)
Cluster Request Routing: Non-Targeted Query
![Page 64: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/64.jpg)
Non-Targeted Request Received
![Page 65: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/65.jpg)
Request sent to all shards
![Page 66: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/66.jpg)
Shards return results to mongos
![Page 67: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/67.jpg)
Mongos returns results to client
![Page 68: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/68.jpg)
Cluster Request Routing: Non-Targeted Query with Sort
![Page 69: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/69.jpg)
Non-Targeted request with sort received
![Page 70: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/70.jpg)
Request sent to all shards
![Page 71: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/71.jpg)
Query and sort performed locally
![Page 72: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/72.jpg)
Shards return results to mongos
![Page 73: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/73.jpg)
Mongos merges sorted results
![Page 74: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/74.jpg)
Mongos returns results to client
![Page 75: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/75.jpg)
Résumé
![Page 76: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/76.jpg)
76
• Replica set pour haute disponibilité
• Sharding pour montée en charge
• Write concern
• Clé de sharding
Résumé
![Page 77: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/77.jpg)
77
– Backup– Reprise sur incident
Prochaine session – 3 Juin
![Page 78: 2014 05-07-fr - add dev series - session 6 - deploying your application-2](https://reader033.fdocuments.us/reader033/viewer/2022060108/554dd3aeb4c905cc0e8b4982/html5/thumbnails/78.jpg)