Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CouchDB Lightning Talk at BTVWAG's NoSQLvember

Bradley Holt
November 19, 2013

CouchDB Lightning Talk at BTVWAG's NoSQLvember

CouchDB is a non-relational alternative to data persistence 
for modern software applications.

Bradley Holt

November 19, 2013
Tweet

More Decks by Bradley Holt

Other Decks in Programming

Transcript

  1. Problem: The Object-Relational Impedance Mismatch[1] How to persist data in

    an object-oriented software application? 1. http://c2.com/cgi/wiki?ObjectRelationalImpedanceMismatch 2. http://martinfowler.com/eaaCatalog/repository.html 3. http://c2.com/cgi/wiki?ObjectRelationalMapping
  2. separate domain and data mapping layers[2] Problem: The Object-Relational Impedance

    Mismatch[1] How to persist data in an object-oriented software application? object-relational mapping (ORM)[3] non-relational database 1. http://c2.com/cgi/wiki?ObjectRelationalImpedanceMismatch 2. http://martinfowler.com/eaaCatalog/repository.html 3. http://c2.com/cgi/wiki?ObjectRelationalMapping
  3. separate domain and data mapping layers[2] Problem: The Object-Relational Impedance

    Mismatch[1] How to persist data in an object-oriented software application? object-relational mapping (ORM)[3] non-relational database 1. http://c2.com/cgi/wiki?ObjectRelationalImpedanceMismatch 2. http://martinfowler.com/eaaCatalog/repository.html 3. http://c2.com/cgi/wiki?ObjectRelationalMapping
  4. leave non-applicable column values null Problem: Semi-Structured Data How to

    persist data with exible schemas? use the entity-attribute- value (EAV) anti-pattern[1] use a schema-less database with a self-describing structure 1. http://pragprog.com/book/bksqla/sql-antipatterns
  5. leave non-applicable column values null Problem: Semi-Structured Data How to

    persist data with exible schemas? use the entity-attribute- value (EAV) anti-pattern[1] use a schema-less database with a self-describing structure 1. http://pragprog.com/book/bksqla/sql-antipatterns
  6. Problem: Achieving High Concurrency How to give up consistency in

    exchange for high availability? [1] 1. http://www.julianbrowne.com/article/viewer/brewers-cap-theorem
  7. reduce transaction scope Problem: Achieving High Concurrency How to give

    up consistency in exchange for high availability? [1] database replication multi-version concurrency control (MVCC) 1. http://www.julianbrowne.com/article/viewer/brewers-cap-theorem denormalization
  8. reduce transaction scope Problem: Achieving High Concurrency How to give

    up consistency in exchange for high availability? [1] database replication multi-version concurrency control (MVCC) 1. http://www.julianbrowne.com/article/viewer/brewers-cap-theorem denormalization
  9. • stores self-contained JSON documents • related entities can be

    stored in a single document • only store elds that are needed in each document Schema-Less
  10. • queries are run against indexed views • views are

    generated through incremental Map functions • aggregate results can be retrieved through Reduce functions CouchDB Views
  11. HTTP API • every language and platform has an HTTP

    client • uses existing semantics (e.g. 201 Created, 202 Accepted) • distributed, scalable and cacheable
  12. Map/Reduce gives you tremendous exibility, but has its limitations: no

    ad-hoc queries* index is one dimensional only key or range queries are allowed† *Temporary views are only useful in development, not in production. †Multiple key queries are allowed, but result in multiple hits on the index.
  13. Horizontally Scalable • shared nothing architecture • non-blocking reads and

    writes for high concurrency • fault tolerant, isolated messages
  14. Multi-Master Replication • peer-based and bi-directional • no explicit cluster

    setup required • synchronization is incremental • changes feed allows for replication to other systems