com presentations: Slide updates for Scaling Talk.: mongo-scaling-phpnw16.xml slides/mongodb/read-preference.xml slides/mongodb/read-preference2.xml slides/mongodb/repl-eventual-consistency.xml slides/mongodb/repl-priorities.png slides/mongodb/repl-priorities3.xml slides/mongodb/repl-set2.xml slides/mongodb/repl-set3.xml slides/mongodb/repl-set5.xml slides/mongodb/repl-set6.png slides/mongodb/repl-types-of-outage.xml slides/mongodb/repl-typical.x
[email protected] (Derick Rethans) Wed, 28 Sep 2016 14:22:23 +0000
| Newsgroups | php.pres |
|---|---|
| Message-ID | <[email protected]> |
Commit: 23e62764b7d67547d4379225926aba704d4ad276 Author: Derick Rethans <[email protected]> Wed, 28 Sep 2016 15:22:23 +0100 Parents: eaa81ca78f7cdc73ea791f5181b7473ad0d8252a Branches: master Link: http://git.php.net/?p=presentations.git;a=commitdiff;h=23e62764b7d67547d4379225926aba704d4ad276 Log: Slide updates for Scaling Talk. Changed paths: M mongo-scaling-phpnw16.xml M slides/mongodb/read-preference.xml M slides/mongodb/read-preference2.xml M slides/mongodb/repl-eventual-consistency.xml M slides/mongodb/repl-priorities.png M slides/mongodb/repl-priorities3.xml M slides/mongodb/repl-set2.xml M slides/mongodb/repl-set3.xml M slides/mongodb/repl-set5.xml M slides/mongodb/repl-set6.png M slides/mongodb/repl-types-of-outage.xml M slides/mongodb/repl-typical.xml M slides/mongodb/repl-use-cases.xml M slides/mongodb/repl-write-concern.xml M slides/mongodb/sharding-chunks.xml M slides/mongodb/sharding-config-server.xml M slides/mongodb/sharding-connecting.xml M slides/mongodb/sharding-data-store-now.xml
diff_23e62764b7d67547d4379225926aba704d4ad276.txt
(text/plain, 11.6 KB)
diff --git a/mongo-scaling-phpnw16.xml b/mongo-scaling-phpnw16.xml
index 23b5828..bd3273d 100644
--- a/mongo-scaling-phpnw16.xml
+++ b/mongo-scaling-phpnw16.xml
@@ -134,6 +134,7 @@
<slide>slides/mongodb/sharding-add-tag.xml</slide>
<slide>slides/mongodb/sharding-tag-shard-range.xml</slide>
-->
+<slide>slides/mongodb/mongodbeurope16.xml</slide>
<slide>slides/mongodb/questions.xml</slide>
<slide>slides/mongodb/resources.xml</slide>
</presentation>
diff --git a/slides/mongodb/read-preference.xml b/slides/mongodb/read-preference.xml
index 80b84b6..a0a8023 100644
--- a/slides/mongodb/read-preference.xml
+++ b/slides/mongodb/read-preference.xml
@@ -2,19 +2,24 @@
<title>Read preferences</title>
<example result="0"><![CDATA[<?php
-$m = new MongoClient(
- 'mongodb://localhost:13000/?' .
- 'replicaSet=poiset&readPreference=nearest&readPreferenceTags=dc:asia'
+$m = new \Mongo\Driver\Manager(
+ 'mongodb://localhost:13000/?replicaSet=poiset' .
+ '&readPreference=nearest&readPreferenceTags=dc:asia'
);
-$c = $m->phpunit->test;
-$c->find(...);
+
+$m->executeQuery( 'demo.test', $query );
?>]]></example>
-<blurb>or:</blurb>
+<blurb>or per-query:</blurb>
<example result="0"><![CDATA[<?php
-$m = new MongoClient( 'mongodb://localhost:13000/?replicaSet=poiset' );
-$c = $m->phpunit->test;
-$c->setReadPreference( Mongo::RP_SECONDARY, [ 'dc' => 'europe' ] );
-$c->find(...);
+$m = new \Mongo\Driver\Manager(
+ 'mongodb://localhost:13000/?replicaSet=poiset'
+);
+
+$rp = new MongoDB\Driver\ReadPreference(
+ MongoDB\Driver\ReadPreference::RP_NEAREST, [ [ 'dc' => 'asia' ] ]
+);
+
+$m->executeQuery( 'demo.test', $query, $rp );
?>]]></example>
</slide>
diff --git a/slides/mongodb/read-preference2.xml b/slides/mongodb/read-preference2.xml
index 0155750..ae4d7ee 100644
--- a/slides/mongodb/read-preference2.xml
+++ b/slides/mongodb/read-preference2.xml
@@ -1,18 +1,16 @@
<slide>
<title>Read preferences</title>
-<blurb>Allows the driver to select between candidate servers from a specific
-set</blurb>
+<blurb>Select between candidate servers from a specific set</blurb>
<list>
<bullet>primary (default)</bullet>
<bullet>primary_preferred (%Mongo::RP_PRIMARY_PREFERRED%)</bullet>
<bullet>secondary</bullet>
- <bullet>secondary_preferred (default when old slaveOkay is used)</bullet>
- <bullet>nearest (within 15ms of closest)</bullet>
+ <bullet>secondary_preferred</bullet>
+ <bullet>nearest</bullet>
</list>
<break/>
<list>
- <bullet>You can restrict the candidates with read preference tags</bullet>
<bullet>Only the candidates within 15ms ping time from the fastest are used</bullet>
<bullet>Random (per-query) among the matched sets</bullet>
</list>
diff --git a/slides/mongodb/repl-eventual-consistency.xml b/slides/mongodb/repl-eventual-consistency.xml
index f0e0621..cc2cd4a 100644
--- a/slides/mongodb/repl-eventual-consistency.xml
+++ b/slides/mongodb/repl-eventual-consistency.xml
@@ -2,7 +2,7 @@
<title>Eventual consistency</title>
<list>
- <bullet>Read Preference / Slave Okay
+ <bullet>Read Preferences (except %RP_PRIMARY%)
<list>
<bullet>Driver will always send writes to primary</bullet>
<bullet>Driver will send read requests to secondaries</bullet>
diff --git a/slides/mongodb/repl-priorities.png b/slides/mongodb/repl-priorities.png
index 2fc9eac..5a4e27b 100644
Binary files a/slides/mongodb/repl-priorities.png and b/slides/mongodb/repl-priorities.png differ
diff --git a/slides/mongodb/repl-priorities3.xml b/slides/mongodb/repl-priorities3.xml
index 0024934..fc8db22 100644
--- a/slides/mongodb/repl-priorities3.xml
+++ b/slides/mongodb/repl-priorities3.xml
@@ -3,7 +3,6 @@
<image filename="repl-priorities.png"/>
<list>
- <bullet>Assuming all members are up to date</bullet>
<bullet>Members A or B will be chosen first
<list>
<bullet>Highest priority</bullet>
@@ -11,13 +10,12 @@
</bullet>
<bullet>Members C or D will be chosen when:
<list>
- <bullet>A and B are unavailable</bullet>
- <bullet>A and B are not up to date</bullet>
+ <bullet>A and B are unavailable, or not up to date</bullet>
</list>
</bullet>
<bullet>Member E is never chosen
<list>
- <bullet>priority:0 means it cannot be elected</bullet>
+ <bullet>%priority: 0% means it cannot be elected</bullet>
</list>
</bullet>
</list>
diff --git a/slides/mongodb/repl-set2.xml b/slides/mongodb/repl-set2.xml
index 42e1dbe..e538831 100644
--- a/slides/mongodb/repl-set2.xml
+++ b/slides/mongodb/repl-set2.xml
@@ -7,7 +7,7 @@
<bullet>Single datacentre</bullet>
<bullet>Multiple power/network zones</bullet>
<bullet>Automatic recovery of single node crash</bullet>
- <bullet>w=2 not viable as losing one node means no writes</bullet>
+ <bullet>%w=majority% not viable as no writes with losing a node</bullet>
<bullet>Points of failure:
<list>
<bullet>Datacentre</bullet>
diff --git a/slides/mongodb/repl-set3.xml b/slides/mongodb/repl-set3.xml
index 6ac5b2a..cbebe57 100644
--- a/slides/mongodb/repl-set3.xml
+++ b/slides/mongodb/repl-set3.xml
@@ -7,7 +7,7 @@
<bullet>Single datacentre</bullet>
<bullet>Multiple power/network zones</bullet>
<bullet>Automatic recovery of single node crash</bullet>
- <bullet>w=2 viable as 2 out of 3 nodes available</bullet>
+ <bullet>%w=majority% viable as 2 out of 3 nodes available</bullet>
<bullet>Points of failure:
<list>
<bullet>Datacentre</bullet>
diff --git a/slides/mongodb/repl-set5.xml b/slides/mongodb/repl-set5.xml
index 6c31cb4..c6b83c0 100644
--- a/slides/mongodb/repl-set5.xml
+++ b/slides/mongodb/repl-set5.xml
@@ -6,6 +6,6 @@
<list>
<bullet>Three datacentres</bullet>
<bullet>Can survive full datacentre loss</bullet>
- <bullet>Can do %w = { dc : 2 }% to guarantee write in two datacentres</bullet>
+ <bullet>Can do %w = { dc : 2 }% to guarantee write in two DCs</bullet>
</list>
</slide>
diff --git a/slides/mongodb/repl-set6.png b/slides/mongodb/repl-set6.png
index 200a5de..245b046 100644
Binary files a/slides/mongodb/repl-set6.png and b/slides/mongodb/repl-set6.png differ
diff --git a/slides/mongodb/repl-types-of-outage.xml b/slides/mongodb/repl-types-of-outage.xml
index 36fe425..7960233 100644
--- a/slides/mongodb/repl-types-of-outage.xml
+++ b/slides/mongodb/repl-types-of-outage.xml
@@ -4,7 +4,6 @@
<blurb>Planned</blurb>
<list>
<bullet>Hardware upgrade</bullet>
- <bullet>O/S or file-system tuning</bullet>
<bullet>Relocation of data to new file-system / storage</bullet>
<bullet>Software upgrade</bullet>
</list>
@@ -15,6 +14,5 @@
<bullet>Data center failure</bullet>
<bullet>Region outage</bullet>
<bullet>Human error</bullet>
- <bullet>Application corruption</bullet>
</list>
</slide>
diff --git a/slides/mongodb/repl-typical.xml b/slides/mongodb/repl-typical.xml
index dd62941..a29ce28 100644
--- a/slides/mongodb/repl-typical.xml
+++ b/slides/mongodb/repl-typical.xml
@@ -4,9 +4,9 @@
<table>
<tr><th>Use</th><th>Set size</th><th>Data protection</th><th>High Availability</th><th>Notes</th></tr>
<tr><td> </td><td>1</td><td>No </td><td>No</td><td>Must use --journal to protect against crashes</td></tr>
-<tr><td>✔</td><td>2</td><td>Yes</td><td>No</td><td>On loss of one member, set becomes read-only</td></tr>
-<tr><td>✔</td><td>3</td><td>Yes</td><td>Yes - 1 failure</td><td>On loss of one member, two surviving nodes can elect new primary</td></tr>
+<tr><td>|008800|✔|</td><td>2</td><td>Yes</td><td>No</td><td>On loss of one member, set becomes read-only</td></tr>
+<tr><td>|008800|✔|</td><td>3</td><td>Yes</td><td>Yes - 1 failure</td><td>On loss of one member, two surviving nodes can elect new primary</td></tr>
<tr><td> </td><td>4</td><td>Yes</td><td>Yes - 1 failure</td><td>On loss of two members, two surviving nodes are read-only</td></tr>
-<tr><td>✔</td><td>5</td><td>Yes</td><td>Yes - 2 failures</td><td>On loss of two members, three surviving nodes can elect new primary</td></tr>
+<tr><td>|008800|✔|</td><td>5</td><td>Yes</td><td>Yes - 2 failures</td><td>On loss of two members, three surviving nodes can elect new primary</td></tr>
</table>
</slide>
diff --git a/slides/mongodb/repl-use-cases.xml b/slides/mongodb/repl-use-cases.xml
index d0264d6..2a75f6a 100644
--- a/slides/mongodb/repl-use-cases.xml
+++ b/slides/mongodb/repl-use-cases.xml
@@ -14,7 +14,7 @@
<list>
<bullet>Analytics</bullet>
<bullet>Data-processing</bullet>
- <bullet>Integration with external systems (f.e. Solr)</bullet>
+ <bullet>Integration with external systems (f.e. ElasticSearch)</bullet>
</list>
</bullet>
</list>
diff --git a/slides/mongodb/repl-write-concern.xml b/slides/mongodb/repl-write-concern.xml
index f4bb1f9..3df5066 100644
--- a/slides/mongodb/repl-write-concern.xml
+++ b/slides/mongodb/repl-write-concern.xml
@@ -1,10 +1,20 @@
<slide>
<title>Write concerns</title>
+<example><![CDATA[<?php
+$manager = new MongoDB\Driver\Manager('mongodb://localhost:27017');
+
+$bulk = new MongoDB\Driver\BulkWrite();
+$bulk->insert(['_id' => 1, 'x' => 1]);
+
+$result = $manager->executeBulkWrite( 'db.collection', $bulk, $wc );
+]]></example>
+
<list>
- <bullet>Safe mode:<br/>%$c->insert( [ 'text' => 'example' ], [ 'w' => 1 ] );%</bullet>
- <bullet>Two nodes:<br/>%$c->insert( [ 'text' => 'example' ], [ 'w' => 2 ] );%</bullet>
- <bullet>Majority of nodes:<br/>%$c->insert( [ 'text' => 'example' ], [ 'w' => "majority" ] );%</bullet>
- <bullet>Tagged nodes:<br/>%$c->insert( [ 'text' => 'example' ], [ 'w' => "allDCs" ] );%</bullet>
+ <bullet>Two nodes:<br/><example>$wc = new MongoDB\Driver\WriteConcern( 2 );</example></bullet>
+ <bullet>Majority of nodes:<br/><example>$wc = new MongoDB\Driver\WriteConcern( MongoDB\Driver\WriteConcern::MAJORITY );</example></bullet>
+ <bullet>With timeout:<br/><example>$wc = new MongoDB\Driver\WriteConcern(
+ MongoDB\Driver\WriteConcern::MAJORITY, 10000
+);</example></bullet>
</list>
</slide>
diff --git a/slides/mongodb/sharding-chunks.xml b/slides/mongodb/sharding-chunks.xml
index 0c67b84..5a646b3 100644
--- a/slides/mongodb/sharding-chunks.xml
+++ b/slides/mongodb/sharding-chunks.xml
@@ -3,7 +3,7 @@
<list>
<bullet>Initially one chunk</bullet>
- <bullet>Default max chunk size: 64mb</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 07d4233..61dd94c 100644
--- a/slides/mongodb/sharding-config-server.xml
+++ b/slides/mongodb/sharding-config-server.xml
@@ -6,13 +6,9 @@
Config server
<list>
<bullet>Stores cluster chunk ranges and locations</bullet>
- <bullet>Can have only 1 or 3 (production must have 3)</bullet>
<bullet>A Replica Set</bullet>
+ <bullet>No arbiters or delayed members</bullet>
</list>
</bullet>
</list>
-
-<break lines="2"/>
-
-<image filename="config-server.png"/>
</slide>
diff --git a/slides/mongodb/sharding-connecting.xml b/slides/mongodb/sharding-connecting.xml
index 14ecf4a..0824da8 100644
--- a/slides/mongodb/sharding-connecting.xml
+++ b/slides/mongodb/sharding-connecting.xml
@@ -7,6 +7,8 @@ $m = new \MongoDB\Client( 'mongodb://localhost:27019' );
$m = new \MongoDB\Client( 'mongodb://localhost:27019,example.com:27019' );
$m = new \MongoDB\Client( 'mongodb://user:password@localhost:27019/demo', $options );
+
+$m = new \MongoDB\Client( 'mongodb:///tmp/mysocket.sock' );
?>]]></example>
<list>
diff --git a/slides/mongodb/sharding-data-store-now.xml b/slides/mongodb/sharding-data-store-now.xml
index 1b81ec5..ac4a3f8 100644
--- a/slides/mongodb/sharding-data-store-now.xml
+++ b/slides/mongodb/sharding-data-store-now.xml
@@ -3,7 +3,7 @@
<list>
<bullet>
- MongoDB auto-sharding available in 2009
+ MongoDB auto-sharding available
</bullet>
<bullet>
A data store that is