Slide 1

Slide 1 text

@BradleyHolt! The Many Flavors of NoSQL That Conference Monday, August 10, 2015 Bradley Holt, Developer Advocate

Slide 2

Slide 2 text

@BradleyHolt!

Slide 3

Slide 3 text

@BradleyHolt! The Relational Database •  Originated from within IBM in 1970 •  Data is stored in tables, rows, and columns •  Each table has a column designated as the primary key •  Foreign keys can reference primary keys, allowing for joins Image Credit: database 2 by Tim Morgan, on Flickr

Slide 4

Slide 4 text

@BradleyHolt! ACID Guarantees •  Atomicity: Each transaction must be "all or nothing" •  Consistency: Constraints (e.g. foreign key constraints) are always applied before data is written •  Isolation: Sequencing of transactions is ensured •  Durability: Committed transactions will survive errors such as power loss or database crashes Image Credit: Hard Drive by walknboston, on Flickr

Slide 5

Slide 5 text

@BradleyHolt! Image Credit: IBM 360 Announcement center by Robert Nix, on Flickr

Slide 6

Slide 6 text

@BradleyHolt! …then the web happened •  Horizontal scaling became more important than vertical scaling •  Eventual consistency became an acceptable alternative to immediate consistency •  New models for storing and retrieving data were explored Image Credit: Dialing Up Web History by Mike Licht, on Flickr

Slide 7

Slide 7 text

@BradleyHolt! Horizontal Scaling •  Scaling through the addition of commodity hardware •  Vertical scaling is limited by the maximum server size available •  Goal of horizontal scaling is linear scalability, where each additional resource adds the same capacity as the previously added resource Image Credit: truck day 2012 june 19 (11) by Laurence Simon (Crap Mariner), on Flickr

Slide 8

Slide 8 text

@BradleyHolt! Eventual Consistency •  Each node in a distributed system will eventually contain a consistent view of the data (given no new updates) •  A property of the web in general •  Data conflicts can arise which need to be resolved Image Credit: organic growth by Steve Jurvetson, on Flickr

Slide 9

Slide 9 text

@BradleyHolt! Enter "Not only SQL" (NoSQL) Databases key-value graph document …more Image Credit: database by Tim Morgan, on Flickr

Slide 10

Slide 10 text

@BradleyHolt!

Slide 11

Slide 11 text

@BradleyHolt!

Slide 12

Slide 12 text

@BradleyHolt! Key-Value Stores •  Opaque data accessed through unique keys •  Typically offer very fast read/write data access •  Good for caching, highly-variable data values, and/or high performance •  Typically can't query against values, only keys Image Credit: Keys by Taki Steve, on Flickr

Slide 13

Slide 13 text

@BradleyHolt! Document Databases •  A type of key-value store where the value is more clearly defined •  Often include both a primary index and secondary indexes •  Document model is often a great fit for modern web and mobile apps Image Credit: paper by Tim Morgan, on Flickr

Slide 14

Slide 14 text

@BradleyHolt! Graph Databases •  Based on graph theory •  Entities are represented by nodes •  Nodes contain properties •  Nodes/properties are connected to other nodes/properties via edges •  Uses include social networks (e.g. "friend of a friend"), driving directions, shopping recommendations, etc. Image Credit: Die Homepage by Jörg Kanngießer, on Flickr

Slide 15

Slide 15 text

@BradleyHolt! The CAP Theorem Partition Tolerance Availability Consistency Consistency Availability Partition Tolerance

Slide 16

Slide 16 text

@BradleyHolt! IBM Cloudant •  Globally distributed data layer for web and mobile applications •  MongoDB-style queries •  Advanced geospatial capabilities •  Full text search indexing •  Based on Apache CouchDB

Slide 17

Slide 17 text

@BradleyHolt! Apache CouchDB •  Prioritizes Availability and Partition Tolerance over Consistency •  Features Atomic, Consistent, Isolated, and Durable (ACID) properties

Slide 18

Slide 18 text

@BradleyHolt! Common Relational Database Problems •  Object-relational impedance mismatch •  use the repository pattern (domain and data mapping layers) •  object-relational mapping (ORM) •  Semi-structured data •  leave non-applicable column values null •  use the entity-attribute-value (EAV) anti-pattern (never do this) •  High concurrency •  reduce transaction scope •  denormalize

Slide 19

Slide 19 text

@BradleyHolt!

Slide 20

Slide 20 text

@BradleyHolt! Further Reading

Slide 21

Slide 21 text

@BradleyHolt! Image Credits •  database 2 by Tim Morgan, on Flickr •  Hard Drive by walknboston, on Flickr •  IBM 360 Announcement center by Robert Nix, on Flickr •  Dialing Up Web History by Mike Licht, on Flickr •  truck day 2012 june 19 (11) by Laurence Simon (Crap Mariner), on Flickr •  organic growth by Steve Jurvetson, on Flickr •  database by Tim Morgan, on Flickr •  Keys by Taki Steve, on Flickr •  paper by Tim Morgan, on Flickr •  Die Homepage by Jörg Kanngießer, on Flickr

Slide 22

Slide 22 text

@BradleyHolt! Bradley Holt Developer Advocate bradley.holt@us.ibm.com @BradleyHolt github.com/bradley-holt