Imported all the notebooks
[tm351-notebooks.git] / notebooks / 18 distributed transactions / 18 distributed transactions.ipynb
diff --git a/notebooks/18 distributed transactions/18 distributed transactions.ipynb b/notebooks/18 distributed transactions/18 distributed transactions.ipynb
new file mode 100644 (file)
index 0000000..91480d3
--- /dev/null
@@ -0,0 +1,82 @@
+{
+ "metadata": {
+  "name": "",
+  "signature": "sha256:0cafa5878de96fbca59cfefba9c283f278b04434433d5f8cd7072a1e4145b413"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+  {
+   "cells": [
+    {
+     "cell_type": "markdown",
+     "metadata": {},
+     "source": [
+      "This notebook is a placeholder for section 18 transactions in a distributed environment. \n",
+      "\n",
+      "Aim to observe what communication needs to take place between locations, how are transactions managed, how is it possible to know the data is consistent or not, what does this allow us to do or prevent us from doing?\n",
+      "\n",
+      "The notebook 18 Two Phase Commit to be developed using either more than one notebook or more than one process within the same notebook to simulate two or more locations where data shards are stored.  For now I will assume two, and I will name these LocationA (the coordinating location), and LocationB.  I will assume that data is distributed across the locations.  The data will be separated into separate database files which I will call DataA and DataB."
+     ]
+    },
+    {
+     "cell_type": "markdown",
+     "metadata": {},
+     "source": [
+      "successful Two phase commit: Start a database transaction which requires updates on DataA and DataB."
+     ]
+    },
+    {
+     "cell_type": "markdown",
+     "metadata": {},
+     "source": [
+      "LocationA sends a request to LocationB to update DataB.  LocationA updates DataA."
+     ]
+    },
+    {
+     "cell_type": "markdown",
+     "metadata": {},
+     "source": [
+      "LocationB notifies when it has completed updating DataB."
+     ]
+    },
+    {
+     "cell_type": "markdown",
+     "metadata": {},
+     "source": [
+      "LocationA completes updating DataA."
+     ]
+    },
+    {
+     "cell_type": "markdown",
+     "metadata": {},
+     "source": [
+      "LocationA insructs a commit and both LocationA and LocationB individually commit their changes."
+     ]
+    },
+    {
+     "cell_type": "markdown",
+     "metadata": {},
+     "source": [
+      "Look at resulting data to confirm successful distributed update."
+     ]
+    },
+    {
+     "cell_type": "markdown",
+     "metadata": {},
+     "source": [
+      "roll back a pending transaction - see what communication needs to take place between locations.  What problems need to be overcome?  What information is being logged in order to keep track?"
+     ]
+    },
+    {
+     "cell_type": "markdown",
+     "metadata": {},
+     "source": [
+      "Stop one process or notebook and observe what the surviving one can do or not do."
+     ]
+    }
+   ],
+   "metadata": {}
+  }
+ ]
+}
\ No newline at end of file