com presentations: Content revisions for sharding slides: mongo-tut-tek15.xml slides/mongodb/sharding-acquire-lock.xml slides/mongodb/sharding-add-shard.xml slides/mongodb/sharding-auto-shard.xml slides/mongodb/sharding-balancing-tips.xml slides/mongodb/sharding-chunk-splitting.xml slides/mongodb/sharding-chunks.xml slides/mongodb/sharding-config-server.xml slides/mongodb/sharding-connecting.xml slides/mongodb/sharding-data-store-now.xml slides/m
[email protected] (Derick Rethans)
| Newsgroups | php.pres |
|---|---|
| Message-ID | <[email protected]> |
Commit: 9eaa67d4d7855a6c40b59928aa0886550e18bb74 Author: Jeremy Mikola <[email protected]> Sun, 17 May 2015 17:56:35 -0500 Parents: ad408ee352d066503ffe09e8f237b19975bf66c3 Branches: master Link: http://git.php.net/?p=presentations.git;a=commitdiff;h=9eaa67d4d7855a6c40b59928aa0886550e18bb74 Log: Content revisions for sharding slides Changed paths: M mongo-tut-tek15.xml M slides/mongodb/sharding-acquire-lock.xml M slides/mongodb/sharding-add-shard.xml M slides/mongodb/sharding-auto-shard.xml M slides/mongodb/sharding-balancing-tips.xml M slides/mongodb/sharding-chunk-splitting.xml M slides/mongodb/sharding-chunks.xml M slides/mongodb/sharding-config-server.xml A slides/mongodb/sharding-connecting.xml M slides/mongodb/sharding-data-store-now.xml M slides/mongodb/sharding-enable.xml M slides/mongodb/sharding-example-setup.xml M slides/mongodb/sharding-geo-aware.xml M slides/mongodb/sharding-infrastructure.xml M slides/mongodb/sharding-key-example.xml M slides/mongodb/sharding-mongos-manages.xml M slides/mongodb/sharding-move-chunk.xml M slides/mongodb/sharding-non-targeted-query.xml M slides/mongodb/sharding-non-targeted-query1.xml M slides/mongodb/sharding-non-targeted-with-sort-query.xml M slides/mongodb/sharding-non-targeted-with-sort-query1.xml M slides/mongodb/sharding-partitioning.xml M slides/mongodb/sharding-routing-types.xml M slides/mongodb/sharding-shard-key.xml M slides/mongodb/sharding-start-mongos.xml M slides/mongodb/sharding-tag-shard-range.xml
diff_9eaa67d4d7855a6c40b59928aa0886550e18bb74.txt
(text/plain, 14.6 KB)
diff --git a/mongo-tut-tek15.xml b/mongo-tut-tek15.xml
index 809bbb5..65de801 100644
--- a/mongo-tut-tek15.xml
+++ b/mongo-tut-tek15.xml
@@ -219,6 +219,7 @@ Common Patterns
<slide>slides/mongodb/sharding-key-example.xml</slide>
<slide>slides/mongodb/sharding-key-example2.xml</slide>
+<slide>slides/mongodb/sharding-connecting.xml</slide>
<slide>slides/mongodb/sharding-mechanics.xml</slide>
<slide>slides/mongodb/sharding-partitioning.xml</slide>
diff --git a/slides/mongodb/sharding-acquire-lock.xml b/slides/mongodb/sharding-acquire-lock.xml
index b6cf4a3..b6dcbb8 100644
--- a/slides/mongodb/sharding-acquire-lock.xml
+++ b/slides/mongodb/sharding-acquire-lock.xml
@@ -1,12 +1,12 @@
<slide>
-<title>Acquiring the Balancer lock</title>
+<title>Acquiring the balancer lock</title>
<image filename="acquire-lock.png"/>
<list>
<bullet>The balancer on mongos takes out a "balancer" lock</bullet>
<bullet>
- To see the status of these locks:
+ To see the status of this lock:
<list>
<bullet>%use config%</bullet>
<bullet>%db.locks.find({ _id: "balancer" })%</bullet>
diff --git a/slides/mongodb/sharding-add-shard.xml b/slides/mongodb/sharding-add-shard.xml
index 061a234..57af643 100644
--- a/slides/mongodb/sharding-add-shard.xml
+++ b/slides/mongodb/sharding-add-shard.xml
@@ -4,8 +4,7 @@
<image filename="add-shard.png"/>
<list>
- <bullet>On mongos:<br/>%sh.addShard('&lt;host&gt;:27018')%</bullet>
+ <bullet>On mongos:<br/>%sh.addShard('&lt;host&gt;:&lt;port&gt;')%</bullet>
<bullet>Adding a replica set:<br/>%sh.addShard('&lt;rsname&gt;/&lt;seedlist&gt;')%</bullet>
- <bullet>In 2.2 and later can use:<br/>%sh.addShard('&lt;host&gt;:&lt;port&gt;')%</bullet>
</list>
</slide>
diff --git a/slides/mongodb/sharding-auto-shard.xml b/slides/mongodb/sharding-auto-shard.xml
index 808ceb5..f16b3d1 100644
--- a/slides/mongodb/sharding-auto-shard.xml
+++ b/slides/mongodb/sharding-auto-shard.xml
@@ -10,8 +10,8 @@
<bullet>
Two steps
<list>
- <bullet>Enable Sharding for a database</bullet>
- <bullet>Shard collection within database</bullet>
+ <bullet>Enable sharding for a database</bullet>
+ <bullet>Shard collection(s) within database</bullet>
</list>
</bullet>
</list>
diff --git a/slides/mongodb/sharding-balancing-tips.xml b/slides/mongodb/sharding-balancing-tips.xml
index c4e2adf..e6d165a 100644
--- a/slides/mongodb/sharding-balancing-tips.xml
+++ b/slides/mongodb/sharding-balancing-tips.xml
@@ -2,7 +2,7 @@
<title>Balancing tips</title>
<list>
- <bullet>Run the balancer at low traffic times:
+ <bullet>Run the balancer during low traffic periods:
<example>use config;
db.settings.update(
@@ -11,6 +11,7 @@ db.settings.update(
);</example>
</bullet>
<bullet>Can be triggered manually using %moveChunk%</bullet>
+ <bullet>Pre-creating ranges for heavy insertion loads can avoid over-populating a single shard</bullet>
<bullet>Feel free to write your own smart balancer!</bullet>
</list>
</slide>
diff --git a/slides/mongodb/sharding-chunk-splitting.xml b/slides/mongodb/sharding-chunk-splitting.xml
index cbbc214..0964967 100644
--- a/slides/mongodb/sharding-chunk-splitting.xml
+++ b/slides/mongodb/sharding-chunk-splitting.xml
@@ -8,6 +8,6 @@
<bullet>A chunk is split once it exceeds the maximum size</bullet>
<bullet>There is no split point if all documents have the same shard key</bullet>
<bullet>Chunk split is a logical operation (no data is moved)</bullet>
- <bullet>If split creates too large of a discrepancy of chunk count across cluster a balancing round starts</bullet>
+ <bullet>If splitting creates too large a difference in chunks across the cluster, a balancing round starts</bullet>
</list>
</slide>
diff --git a/slides/mongodb/sharding-chunks.xml b/slides/mongodb/sharding-chunks.xml
index a0e0fd5..0c67b84 100644
--- a/slides/mongodb/sharding-chunks.xml
+++ b/slides/mongodb/sharding-chunks.xml
@@ -2,7 +2,7 @@
<title>Distribute data in chunks across nodes</title>
<list>
- <bullet>Initially 1 chunk</bullet>
+ <bullet>Initially one chunk</bullet>
<bullet>Default max chunk size: 64mb</bullet>
<bullet>MongoDB automatically splits & migrates chunks when max reached</bullet>
</list>
diff --git a/slides/mongodb/sharding-config-server.xml b/slides/mongodb/sharding-config-server.xml
index 4c48d0a..7b27afd 100644
--- a/slides/mongodb/sharding-config-server.xml
+++ b/slides/mongodb/sharding-config-server.xml
@@ -3,11 +3,11 @@
<list>
<bullet>
- Config Server
+ Config server
<list>
<bullet>Stores cluster chunk ranges and locations</bullet>
<bullet>Can have only 1 or 3 (production must have 3)</bullet>
- <bullet>Two phase commit (not a replica set)</bullet>
+ <bullet>Two-phase commit (not a replica set)</bullet>
</list>
</bullet>
</list>
diff --git a/slides/mongodb/sharding-connecting.xml b/slides/mongodb/sharding-connecting.xml
new file mode 100644
index 0000000..571ab59
--- /dev/null
+++ b/slides/mongodb/sharding-connecting.xml
@@ -0,0 +1,18 @@
+<slide>
+<title>Connection String</title>
+
+<example result="0"><![CDATA[<?php
+$m = new MongoClient( 'mongodb://localhost:27019' );
+
+$m = new MongoClient( 'mongodb://localhost:27019,example.com:27019' );
+
+$m = new MongoClient( 'mongodb://user:password@localhost:27019/demo', $options );
+?>]]></example>
+
+<list>
+ <bullet>Remember: mongos may be run on the app server</bullet>
+ <bullet>Add multiple hosts for redundancy</bullet>
+ <bullet>Don't use %->authenticate()%</bullet>
+</list>
+
+</slide>
diff --git a/slides/mongodb/sharding-data-store-now.xml b/slides/mongodb/sharding-data-store-now.xml
index 630b5a1..1b81ec5 100644
--- a/slides/mongodb/sharding-data-store-now.xml
+++ b/slides/mongodb/sharding-data-store-now.xml
@@ -8,8 +8,7 @@
<bullet>
A data store that is
<list>
- <bullet>Free</bullet>
- <bullet>Publicly available</bullet>
+ <bullet>Free and publicly available</bullet>
<bullet>Open source (https://github.com/mongodb/mongo)</bullet>
<bullet>Horizontally scalable</bullet>
<bullet>Application independent</bullet>
diff --git a/slides/mongodb/sharding-enable.xml b/slides/mongodb/sharding-enable.xml
index 8530027..d59321d 100644
--- a/slides/mongodb/sharding-enable.xml
+++ b/slides/mongodb/sharding-enable.xml
@@ -8,7 +8,7 @@
<bullet>Shard a collection with the given key:<br/>
%sh.shardCollection("&lt;dbname&gt;.people", {"country":1})%</bullet>
- <bullet>Use a compound shard key to prevent duplicates:<br/>
+ <bullet>Granular shard keys can avoid indivisible chunks:<br/>
%sh.shardCollection("&lt;dbname&gt;.cars", {"year":1, "uniqueid":1})%</bullet>
</list>
diff --git a/slides/mongodb/sharding-example-setup.xml b/slides/mongodb/sharding-example-setup.xml
index b7cf1df..89b5044 100644
--- a/slides/mongodb/sharding-example-setup.xml
+++ b/slides/mongodb/sharding-example-setup.xml
@@ -6,9 +6,9 @@
<list>
<bullet>*Don’t use this setup in production!*
<list>
- <bullet>Only one Config server (No Fault Tolerance)</bullet>
- <bullet>Shard not in a replica set (Low Availability)</bullet>
- <bullet>Only one Mongos and shard (No Performance Improvement)</bullet>
+ <bullet>Only one config server (no fault tolerance)</bullet>
+ <bullet>Shard is not a replica set (low availability)</bullet>
+ <bullet>Only one mongos and shard (no performance improvement)</bullet>
<bullet>Useful for development or demonstrating configuration mechanics</bullet>
</list>
</bullet>
diff --git a/slides/mongodb/sharding-geo-aware.xml b/slides/mongodb/sharding-geo-aware.xml
index 89e7bf0..a052c4d 100644
--- a/slides/mongodb/sharding-geo-aware.xml
+++ b/slides/mongodb/sharding-geo-aware.xml
@@ -1,5 +1,5 @@
<slide>
-<title>Tag based sharding</title>
+<title>Tag Aware Sharding</title>
<image filename="shard-geo.png"/>
</slide>
diff --git a/slides/mongodb/sharding-infrastructure.xml b/slides/mongodb/sharding-infrastructure.xml
index b736ad1..e455d15 100644
--- a/slides/mongodb/sharding-infrastructure.xml
+++ b/slides/mongodb/sharding-infrastructure.xml
@@ -3,5 +3,5 @@
<image filename="sharding-infrastructure.png"/>
-<blurb align="center">Sharding infrastructure</blurb>
+<blurb align="center">Sharding Infrastructure</blurb>
</slide>
diff --git a/slides/mongodb/sharding-key-example.xml b/slides/mongodb/sharding-key-example.xml
index 585504d..d4dbc06 100644
--- a/slides/mongodb/sharding-key-example.xml
+++ b/slides/mongodb/sharding-key-example.xml
@@ -8,14 +8,13 @@
time: ISODate( '2013-04-24 10:38:05 '),
subject: "This is a test",
recipients: [ "[email protected]", "[email protected]" ],
- body: "...",
- continent: "Asia",
+ body: "..."
}
</example>
<list>
<bullet>Lots of emails per user</bullet>
<bullet>Most common query: get user emails sorted by time</bullet>
- <bullet>Index on %{ _id }%, %{ user, time }%, and %{ recipients }%</bullet>
+ <bullet>Index on %{ _id: 1 }%, %{ user: 1, time: -1 }%, <br/>and %{ recipients: 1 }%</bullet>
</list>
</slide>
diff --git a/slides/mongodb/sharding-mongos-manages.xml b/slides/mongodb/sharding-mongos-manages.xml
index 1e406bb..d9a2897 100644
--- a/slides/mongodb/sharding-mongos-manages.xml
+++ b/slides/mongodb/sharding-mongos-manages.xml
@@ -7,8 +7,7 @@
<list>
<bullet>Acts as a router / balancer</bullet>
<bullet>No local data (persists to config database)</bullet>
- <bullet>Can have 1 or many</bullet>
- <bullet>Should have it on each application server as proxy</bullet>
+ <bullet>Can have one or many (e.g. each application server)</bullet>
</list>
</blurb>
</list>
diff --git a/slides/mongodb/sharding-move-chunk.xml b/slides/mongodb/sharding-move-chunk.xml
index 9f78749..4d0b451 100644
--- a/slides/mongodb/sharding-move-chunk.xml
+++ b/slides/mongodb/sharding-move-chunk.xml
@@ -6,6 +6,6 @@
<list>
<bullet>The mongos sends a "moveChunk" command to source shard</bullet>
<bullet>The source shard then notifies destination shard</bullet>
- <bullet>The destination claims the chunk shard-key range</bullet>
+ <bullet>The destination claims the chunk's shard key range</bullet>
</list>
</slide>
diff --git a/slides/mongodb/sharding-non-targeted-query.xml b/slides/mongodb/sharding-non-targeted-query.xml
index 7043dc1..6f17217 100644
--- a/slides/mongodb/sharding-non-targeted-query.xml
+++ b/slides/mongodb/sharding-non-targeted-query.xml
@@ -3,5 +3,5 @@
<image filename="nontargetted.png"/>
-<blurb align="center">Cluster Request Routing: Non Targeted Query</blurb>
+<blurb align="center">Cluster Request Routing: Scatter / Gather Query</blurb>
</slide>
diff --git a/slides/mongodb/sharding-non-targeted-query1.xml b/slides/mongodb/sharding-non-targeted-query1.xml
index fc47811..dde781e 100644
--- a/slides/mongodb/sharding-non-targeted-query1.xml
+++ b/slides/mongodb/sharding-non-targeted-query1.xml
@@ -3,5 +3,5 @@
<image filename="nontargetted1.png"/>
-<blurb align="center">Non-Targeted Request Received</blurb>
+<blurb align="center">Scatter / Gather Request Received</blurb>
</slide>
diff --git a/slides/mongodb/sharding-non-targeted-with-sort-query.xml b/slides/mongodb/sharding-non-targeted-with-sort-query.xml
index fc25e8a..35500f9 100644
--- a/slides/mongodb/sharding-non-targeted-with-sort-query.xml
+++ b/slides/mongodb/sharding-non-targeted-with-sort-query.xml
@@ -3,5 +3,5 @@
<image filename="nontargetted-sort.png"/>
-<blurb align="center">Cluster Request Routing: Non Targeted Query with Sort</blurb>
+<blurb align="center">Cluster Request Routing: Scatter / Gather Query with Sort</blurb>
</slide>
diff --git a/slides/mongodb/sharding-non-targeted-with-sort-query1.xml b/slides/mongodb/sharding-non-targeted-with-sort-query1.xml
index b230a49..8b23b54 100644
--- a/slides/mongodb/sharding-non-targeted-with-sort-query1.xml
+++ b/slides/mongodb/sharding-non-targeted-with-sort-query1.xml
@@ -3,5 +3,5 @@
<image filename="nontargetted-sort1.png"/>
-<blurb align="center">Non-Targetted Request with Sort Received</blurb>
+<blurb align="center">Scatter / Gather Request with Sort Received</blurb>
</slide>
diff --git a/slides/mongodb/sharding-partitioning.xml b/slides/mongodb/sharding-partitioning.xml
index 2a660eb..a8d4613 100644
--- a/slides/mongodb/sharding-partitioning.xml
+++ b/slides/mongodb/sharding-partitioning.xml
@@ -2,7 +2,7 @@
<title>Partitioning</title>
<list>
- <bullet>Remember it's based on ranges</bullet>
+ <bullet>Remember: it's based on ranges</bullet>
</list>
diff --git a/slides/mongodb/sharding-routing-types.xml b/slides/mongodb/sharding-routing-types.xml
index 620bec5..0447dbb 100644
--- a/slides/mongodb/sharding-routing-types.xml
+++ b/slides/mongodb/sharding-routing-types.xml
@@ -3,7 +3,7 @@
<list>
<bullet>Targeted Queries</bullet>
- <bullet>Scatter Gather Queries</bullet>
- <bullet>Scatter Gather Queries with Sort</bullet>
+ <bullet>Scatter / Gather Queries</bullet>
+ <bullet>Scatter / Gather Queries with Sort</bullet>
</list>
</slide>
diff --git a/slides/mongodb/sharding-shard-key.xml b/slides/mongodb/sharding-shard-key.xml
index 53a65fe..1393483 100644
--- a/slides/mongodb/sharding-shard-key.xml
+++ b/slides/mongodb/sharding-shard-key.xml
@@ -2,7 +2,6 @@
<title>Shard Key</title>
<list>
- <bullet>Choose a field common used in queries</bullet>
<bullet>Shard key is *immutable*</bullet>
<bullet>Shard key values are *immutable*</bullet>
<bullet>Shard key requires index on fields contained in key</bullet>
diff --git a/slides/mongodb/sharding-start-mongos.xml b/slides/mongodb/sharding-start-mongos.xml
index 1c05c0c..75c883f 100644
--- a/slides/mongodb/sharding-start-mongos.xml
+++ b/slides/mongodb/sharding-start-mongos.xml
@@ -6,6 +6,6 @@
<list>
<bullet>%mongos --configdb &lt;hostname&gt;:27019%</bullet>
<bullet>For 3 config servers:<br/> %mongos --configdb &lt;host1&gt;:&lt;port1&gt;,&lt;host2&gt;:&lt;port2&gt;,&lt;host3&gt;:&lt;port3&gt;%</bullet>
- <bullet>This is always how to start a new mongos, even if the cluster is already running</bullet>
+ <bullet>This is how one always starts a new mongos, even if the cluster is already running</bullet>
</list>
</slide>
diff --git a/slides/mongodb/sharding-tag-shard-range.xml b/slides/mongodb/sharding-tag-shard-range.xml
index b4999e2..a43fe61 100644
--- a/slides/mongodb/sharding-tag-shard-range.xml
+++ b/slides/mongodb/sharding-tag-shard-range.xml
@@ -10,7 +10,7 @@
<example>
sh.addTagRange(
"demo.emails", // database.collection
- { continent: "Asia" }, { continent: "Australia" }, // range
+ { continent: "Asia" }, { continent: "Australia" }, // range (min, max)
"ASIA" // tag
);
sh.addTagRange(