Added FrOSCon slides with polishes

This commit is contained in:
Derick Rethans
2017-08-17 12:34:06 +01:00
parent c6b71cf138
commit 62549591a4
14 changed files with 289 additions and 39 deletions

116
jump-froscon17.xml Normal file
View File

@@ -0,0 +1,116 @@
<?xml version="1.0" encoding="utf-8"?>
<presentation css="10gen-strict.css">
<topic>PHP</topic>
<title>It's All About the Goto</title>
<event>FrOSCon</event>
<location>Sankt Augustin, Germany</location>
<date>August 20th, 2017</date>
<speaker>Derick Rethans</speaker>
<email>derick@php.net</email>
<twitter>derickr</twitter>
<joindin>https://derickrethans.nl/talks/jump-froscon17</joindin>
<slide>slides/mongodb/title.xml</slide>
<slide>slides/mongodb/me.xml</slide>
<slide>slides/internals/title-agenda.xml</slide>
<slide>slides/internals/title-stages.xml</slide>
<!-- INTRODUCTION
Compile stages:
Parse script
Create AST
Convert to opcodes
Run the code
Opcache for caching
-->
<slide>slides/internals/stages.xml</slide>
<!-- STAGES
Parse
- Show parser rules
- Show "compiler" rules
-->
<slide>slides/internals/title-parsing.xml</slide>
<slide>slides/internals/parse-state-machine.xml</slide>
<slide>slides/internals/parse-tokenization.xml</slide>
<slide>slides/internals/scanner.xml</slide>
<slide>slides/internals/scanner-rules.xml</slide>
<slide>slides/internals/ast.xml</slide>
<slide>slides/internals/ast1.xml</slide>
<slide>slides/internals/scanner-ast.xml</slide>
<slide>slides/internals/scanner-ast2.xml</slide>
<slide>slides/internals/bytecode0.xml</slide>
<slide>slides/internals/bytecode½.xml</slide>
<slide>slides/internals/bytecode1.xml</slide>
<slide>slides/internals/jumps.xml</slide>
<!--
AST
- Show AST for various control structures
Opcodes
- Show AST for the same control structures
-->
<slide>slides/internals/jumps-if.xml</slide>
<slide>slides/internals/jumps-if-else.xml</slide>
<slide>slides/internals/rings.xml</slide>
<slide>slides/internals/jumps-for.xml</slide>
<slide>slides/internals/jumps-for-rewritten.xml</slide>
<slide>slides/internals/jumps-while.xml</slide>
<slide>slides/internals/jumps-do-while.xml</slide>
<slide>slides/internals/jumps-foreach.xml</slide>
<slide>slides/internals/jumps-complex.xml</slide>
<slide>slides/internals/loops.xml</slide>
<slide>slides/internals/jumps-complex-dot.xml</slide>
<!--
Try/Catch nonsense
- FASTCALL/FASTRET
-->
<slide>slides/internals/catch.xml</slide>
<slide>slides/internals/jumps-try-catch.xml</slide>
<!--
Dead code analysis
- Show how Xdebug does it through VLD
-->
<slide>slides/internals/deadcode.xml</slide>
<slide>slides/internals/deadcode-vld.xml</slide>
<!--
Path analysis
- Branch and Path
-->
<slide>slides/internals/branches.xml</slide>
<slide>slides/xdebug/vld-path-2-paths.xml</slide>
<slide>slides/xdebug/vld-path-4-code.xml</slide>
<slide>slides/xdebug/vld-path-4-output.xml</slide>
<slide>slides/xdebug/vld-path-3-code.xml</slide>
<slide>slides/xdebug/vld-path-3-output.xml</slide>
<slide>slides/xdebug/vld-path-3-paths.xml</slide>
<!-- Conclusion
Code -> Tokens -> AST -> opode
Transformation of control structures
Useful implementations
-->
<slide>slides/internals/recap.xml</slide>
<slide>slides/internals/recap-content.xml</slide>
<slide>slides/mongodb/questions.xml</slide>
<slide>slides/mongodb/resources.xml</slide>
</presentation>

142
nonscalar-froscon17.xml Normal file
View File

@@ -0,0 +1,142 @@
<?xml version="1.0" encoding="utf-8"?>
<presentation css="10gen-strict.css">
<topic>MongoDB</topic>
<title>Storing Non-Scalar Data</title>
<event>FrOSCon</event>
<location>Sankt Augustin, Germany</location>
<date>August 19th, 2017</date>
<speaker>Derick Rethans</speaker>
<email>derick@mongodb.com</email>
<twitter>derickr</twitter>
<url>http://derickrethans.nl/talks.html</url>
<joindin>https://derickrethans.nl/talks/nonscalar-froscon17</joindin>
<slide>slides/mongodb/title.xml</slide>
<slide>slides/mongodb/me.xml</slide>
<slide>slides/mongodb/scalar-non-scalar-examples.xml</slide>
<!-- <slide>slides/mongodb/scalar-non-scalar-example-vector.xml</slide> -->
<slide>slides/mongodb/scalar-non-scalar-example-tag-cloud.xml</slide>
<slide>slides/mongodb/scalar-non-scalar-example-product-properties.xml</slide>
<!-- <slide>slides/mongodb/scalar-non-scalar-example-addresses.xml</slide> -->
<slide>slides/mongodb/scalar-what-is-it-not.xml</slide>
<slide>slides/mongodb/scalar-agenda.xml</slide>
Intro into DB types and their data types
<slide>slides/mongodb/scalar-section-dbs-and-types.xml</slide>
Key/Value:
Redis
LISTS
SETS
HASHES
Sorted SET
<slide>slides/mongodb/scalar-key-value.xml</slide>
<slide>slides/mongodb/scalar-redis.xml</slide>
<!-- <slide>slides/mongodb/scalar-redis-lists.xml</slide> -->
<slide>slides/mongodb/scalar-redis-sets.xml</slide>
<slide>slides/mongodb/scalar-redis-hashses.xml</slide>
<!-- <slide>slides/mongodb/scalar-redis-sorted-set.xml</slide> -->
Document:
MongoDB
CouchDB
Elastic Search
<slide>slides/mongodb/scalar-document.xml</slide>
<slide>slides/mongodb/scalar-mongodb.xml</slide>
<slide>slides/mongodb/document-complex.xml</slide>
<slide>slides/mongodb/phplib-crud-insert.xml</slide>
<slide>slides/mongodb/scalar-couchdb.xml</slide>
<slide>slides/mongodb/scalar-couchdb-example.xml</slide>
<slide>slides/mongodb/scalar-couchdb-insert.xml</slide>
<slide>slides/mongodb/scalar-elasticsearch.xml</slide>
<slide>slides/mongodb/scalar-elasticsearch-example.xml</slide>
<slide>slides/mongodb/scalar-elasticsearch-insert.xml</slide>
Relational:
MySQL
JSON
PostgreSQL
HSTORE
JSON
JSONB
<slide>slides/mongodb/scalar-relational.xml</slide>
<slide>slides/mongodb/scalar-mysql.xml</slide>
<slide>slides/mongodb/scalar-mysql-json.xml</slide>
<slide>slides/mongodb/scalar-mysql-json-example.xml</slide>
<slide>slides/mongodb/scalar-postgresql.xml</slide>
<slide>slides/mongodb/scalar-postgresql-hstore.xml</slide>
<slide>slides/mongodb/scalar-postgresql-jsonb.xml</slide>
<slide>slides/mongodb/scalar-postgresql-jsonb-example.xml</slide>
<!-- <slide>slides/mongodb/scalar-storage-overview.xml</slide> -->
<slide>slides/mongodb/scalar-section-query.xml</slide>
Manipulation
Query
Query operators for $in, $elemMatch, etc
Query operations on nested fields
<slide>slides/mongodb/scalar-query-redis.xml</slide>
<slide>slides/mongodb/scalar-query-couchdb.xml</slide>
<slide>slides/mongodb/scalar-query-mongodb.xml</slide>
<slide>slides/mongodb/scalar-query-mongodb-aggregation.xml</slide>
<slide>slides/mongodb/scalar-query-elasticsearch.xml</slide>
<slide>slides/mongodb/scalar-query-mysql.xml</slide>
<slide>slides/mongodb/scalar-query-postgresql-hstore.xml</slide>
<!-- <slide>slides/mongodb/scalar-query-postgresql-jsonb.xml</slide> -->
Indexes
Redis
MongoDB
CouchDB
ElasticSearch
MySQL
only through virtual columns
Not on arrays
PostgreSQL
GIN/GIST
Geospatial from GeoJSON sources (not PostGIS)
<slide>slides/mongodb/indexes-title.xml</slide>
<slide>slides/mongodb/scalar-index-redis.xml</slide>
<slide>slides/mongodb/scalar-index-couchdb.xml</slide>
<slide>slides/mongodb/index.xml</slide>
<slide>slides/mongodb/scalar-index-elasticsearch.xml</slide>
<slide>slides/mongodb/scalar-index-postgresql.xml</slide>
<slide>slides/mongodb/scalar-index-mysql.xml</slide>
<slide>slides/mongodb/scalar-section-manipulation.xml</slide>
Storing/Update
Atomicity
ACID
Single document with update specifiers
Partitioning on JSON data
Manipulation of JSON data
<slide>slides/mongodb/scalar-atomicity.xml</slide>
<!-- <slide>slides/mongodb/acid.xml</slide> -->
<slide>slides/mongodb/scalar-nosql-acid.xml</slide>
<slide>slides/mongodb/scalar-atomic-redis.xml</slide>
<slide>slides/mongodb/scalar-atomic-couchdb.xml</slide>
<slide>slides/mongodb/update-atomicity.xml</slide>
Schema validation
None can do that, besides MongoDB
<slide>slides/mongodb/scalar-validate.xml</slide>
<slide>slides/mongodb/document-validation.xml</slide>
<slide>slides/mongodb/scalar-conclusion.xml</slide>
Conclusion
<slide>slides/mongodb/questions.xml</slide>
<slide>slides/mongodb/resources.xml</slide>
</presentation>

View File

@@ -5,7 +5,6 @@
<bullet>New in MongoDB 3.2</bullet>
<bullet>Allows you to set a *validator*, a query that every new or updated document must match</bullet>
</list>
<break lines="1"/>
<blurb>Example:</blurb>
<example inline="1">
db.runCommand( {
@@ -18,4 +17,7 @@ db.runCommand( {
validationAction: *"warn"*, // error,
} )
</example>
<list>
<bullet>MongoDB 3.6 adds JSON Schema support</bullet>
</list>
</slide>

View File

@@ -7,8 +7,8 @@
<blurb>Derick Rethans</blurb>
<list>
<bullet>I'm ---Dutch/British--- European, living in London</bullet>
<bullet>One of the PHP/HHVM *MongoDB* driver maintainers</bullet>
<bullet>Author of the PHP debugger tool *Xdebug*, PHP's Date/Time/Timezone support, and a bunch of other PHP extensions</bullet>
<bullet>One of the *MongoDB* driver maintainers</bullet>
<bullet>Author of the PHP debugger tool *Xdebug*, PHP's Date/Time support, and a bunch of other PHP extensions</bullet>
<bullet>I ♥🌍 maps, I ♥🍺 beer, I ♥🥃 whisky</bullet>
<bullet>twitter: @derickr</bullet>
</list>

View File

@@ -2,6 +2,6 @@
<break/>
<qrcode>http://derickrethans.nl/talks/:-:talk_id:-:</qrcode>
<break/>
<blurb align="center" class="pres-url-small">:-:joindin:-:</blurb>
<blurb align="center" class="pres-url-small">:-:email:-:—@:-:twitter:-:</blurb>
<blurb align="center" class="pres-url-small">*Slides &amp; Resources*<br/>:-:joindin:-:</blurb>
<blurb align="center" class="pres-url-small">*Contact*<br/>:-:email:-:—@:-:twitter:-:</blurb>
</slide>

View File

@@ -2,7 +2,7 @@
<title>CouchDB</title>
<list>
<bullet>An Apache project</bullet>
<bullet>An Open Source Apache project</bullet>
<bullet>Documents are JSON objects</bullet>
<bullet>Interaction through REST API (curl), or an HTTP Client (like Guzzle)</bullet>
</list>

View File

@@ -4,7 +4,7 @@
<list>
<bullet>Richer Datatypes</bullet>
<bullet>Operations on keys and values</bullet>
<bullet>Represented in JSON, stored differently</bullet>
<bullet>Represented in JSON, stored more efficiently</bullet>
<bullet>Examples: *MongoDB*, *CouchDB*, *Elasticsearch*</bullet>
</list>

View File

@@ -2,11 +2,6 @@
<slide>
<title>Elasticsearch: Insert Document</title>
<example>
curl -XPUT 'localhost:9200/users?pretty&amp;pretty'
</example>
<example inline="2">
curl -XPUT 'localhost:9200/users/external/derick@localhost?pretty&amp;pretty' \
-H 'Content-Type: application/json' -d'

View File

@@ -2,10 +2,10 @@
<title>Key/Value Stores</title>
<list>
<bullet>The simplest type</bullet>
<bullet>The "simplest" data store</bullet>
<bullet>Operations by key *only*</bullet>
<bullet>Values do not have to be simple scalars</bullet>
<bullet>*Redis*</bullet>
<bullet>Example: *Redis*</bullet>
</list>
</slide>

View File

@@ -61,18 +61,13 @@ db.checkins.find( {
</div>
<div effect="fade-in">
<example inline="2">
{
"_id" : ObjectId("569c1bd8b8c96e09421b292a"),
"whisky" : "Auriverdes",
"rating" : 3.5
}
{
"_id" : ObjectId("56a2b8fcb8c96e7205499230"),
"whisky" : "Bunnahabhain 12",
"rating" : 3.5,
"age" : 12
}
<break lines="1"/>
<blurb>As SQL:</blurb>
<example class="big">
SELECT whisky, rating, age
FROM checkins
WHERE region_slug = "scotland-islay" AND
rating >= 3;
</example>
</div>

View File

@@ -3,26 +3,26 @@
<blurb>Create and Insert:</blurb>
<example>
CREATE TABLE whisky (name VARCHAR(255), properties JSON);
CREATE TABLE whisky (name VARCHAR(255), props JSON);
INSERT INTO whisky VALUES
( "Glen Albyn 24", '{"age": 24, "cask_strength": false, "abv": 47.5 }' ),
( "Glenrothes-Glenlivet 24", '{"age": 24, "cask_strength": true, "coloured": false }' );
( "Glenrothes 24", '{"age": 24, "cask_strength": true, "coloured": false }' );
</example>
<break/>
<blurb>Query:</blurb>
<example inline="2">
SELECT name, *properties->>"$.age"* FROM whisky WHERE *properties->"$.cask_strength" = true*;
SELECT name, *props->>"$.age"* FROM whisky WHERE *props->"$.cask_strength" = true*;
</example>
<break/>
<blurb>Result:</blurb>
<example>
+-------------------------+---------------------+
| name | properties->"$.age" |
| name | props->"$.age" |
+-------------------------+---------------------+
| Glenrothes-Glenlivet 24 | 24 |
| Glenrothes 24 | 24 |
+-------------------------+---------------------+
</example>
</slide>

View File

@@ -2,8 +2,8 @@
<title>Relational Databases</title>
<list>
<bullet>Traditionally data is stored normalized</bullet>
<bullet>Normal forms</bullet>
<bullet>Traditionally data is stored normalised</bullet>
<bullet>Theory: Normal Forms</bullet>
<bullet>Additional data types to store "unstructured" data</bullet>
<bullet>Examples: *MySQL*, *PostgreSQL*</bullet>
</list>

View File

@@ -1,26 +1,26 @@
<slide>
<title>Atomicity (ACID): Update operators</title>
<title>MongoDB: Update Operators</title>
<div effect="fade-out">
<blurb>Don't do this:</blurb>
<example inline="1">
<example inline="1"><![CDATA[&lt;?php
$m = new MongoClient;
$c = $m->demo->steps;
$r = $c->findOne( [ 'person' => 'derickr' ] );
*$r['steps_made']["20170202"] = $r['steps_made']["20170202"] + 7124;*
*$c->update( [ 'person' => 'derickr' ], $r );*
</example>
]]></example>
</div>
<div effect="fade-in">
<blurb>Do this instead:</blurb>
<example inline="1">
<example inline="1"><![CDATA[&lt;?php
$m = new MongoClient;
$c = $m->demo->steps;
$c->update(
[ 'person' => 'derickr' ],
[ *'$inc'* => [ "steps_made.20170202" => 7124 ] ]
);
);]]>
</example>
<blurb>Other operators:</blurb>

View File

@@ -21,7 +21,7 @@
<blurb>branch.php</blurb>
<example><![CDATA[…
xdebug_start_code_coverage(
XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE | XDEBUG_CC_BRANCH_CHECK
XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE | XDEBUG_CC_BRANCH_CHECK
);
ifthenelse( true, false );