SlideShare una empresa de Scribd logo
1 de 34
Niklas Gustavsson [email_address] www.callistaenterprise.se
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB Be warned
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB Won't replace your relational database You (probably) won't be using it any time soon
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB Forget about relational    databases for a while
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB Open source project  started by Damien Katz http://couchdb.org Soon to be an Apache project
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB How does it work?
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB Document oriented Documents are JSON {firstName:”Niklas”, lastName: “Gustavsson”} Schema less
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB Views Pre-computed, indexed table Incrementally updated Written in JavaScript
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB // sort and retrieve documents by first name function (doc) { map(doc.firstName, doc); } // retrieve squares by size function (sq) { map(sq.width * sq.height, {color: sq.color}); }
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB 1 2 3 So why should I care?
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB First reason Sometimes availability trumps consistency 1 2 3
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB CAP theorem - pick two: Consistency Availability Partitioning
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB Eventual Consistency http://www.allthingsdistributed.com/2007/12/eventually_consistent.html
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB NODES – the number of nodes that store a replica WRITES – the number nodes that confirm a commit READS – the number of nodes that are contacted at a read operation  WRITES+READS > NODES : strong consistency http://www.allthingsdistributed.com/2007/12/eventually_consistent.html
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB Synchronous DB replication NODES = 2 WRITES = 2 READS = 1 2 + 1 > 2  ->  Strong consistency http://www.allthingsdistributed.com/2007/12/eventually_consistent.html
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB Asynchronous DB replication NODES = 2 WRITES = 1 READS = 1 1 + 1 > 2  ->  Eventual consistency http://www.allthingsdistributed.com/2007/12/eventually_consistent.html
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB What if NODES is 10 or 100 or 1000? Every increase in WRITES means less chance for a write to succeed
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB http://www.allthingsdistributed.com/2007/12/eventually_consistent.html http://aws.amazon.com/simpledb http://lucene.apache.org/hadoop/ Read more
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB Second reason: Moore has  changed tactic 1 2 3
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB CPUs are getting slower but more plenty The Free Lunch is over - http://www.gotw.ca/publications/concurrency-ddj.htm
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB We need to start parallelizing our tasks Concurrency in Java is really, really hard Share nothing Erlang processes and messaging   Map/reduce
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB Used for computing views in CouchDB map/reduce
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB http://www.gotw.ca/publications/concurrency-ddj.htm http://erlang.org/ http://www.scala-lang.org/ http://labs.google.com/papers/mapreduce.html Read more
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB Third reason Web friendly 1 2 3
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB REST - “HTTP used right”
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB REST based API Everything is a resource Every resource has a URL Every resource has the same uniform interface Links guides through states Stateless
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB REST freebies API easily usable from any platform (AJAX, Java, Ruby, COBOL, Powerpoint...)‏ Works with existing infrastructure  Caches, proxies, firewalls… Optimistic locking
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm http://www.infoq.com/articles/rest-introduction http://www.burtongroup.com/Guest/Aps/RestWorkshop.aspx Read more
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB I'm getting sleepy,  show me the goodies!
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB Adding a to do var todoText = $("todoinput").value; this.db.save({text: todoText });
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB Adding a tag if(!todo.tags) { todo.tags = [tag]; } else  { todo.tags[todo.tags.length] = tag; } this.db.save(todo);
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB The magic of save()‏ this.save = function(doc, options) { if (doc._id == undefined) { xhr.open("POST", this.url); } else { xhr.open("PUT", this.url  + doc._id); } xhr.send(doc.toJSONString()); … }
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB Questions? ?
CouchDB, Slide  © Copyright 2008, Callista Enterprise AB Attributions WHY? -  http://www.flickr.com/photos/teflon/128827389/ Deep mud -  http://www.flickr.com/photos/hubmedia/133598031/ Banana -  http://flickr.com/photos/tim_ellis/154225908/ Forget me not -  http://flickr.com/photos/doblonaut/456339900/

Más contenido relacionado

La actualidad más candente

Scaling ArangoDB on Mesosphere DCOS
Scaling ArangoDB on Mesosphere DCOSScaling ArangoDB on Mesosphere DCOS
Scaling ArangoDB on Mesosphere DCOSMax Neunhöffer
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBRavi Teja
 
CouchDB : More Couch
CouchDB : More CouchCouchDB : More Couch
CouchDB : More Couchdelagoya
 
ArangoDB – A different approach to NoSQL
ArangoDB – A different approach to NoSQLArangoDB – A different approach to NoSQL
ArangoDB – A different approach to NoSQLArangoDB Database
 
NoSQL: Why, When, and How
NoSQL: Why, When, and HowNoSQL: Why, When, and How
NoSQL: Why, When, and HowBigBlueHat
 
Introduction to ArangoDB (nosql matters Barcelona 2012)
Introduction to ArangoDB (nosql matters Barcelona 2012)Introduction to ArangoDB (nosql matters Barcelona 2012)
Introduction to ArangoDB (nosql matters Barcelona 2012)ArangoDB Database
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBJustin Smestad
 
Storage talk
Storage talkStorage talk
Storage talkchristkv
 
Couchdb + Membase = Couchbase
Couchdb + Membase = CouchbaseCouchdb + Membase = Couchbase
Couchdb + Membase = Couchbaseiammutex
 
NoSQL and MongoDB Introdction
NoSQL and MongoDB IntrodctionNoSQL and MongoDB Introdction
NoSQL and MongoDB IntrodctionBrian Enochson
 
Building Hybrid data cluster using PostgreSQL and MongoDB
Building Hybrid data cluster using PostgreSQL and MongoDBBuilding Hybrid data cluster using PostgreSQL and MongoDB
Building Hybrid data cluster using PostgreSQL and MongoDBAshnikbiz
 
MongoDB Aggregation Performance
MongoDB Aggregation PerformanceMongoDB Aggregation Performance
MongoDB Aggregation PerformanceMongoDB
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB Habilelabs
 
JS App Architecture
JS App ArchitectureJS App Architecture
JS App ArchitectureCorey Butler
 
Sizing MongoDB on AWS with Wired Tiger-Patrick and Vigyan-Final
Sizing MongoDB on AWS with Wired Tiger-Patrick and Vigyan-FinalSizing MongoDB on AWS with Wired Tiger-Patrick and Vigyan-Final
Sizing MongoDB on AWS with Wired Tiger-Patrick and Vigyan-FinalVigyan Jain
 
Electron, databases, and RxDB
Electron, databases, and RxDBElectron, databases, and RxDB
Electron, databases, and RxDBBen Gotow
 

La actualidad más candente (20)

Scaling ArangoDB on Mesosphere DCOS
Scaling ArangoDB on Mesosphere DCOSScaling ArangoDB on Mesosphere DCOS
Scaling ArangoDB on Mesosphere DCOS
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Lokijs
LokijsLokijs
Lokijs
 
CouchDB : More Couch
CouchDB : More CouchCouchDB : More Couch
CouchDB : More Couch
 
ArangoDB – A different approach to NoSQL
ArangoDB – A different approach to NoSQLArangoDB – A different approach to NoSQL
ArangoDB – A different approach to NoSQL
 
NoSQL: Why, When, and How
NoSQL: Why, When, and HowNoSQL: Why, When, and How
NoSQL: Why, When, and How
 
Introduction to ArangoDB (nosql matters Barcelona 2012)
Introduction to ArangoDB (nosql matters Barcelona 2012)Introduction to ArangoDB (nosql matters Barcelona 2012)
Introduction to ArangoDB (nosql matters Barcelona 2012)
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Deep Dive on ArangoDB
Deep Dive on ArangoDBDeep Dive on ArangoDB
Deep Dive on ArangoDB
 
Storage talk
Storage talkStorage talk
Storage talk
 
Couchdb + Membase = Couchbase
Couchdb + Membase = CouchbaseCouchdb + Membase = Couchbase
Couchdb + Membase = Couchbase
 
NoSQL and MongoDB Introdction
NoSQL and MongoDB IntrodctionNoSQL and MongoDB Introdction
NoSQL and MongoDB Introdction
 
Building Hybrid data cluster using PostgreSQL and MongoDB
Building Hybrid data cluster using PostgreSQL and MongoDBBuilding Hybrid data cluster using PostgreSQL and MongoDB
Building Hybrid data cluster using PostgreSQL and MongoDB
 
MongoDB Aggregation Performance
MongoDB Aggregation PerformanceMongoDB Aggregation Performance
MongoDB Aggregation Performance
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB
 
JS App Architecture
JS App ArchitectureJS App Architecture
JS App Architecture
 
Sizing MongoDB on AWS with Wired Tiger-Patrick and Vigyan-Final
Sizing MongoDB on AWS with Wired Tiger-Patrick and Vigyan-FinalSizing MongoDB on AWS with Wired Tiger-Patrick and Vigyan-Final
Sizing MongoDB on AWS with Wired Tiger-Patrick and Vigyan-Final
 
Electron, databases, and RxDB
Electron, databases, and RxDBElectron, databases, and RxDB
Electron, databases, and RxDB
 
MongodB Internals
MongodB InternalsMongodB Internals
MongodB Internals
 
Software + Babies
Software + BabiesSoftware + Babies
Software + Babies
 

Similar a CouchDB Intro - Eventual Consistency, MapReduce, REST

ABD315_Serverless ETL with AWS Glue
ABD315_Serverless ETL with AWS GlueABD315_Serverless ETL with AWS Glue
ABD315_Serverless ETL with AWS GlueAmazon Web Services
 
CON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWSCON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWSAmazon Web Services
 
CON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWSCON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWSAmazon Web Services
 
Building Cloud-Native Applications with Microsoft Windows Azure
Building Cloud-Native Applications with Microsoft Windows AzureBuilding Cloud-Native Applications with Microsoft Windows Azure
Building Cloud-Native Applications with Microsoft Windows AzureBill Wilder
 
New and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
New and cool in OSGi R7 - David Bosschaert & Carsten ZiegelerNew and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
New and cool in OSGi R7 - David Bosschaert & Carsten Ziegelermfrancis
 
Spark Streaming with Azure Databricks
Spark Streaming with Azure DatabricksSpark Streaming with Azure Databricks
Spark Streaming with Azure DatabricksDustin Vannoy
 
Design, Deploy, and Optimize Microsoft SQL Server on AWS
Design, Deploy, and Optimize Microsoft SQL Server on AWSDesign, Deploy, and Optimize Microsoft SQL Server on AWS
Design, Deploy, and Optimize Microsoft SQL Server on AWSAmazon Web Services
 
Saving Money by Optimizing Your Cloud Add-On Infrastructure
Saving Money by Optimizing Your Cloud Add-On InfrastructureSaving Money by Optimizing Your Cloud Add-On Infrastructure
Saving Money by Optimizing Your Cloud Add-On InfrastructureAtlassian
 
Couchdb: No SQL? No driver? No problem
Couchdb: No SQL? No driver? No problemCouchdb: No SQL? No driver? No problem
Couchdb: No SQL? No driver? No problemdelagoya
 
Optimizing Big Data to run in the Public Cloud
Optimizing Big Data to run in the Public CloudOptimizing Big Data to run in the Public Cloud
Optimizing Big Data to run in the Public CloudQubole
 
Scylla @ Disney+ Hotstar
Scylla @ Disney+ HotstarScylla @ Disney+ Hotstar
Scylla @ Disney+ HotstarScyllaDB
 
Alternator webinar september 2019
Alternator webinar   september 2019Alternator webinar   september 2019
Alternator webinar september 2019Nadav Har'El
 
Running Oracle Databases on Amazon RDS and Migrating to PostgreSQL (DAT307-R1...
Running Oracle Databases on Amazon RDS and Migrating to PostgreSQL (DAT307-R1...Running Oracle Databases on Amazon RDS and Migrating to PostgreSQL (DAT307-R1...
Running Oracle Databases on Amazon RDS and Migrating to PostgreSQL (DAT307-R1...Amazon Web Services
 
Cloud State of the Union for Java Developers
Cloud State of the Union for Java DevelopersCloud State of the Union for Java Developers
Cloud State of the Union for Java DevelopersBurr Sutter
 
Building Ruby on Rails apps on Windows Azure (MIX 2010 at Last Vegas))
Building Ruby on Rails apps on Windows Azure (MIX 2010 at Last Vegas))Building Ruby on Rails apps on Windows Azure (MIX 2010 at Last Vegas))
Building Ruby on Rails apps on Windows Azure (MIX 2010 at Last Vegas))Sriram Krishnan
 
SQL et in-memory sur Hadoop avec Pivotal et HAWQ
SQL et in-memory sur Hadoop avec Pivotal et HAWQSQL et in-memory sur Hadoop avec Pivotal et HAWQ
SQL et in-memory sur Hadoop avec Pivotal et HAWQModern Data Stack France
 
Introduction to Apache CloudStack by David Nalley
Introduction to Apache CloudStack by David NalleyIntroduction to Apache CloudStack by David Nalley
Introduction to Apache CloudStack by David Nalleybuildacloud
 
IMC Summit 2016 Innovation - Dennis Duckworth - Lambda-B-Gone: The In-memory ...
IMC Summit 2016 Innovation - Dennis Duckworth - Lambda-B-Gone: The In-memory ...IMC Summit 2016 Innovation - Dennis Duckworth - Lambda-B-Gone: The In-memory ...
IMC Summit 2016 Innovation - Dennis Duckworth - Lambda-B-Gone: The In-memory ...In-Memory Computing Summit
 
Windows Azure and a little SQL Data Services
Windows Azure and a little SQL Data ServicesWindows Azure and a little SQL Data Services
Windows Azure and a little SQL Data Servicesukdpe
 

Similar a CouchDB Intro - Eventual Consistency, MapReduce, REST (20)

Mashups
MashupsMashups
Mashups
 
ABD315_Serverless ETL with AWS Glue
ABD315_Serverless ETL with AWS GlueABD315_Serverless ETL with AWS Glue
ABD315_Serverless ETL with AWS Glue
 
CON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWSCON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWS
 
CON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWSCON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWS
 
Building Cloud-Native Applications with Microsoft Windows Azure
Building Cloud-Native Applications with Microsoft Windows AzureBuilding Cloud-Native Applications with Microsoft Windows Azure
Building Cloud-Native Applications with Microsoft Windows Azure
 
New and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
New and cool in OSGi R7 - David Bosschaert & Carsten ZiegelerNew and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
New and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
 
Spark Streaming with Azure Databricks
Spark Streaming with Azure DatabricksSpark Streaming with Azure Databricks
Spark Streaming with Azure Databricks
 
Design, Deploy, and Optimize Microsoft SQL Server on AWS
Design, Deploy, and Optimize Microsoft SQL Server on AWSDesign, Deploy, and Optimize Microsoft SQL Server on AWS
Design, Deploy, and Optimize Microsoft SQL Server on AWS
 
Saving Money by Optimizing Your Cloud Add-On Infrastructure
Saving Money by Optimizing Your Cloud Add-On InfrastructureSaving Money by Optimizing Your Cloud Add-On Infrastructure
Saving Money by Optimizing Your Cloud Add-On Infrastructure
 
Couchdb: No SQL? No driver? No problem
Couchdb: No SQL? No driver? No problemCouchdb: No SQL? No driver? No problem
Couchdb: No SQL? No driver? No problem
 
Optimizing Big Data to run in the Public Cloud
Optimizing Big Data to run in the Public CloudOptimizing Big Data to run in the Public Cloud
Optimizing Big Data to run in the Public Cloud
 
Scylla @ Disney+ Hotstar
Scylla @ Disney+ HotstarScylla @ Disney+ Hotstar
Scylla @ Disney+ Hotstar
 
Alternator webinar september 2019
Alternator webinar   september 2019Alternator webinar   september 2019
Alternator webinar september 2019
 
Running Oracle Databases on Amazon RDS and Migrating to PostgreSQL (DAT307-R1...
Running Oracle Databases on Amazon RDS and Migrating to PostgreSQL (DAT307-R1...Running Oracle Databases on Amazon RDS and Migrating to PostgreSQL (DAT307-R1...
Running Oracle Databases on Amazon RDS and Migrating to PostgreSQL (DAT307-R1...
 
Cloud State of the Union for Java Developers
Cloud State of the Union for Java DevelopersCloud State of the Union for Java Developers
Cloud State of the Union for Java Developers
 
Building Ruby on Rails apps on Windows Azure (MIX 2010 at Last Vegas))
Building Ruby on Rails apps on Windows Azure (MIX 2010 at Last Vegas))Building Ruby on Rails apps on Windows Azure (MIX 2010 at Last Vegas))
Building Ruby on Rails apps on Windows Azure (MIX 2010 at Last Vegas))
 
SQL et in-memory sur Hadoop avec Pivotal et HAWQ
SQL et in-memory sur Hadoop avec Pivotal et HAWQSQL et in-memory sur Hadoop avec Pivotal et HAWQ
SQL et in-memory sur Hadoop avec Pivotal et HAWQ
 
Introduction to Apache CloudStack by David Nalley
Introduction to Apache CloudStack by David NalleyIntroduction to Apache CloudStack by David Nalley
Introduction to Apache CloudStack by David Nalley
 
IMC Summit 2016 Innovation - Dennis Duckworth - Lambda-B-Gone: The In-memory ...
IMC Summit 2016 Innovation - Dennis Duckworth - Lambda-B-Gone: The In-memory ...IMC Summit 2016 Innovation - Dennis Duckworth - Lambda-B-Gone: The In-memory ...
IMC Summit 2016 Innovation - Dennis Duckworth - Lambda-B-Gone: The In-memory ...
 
Windows Azure and a little SQL Data Services
Windows Azure and a little SQL Data ServicesWindows Azure and a little SQL Data Services
Windows Azure and a little SQL Data Services
 

Más de Niklas Gustavsson

Más de Niklas Gustavsson (11)

Spotify services - Leetspeak 2014
Spotify services - Leetspeak 2014Spotify services - Leetspeak 2014
Spotify services - Leetspeak 2014
 
Spotify services (SDC 2013)
Spotify services (SDC 2013)Spotify services (SDC 2013)
Spotify services (SDC 2013)
 
Spotify architecture - Pressing play
Spotify architecture - Pressing playSpotify architecture - Pressing play
Spotify architecture - Pressing play
 
Real-time web
Real-time webReal-time web
Real-time web
 
RESTful web services
RESTful web servicesRESTful web services
RESTful web services
 
Not only SQL
Not only SQL Not only SQL
Not only SQL
 
HTML5
HTML5HTML5
HTML5
 
The future is bright
The future is brightThe future is bright
The future is bright
 
Oredev 2009 JAX-RS
Oredev 2009 JAX-RSOredev 2009 JAX-RS
Oredev 2009 JAX-RS
 
Apachecon Eu 2008 Mina
Apachecon Eu 2008 MinaApachecon Eu 2008 Mina
Apachecon Eu 2008 Mina
 
REST made simple with Java
REST made simple with JavaREST made simple with Java
REST made simple with Java
 

Último

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

CouchDB Intro - Eventual Consistency, MapReduce, REST

  • 1. Niklas Gustavsson [email_address] www.callistaenterprise.se
  • 2. CouchDB, Slide © Copyright 2008, Callista Enterprise AB Be warned
  • 3. CouchDB, Slide © Copyright 2008, Callista Enterprise AB Won't replace your relational database You (probably) won't be using it any time soon
  • 4. CouchDB, Slide © Copyright 2008, Callista Enterprise AB Forget about relational databases for a while
  • 5. CouchDB, Slide © Copyright 2008, Callista Enterprise AB Open source project started by Damien Katz http://couchdb.org Soon to be an Apache project
  • 6. CouchDB, Slide © Copyright 2008, Callista Enterprise AB How does it work?
  • 7. CouchDB, Slide © Copyright 2008, Callista Enterprise AB Document oriented Documents are JSON {firstName:”Niklas”, lastName: “Gustavsson”} Schema less
  • 8. CouchDB, Slide © Copyright 2008, Callista Enterprise AB Views Pre-computed, indexed table Incrementally updated Written in JavaScript
  • 9. CouchDB, Slide © Copyright 2008, Callista Enterprise AB // sort and retrieve documents by first name function (doc) { map(doc.firstName, doc); } // retrieve squares by size function (sq) { map(sq.width * sq.height, {color: sq.color}); }
  • 10. CouchDB, Slide © Copyright 2008, Callista Enterprise AB 1 2 3 So why should I care?
  • 11. CouchDB, Slide © Copyright 2008, Callista Enterprise AB First reason Sometimes availability trumps consistency 1 2 3
  • 12. CouchDB, Slide © Copyright 2008, Callista Enterprise AB CAP theorem - pick two: Consistency Availability Partitioning
  • 13. CouchDB, Slide © Copyright 2008, Callista Enterprise AB Eventual Consistency http://www.allthingsdistributed.com/2007/12/eventually_consistent.html
  • 14. CouchDB, Slide © Copyright 2008, Callista Enterprise AB NODES – the number of nodes that store a replica WRITES – the number nodes that confirm a commit READS – the number of nodes that are contacted at a read operation WRITES+READS > NODES : strong consistency http://www.allthingsdistributed.com/2007/12/eventually_consistent.html
  • 15. CouchDB, Slide © Copyright 2008, Callista Enterprise AB Synchronous DB replication NODES = 2 WRITES = 2 READS = 1 2 + 1 > 2 -> Strong consistency http://www.allthingsdistributed.com/2007/12/eventually_consistent.html
  • 16. CouchDB, Slide © Copyright 2008, Callista Enterprise AB Asynchronous DB replication NODES = 2 WRITES = 1 READS = 1 1 + 1 > 2 -> Eventual consistency http://www.allthingsdistributed.com/2007/12/eventually_consistent.html
  • 17. CouchDB, Slide © Copyright 2008, Callista Enterprise AB What if NODES is 10 or 100 or 1000? Every increase in WRITES means less chance for a write to succeed
  • 18. CouchDB, Slide © Copyright 2008, Callista Enterprise AB http://www.allthingsdistributed.com/2007/12/eventually_consistent.html http://aws.amazon.com/simpledb http://lucene.apache.org/hadoop/ Read more
  • 19. CouchDB, Slide © Copyright 2008, Callista Enterprise AB Second reason: Moore has changed tactic 1 2 3
  • 20. CouchDB, Slide © Copyright 2008, Callista Enterprise AB CPUs are getting slower but more plenty The Free Lunch is over - http://www.gotw.ca/publications/concurrency-ddj.htm
  • 21. CouchDB, Slide © Copyright 2008, Callista Enterprise AB We need to start parallelizing our tasks Concurrency in Java is really, really hard Share nothing Erlang processes and messaging Map/reduce
  • 22. CouchDB, Slide © Copyright 2008, Callista Enterprise AB Used for computing views in CouchDB map/reduce
  • 23. CouchDB, Slide © Copyright 2008, Callista Enterprise AB http://www.gotw.ca/publications/concurrency-ddj.htm http://erlang.org/ http://www.scala-lang.org/ http://labs.google.com/papers/mapreduce.html Read more
  • 24. CouchDB, Slide © Copyright 2008, Callista Enterprise AB Third reason Web friendly 1 2 3
  • 25. CouchDB, Slide © Copyright 2008, Callista Enterprise AB REST - “HTTP used right”
  • 26. CouchDB, Slide © Copyright 2008, Callista Enterprise AB REST based API Everything is a resource Every resource has a URL Every resource has the same uniform interface Links guides through states Stateless
  • 27. CouchDB, Slide © Copyright 2008, Callista Enterprise AB REST freebies API easily usable from any platform (AJAX, Java, Ruby, COBOL, Powerpoint...)‏ Works with existing infrastructure Caches, proxies, firewalls… Optimistic locking
  • 28. CouchDB, Slide © Copyright 2008, Callista Enterprise AB http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm http://www.infoq.com/articles/rest-introduction http://www.burtongroup.com/Guest/Aps/RestWorkshop.aspx Read more
  • 29. CouchDB, Slide © Copyright 2008, Callista Enterprise AB I'm getting sleepy, show me the goodies!
  • 30. CouchDB, Slide © Copyright 2008, Callista Enterprise AB Adding a to do var todoText = $("todoinput").value; this.db.save({text: todoText });
  • 31. CouchDB, Slide © Copyright 2008, Callista Enterprise AB Adding a tag if(!todo.tags) { todo.tags = [tag]; } else { todo.tags[todo.tags.length] = tag; } this.db.save(todo);
  • 32. CouchDB, Slide © Copyright 2008, Callista Enterprise AB The magic of save()‏ this.save = function(doc, options) { if (doc._id == undefined) { xhr.open("POST", this.url); } else { xhr.open("PUT", this.url + doc._id); } xhr.send(doc.toJSONString()); … }
  • 33. CouchDB, Slide © Copyright 2008, Callista Enterprise AB Questions? ?
  • 34. CouchDB, Slide © Copyright 2008, Callista Enterprise AB Attributions WHY? - http://www.flickr.com/photos/teflon/128827389/ Deep mud - http://www.flickr.com/photos/hubmedia/133598031/ Banana - http://flickr.com/photos/tim_ellis/154225908/ Forget me not - http://flickr.com/photos/doblonaut/456339900/

Notas del editor

  1. Först ska jag göra er klara på att vi är på väldigt tunn is
  2. Syftet är inte att ersätta de traditionella databaserna utan att leta alterntiv för vissa typer av lösningar CouchDB är ännu alfa, om än under snabb utveckling No security No validation
  3. (or Ruby, Perl, Python...)‏
  4. Förklara ordentligt! Partitioning vid hög last och/elller mycket data För vissa applikationer är tillgänglighet av yttersta vikt
  5. Eventual consistency kan vara okej när tillgänglighet är viktigare än konsitens, eller när gapet av inkonsistens inte kommer märkas (e.g. på en site)‏
  6. Förutom att kunna distribueras så är Couch byggt för att naturligt failera. Andra exemple Amazon Dynam Google Filesystem Hadoop
  7. Förutom att kunna distribueras så är Couch byggt för att naturligt failera. Andra exemple Amazon Dynam Google Filesystem Hadoop
  8. Vanlig arkitektur med läs-slavar
  9. Unreliable clusters Plenty of cheap servers rather than big expensive The number of nodes a replicate is stored on can vary based on the desired performance characteristics Many writes, few reads: less replicas Many read, less writes: more replicas
  10. Moore's law har bytt metod
  11. Ge exempel med uppdatering av vyer
  12. REST Roy Fielding HTTP använt rätt Constraints Everything is a resource Every resource has a URL Client-server, stateless, cachable