SlideShare a Scribd company logo
Relax!
                             Sebastian Cohnen
                              @tisba / tisba.de


Mittwoch, 16. November 11
About Me

                • Freier Entwickler
                ❤ Ruby/Rails & node.js
                ❤ Performance & Scalability Engineering
                ❤ Distributed Load Testing
                ❤ CouchDB, Redis & Riak
                und ebenfalls interessiert an Erlang, AMQP, ...



Mittwoch, 16. November 11
Users of Couchdb

                            BBC

                            meebo

                            UbuntuOne

                            ...

                            adcloud




Mittwoch, 16. November 11
CouchDB: Basics


                            Schema-frei

                            Dokumenten-orientiert

                            Key/Value-Speicher

                            fehlertolerant & robust




Mittwoch, 16. November 11
Key Features

                            HTTP + JSON

                            Multi-Master Replikation

                            AP aus CAP

                            Append-only

                            inkrementelle, materialisierte Views (map/reduce)




Mittwoch, 16. November 11
HTTP & JSON




Mittwoch, 16. November 11
Admin Interface




Mittwoch, 16. November 11
Create A Database

                 $ curl -w%{http_code} -X PUT http://127.0.0.1:5984/test_db ↵
                 {"ok":true}
                 201


                 $ $ curl -w%{http_code} -X GET http://127.0.0.1:5984/test_db
                 ↵
                 {"db_name":"test_db","doc_count":0,"doc_del_count":0,
                 "update_seq":1,"purge_seq":0, "compact_running":false,
                 "disk_size":16473, "instance_start_time":
                 "1253091887127542","disk_format_version":4}
                 200




                                           *   $ alias curl='curl -w%{http_code} -X'

Mittwoch, 16. November 11
create A Document
                 $ curl POST -d '{"hello":"world"}' http://127.0.0.1:5984/
                 test_db ↵
                 {"ok":true,"id":"67729d5013cf3f8858eb29cb17e5a723","rev":"1-1
                 5f65339921e497348be384867bb940f"}
                 201




                                       read
                 $ curl GET http://127.0.0.1:5984/test_db/
                 67729d5013cf3f8858eb29cb17e5a723 ↵
                 {"_id":"67729d5013cf3f8858eb29cb17e5a723","_rev":"1-15f653399
                 21e497348be384867bb940f","hello":"world"}
                 200




Mittwoch, 16. November 11
update
                 $ curl PUT -d 
                 '{"_rev":"1-15f65339921e497348be384867bb940f",
                 "hello":"world","message":"about to show CRUD in couch"}'
                 http://127.0.0.1:5984/test_db/ 
                 2f41f56816191b94ecbd127151faa242 ↵
                 {"ok":true,"id":"2f41f56816191b94ecbd127151faa242","rev":"2-2
                 873c60120aa6dbe2204cd2c1a0e8722"}
                 201


                 $ curl GET http://127.0.0.1:5984/test_db/ 
                 2f41f56816191b94ecbd127151faa242 ↵
                 {"_id":"2f41f56816191b94ecbd127151faa242","_rev":"2-2873c6012
                 0aa6dbe2204cd2c1a0e8722","hello":"world","message":"about to
                 show CRUD in couch"}
                 200




Mittwoch, 16. November 11
delete
                 $ curl DELETE http://127.0.0.1:5984/test_db/ 
                 67729d5013cf3f8858eb29cb17e5a723? 
                 rev=1-15f65339921e497348be384867bb940f ↵
                 {"ok":true,"id":"67729d5013cf3f8858eb29cb17e5a723","rev":"2-2
                 d715caed35974bb33de24d1d6c95779"}
                 200


                 $ curl GET http://127.0.0.1:5984/test_db/ 
                 67729d5013cf3f8858eb29cb17e5a723 ↵
                 {"error":"not_found","reason":"deleted"}
                 404




Mittwoch, 16. November 11
CouchApps

                            Dokumente können Attachments haben

                            CouchDB als HTTP Server

                            HTML+CSS+JS ausgeliefert von CouchDB greift via
                            HTTP auf CouchDB als Datenbank zu

                            Beispiel: Kabul War Diary
                            http://upondata.com:5984/afgwar/_design/afgwardiary/
                            index.html



Mittwoch, 16. November 11
Replikation




Mittwoch, 16. November 11
Replikation
                            Replikation läuft via HTTP

                            asynchron

                            inkrementell (online-offline)

                            automatische Konfliktlösung

                            Multi-Version Concurrency Control (MVCC)

                            Multi-Master als default

                            filterbar


Mittwoch, 16. November 11
Map/Reduce Views




Mittwoch, 16. November 11
Accessing Data

                            direkter Zugriff via http://server/DATABASE/DOC-ID

                            materialisierte Views

                               bestehen aus einer map-Phase

                               und einer optionalen reduce-Phase

                            show & list: (Dokument) Transformationen

                            filters, externals, ...



Mittwoch, 16. November 11
Views

                            sortiert, inkrementell, effizienter Zugriff via B-Trees

                            build-in Viewserver:

                               JavaScript (Spidermonkey)

                               Erlang

                            3rd Party Viewserver in Ruby, Python, Java, Perl, ...




Mittwoch, 16. November 11
map/reduce

                            map: Eine Funktion, welche key/value Paare in einen
                            Index schreibt

                            Beispiel Tag-Cloud:

                 1     function(doc) {
                 2       if (doc.tags) {
                 3         for(var idx in doc.tags) {
                 4             emit(doc.tags[idx], 1);
                 5         }
                 6       }
                 7     }




Mittwoch, 16. November 11
map example

                 {“body”:”[...]”, “tags”:[“erlang”, “couchdb”]}
                 {“body”:”[...]”, “tags”:[“couchdb”, “talk”, “rails”]}


                                                     map-function(doc)


                 {“key”:“couchdb”, “value”:1}
                 {“key”:“couchdb”, “value”:1}
                 {“key”:“erlang”, “value”:1}
                 {“key”:“rails”, “value”:1}
                 {“key”:“talk”, “value”:1}

                * indices are automatically sorted




Mittwoch, 16. November 11
map/reduce


                            reduce wird verwendet, um das Ergebnis der map-
                            Phase zu verarbeiten


                 1     function(keys, values, rereduce) {
                 2       return sum(values);
                 3     }




Mittwoch, 16. November 11
reduce example
                 {“key”:“erlang”: “value”:1}
                 {“key”:“couchdb”: “value”:1}
                 {“key”:“couchdb”: “value”:1}
                 {“key”:“talk”: “value”:1}
                 {“key”:“rails”: “value”:1}



                                   reduce function(...)


                 {"key":"erlang","value":1}
                 {"key":"couchdb","value":2}
                 {"key":"talk","value":1}
                 {"key":"rails","value":1}




Mittwoch, 16. November 11
CouchDB: Pros


                            HTTP (Proxy, Caches, Loadbalancer, ...)

                            HTTP (CouchDB als Webserver, 2-tier Apps!)

                            Replikation

                            Views sind sortiert; effizienter Zugriff auf Ranges




Mittwoch, 16. November 11
Cons


                            Append-only erfordert Compaction

                            Append-only & MVCC/Konfliktlösung führen zu
                            Probleme bei Update-heavy Anwendungen

                            keine verteilte Datenbank (sharding, clustering)




Mittwoch, 16. November 11
Get it!
                            http://couchdb.apache.org/downloads.html

                               brew install couchdb / apt-get install couchdb / ...

                            freies Hosting: www.iriscouch.com

                            BigCouch (cloudant.com / https://github.com/cloudant/bigcouch)

                               dynamo-style CouchDB Cluster

                            Couchbase (www.couchbase.com)

                               Membase+CouchDB


Mittwoch, 16. November 11
Thanks! Q & A?


                                     ?
                                 Sebastian Cohnen
                                      @tisba


Mittwoch, 16. November 11
Understanding
                               reduce
                 1     function(keys, values, rereduce) {}


                            a b c d | e f g h | i j k l | m n
                            1 2 1 3 | 1 2 3 1 | 2 3 3 1 | 1 8
                               7         7    |     9       9
                                  14                    18
                                             32

                  function(     [[“a”,id1],[“b”,id2],[“c”,id3],[“d”,id4]],
                                 [1,         2,       1,        3],
                                false) {...}


                  function(null, [ 7, 7], true) {...}
                  function(null, [ 9, 9], true) {...}
                  function(null, [14,18], true) {...}

Mittwoch, 16. November 11

More Related Content

What's hot

What is nodejs
What is nodejsWhat is nodejs
What is nodejs
JeongHun Byeon
 
Couchdb w Ruby'm
Couchdb w Ruby'mCouchdb w Ruby'm
Couchdb w Ruby'm
Stanisław Wasiutyński
 
Lua tech talk
Lua tech talkLua tech talk
Lua tech talk
Locaweb
 
Node.js - A practical introduction (v2)
Node.js  - A practical introduction (v2)Node.js  - A practical introduction (v2)
Node.js - A practical introduction (v2)
Felix Geisendörfer
 
Database schema management in Ruby apps
Database schema management in Ruby appsDatabase schema management in Ruby apps
Database schema management in Ruby apps
Vsevolod Romashov
 
Py conkr 20150829_docker-python
Py conkr 20150829_docker-pythonPy conkr 20150829_docker-python
Py conkr 20150829_docker-python
Eric Ahn
 
BlockChain implementation by python
BlockChain implementation by pythonBlockChain implementation by python
BlockChain implementation by python
wonyong hwang
 
Miscelaneous Debris
Miscelaneous DebrisMiscelaneous Debris
Miscelaneous Debris
frewmbot
 
Node.js - A Quick Tour II
Node.js - A Quick Tour IINode.js - A Quick Tour II
Node.js - A Quick Tour II
Felix Geisendörfer
 
Ansible leveraging 2.0
Ansible leveraging 2.0Ansible leveraging 2.0
Ansible leveraging 2.0
bcoca
 
No REST for the Wicked: REST and Catalyst
No REST for the Wicked: REST and CatalystNo REST for the Wicked: REST and Catalyst
No REST for the Wicked: REST and Catalyst
Jay Shirley
 
Challenges when building high profile editorial sites
Challenges when building high profile editorial sitesChallenges when building high profile editorial sites
Challenges when building high profile editorial sites
Yann Malet
 
Ubic
UbicUbic
Devon 2011-f-4-improve your-javascript
Devon 2011-f-4-improve your-javascriptDevon 2011-f-4-improve your-javascript
Devon 2011-f-4-improve your-javascript
Daum DNA
 
Developing JavaScript Widgets
Developing JavaScript WidgetsDeveloping JavaScript Widgets
Developing JavaScript Widgets
Konstantin Käfer
 
Redis - Usability and Use Cases
Redis - Usability and Use CasesRedis - Usability and Use Cases
Redis - Usability and Use Cases
Fabrizio Farinacci
 
Puppet fundamentals
Puppet fundamentalsPuppet fundamentals
Puppet fundamentals
Murali Boyapati
 
Who is afraid of privileged containers ?
Who is afraid of privileged containers ?Who is afraid of privileged containers ?
Who is afraid of privileged containers ?
Marko Bevc
 
第一回MongoDBソースコードリーディング
第一回MongoDBソースコードリーディング第一回MongoDBソースコードリーディング
第一回MongoDBソースコードリーディング
nobu_k
 
Kicking ass with redis
Kicking ass with redisKicking ass with redis
Kicking ass with redis
Dvir Volk
 

What's hot (20)

What is nodejs
What is nodejsWhat is nodejs
What is nodejs
 
Couchdb w Ruby'm
Couchdb w Ruby'mCouchdb w Ruby'm
Couchdb w Ruby'm
 
Lua tech talk
Lua tech talkLua tech talk
Lua tech talk
 
Node.js - A practical introduction (v2)
Node.js  - A practical introduction (v2)Node.js  - A practical introduction (v2)
Node.js - A practical introduction (v2)
 
Database schema management in Ruby apps
Database schema management in Ruby appsDatabase schema management in Ruby apps
Database schema management in Ruby apps
 
Py conkr 20150829_docker-python
Py conkr 20150829_docker-pythonPy conkr 20150829_docker-python
Py conkr 20150829_docker-python
 
BlockChain implementation by python
BlockChain implementation by pythonBlockChain implementation by python
BlockChain implementation by python
 
Miscelaneous Debris
Miscelaneous DebrisMiscelaneous Debris
Miscelaneous Debris
 
Node.js - A Quick Tour II
Node.js - A Quick Tour IINode.js - A Quick Tour II
Node.js - A Quick Tour II
 
Ansible leveraging 2.0
Ansible leveraging 2.0Ansible leveraging 2.0
Ansible leveraging 2.0
 
No REST for the Wicked: REST and Catalyst
No REST for the Wicked: REST and CatalystNo REST for the Wicked: REST and Catalyst
No REST for the Wicked: REST and Catalyst
 
Challenges when building high profile editorial sites
Challenges when building high profile editorial sitesChallenges when building high profile editorial sites
Challenges when building high profile editorial sites
 
Ubic
UbicUbic
Ubic
 
Devon 2011-f-4-improve your-javascript
Devon 2011-f-4-improve your-javascriptDevon 2011-f-4-improve your-javascript
Devon 2011-f-4-improve your-javascript
 
Developing JavaScript Widgets
Developing JavaScript WidgetsDeveloping JavaScript Widgets
Developing JavaScript Widgets
 
Redis - Usability and Use Cases
Redis - Usability and Use CasesRedis - Usability and Use Cases
Redis - Usability and Use Cases
 
Puppet fundamentals
Puppet fundamentalsPuppet fundamentals
Puppet fundamentals
 
Who is afraid of privileged containers ?
Who is afraid of privileged containers ?Who is afraid of privileged containers ?
Who is afraid of privileged containers ?
 
第一回MongoDBソースコードリーディング
第一回MongoDBソースコードリーディング第一回MongoDBソースコードリーディング
第一回MongoDBソースコードリーディング
 
Kicking ass with redis
Kicking ass with redisKicking ass with redis
Kicking ass with redis
 

Viewers also liked

Erlang web framework: Chicago boss
Erlang web framework: Chicago bossErlang web framework: Chicago boss
Erlang web framework: Chicago boss
Barcamp Saigon
 
NoSQL CGN: Riak (01/2012)
NoSQL CGN: Riak (01/2012)NoSQL CGN: Riak (01/2012)
NoSQL CGN: Riak (01/2012)
Sebastian Cohnen
 
Artist in Transit @RSE11
Artist in Transit @RSE11Artist in Transit @RSE11
Artist in Transit @RSE11
Matthias Mueller-Prove
 
Movement, Empathie und die Sehnsucht nach Rhythmus
Movement, Empathie und die Sehnsucht nach RhythmusMovement, Empathie und die Sehnsucht nach Rhythmus
Movement, Empathie und die Sehnsucht nach Rhythmus
Dirk Platzek
 
Einführung in nosql // ArangoDB mit Symfony 2
Einführung in nosql // ArangoDB mit Symfony 2Einführung in nosql // ArangoDB mit Symfony 2
Einführung in nosql // ArangoDB mit Symfony 2
ArangoDB Database
 
OpenData - Was hat das mit mir zu tun? @RSE13
OpenData - Was hat das mit mir zu tun? @RSE13OpenData - Was hat das mit mir zu tun? @RSE13
OpenData - Was hat das mit mir zu tun? @RSE13
Matthias Mueller-Prove
 

Viewers also liked (6)

Erlang web framework: Chicago boss
Erlang web framework: Chicago bossErlang web framework: Chicago boss
Erlang web framework: Chicago boss
 
NoSQL CGN: Riak (01/2012)
NoSQL CGN: Riak (01/2012)NoSQL CGN: Riak (01/2012)
NoSQL CGN: Riak (01/2012)
 
Artist in Transit @RSE11
Artist in Transit @RSE11Artist in Transit @RSE11
Artist in Transit @RSE11
 
Movement, Empathie und die Sehnsucht nach Rhythmus
Movement, Empathie und die Sehnsucht nach RhythmusMovement, Empathie und die Sehnsucht nach Rhythmus
Movement, Empathie und die Sehnsucht nach Rhythmus
 
Einführung in nosql // ArangoDB mit Symfony 2
Einführung in nosql // ArangoDB mit Symfony 2Einführung in nosql // ArangoDB mit Symfony 2
Einführung in nosql // ArangoDB mit Symfony 2
 
OpenData - Was hat das mit mir zu tun? @RSE13
OpenData - Was hat das mit mir zu tun? @RSE13OpenData - Was hat das mit mir zu tun? @RSE13
OpenData - Was hat das mit mir zu tun? @RSE13
 

Similar to NoSQL CGN: CouchDB (11/2011)

CouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 HourCouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 Hour
Peter Friese
 
Craig Brown speaks on ElasticSearch
Craig Brown speaks on ElasticSearchCraig Brown speaks on ElasticSearch
Craig Brown speaks on ElasticSearch
imarcticblue
 
elasticsearch basics workshop
elasticsearch basics workshopelasticsearch basics workshop
elasticsearch basics workshop
Mathieu Elie
 
De vuelta al pasado con SQL y stored procedures
De vuelta al pasado con SQL y stored proceduresDe vuelta al pasado con SQL y stored procedures
De vuelta al pasado con SQL y stored procedures
Norman Clarke
 
CouchDB Open Source Bridge
CouchDB Open Source BridgeCouchDB Open Source Bridge
CouchDB Open Source Bridge
Chris Anderson
 
Couchdb Nosql
Couchdb NosqlCouchdb Nosql
Couchdb Nosql
elliando dias
 
Play framework
Play frameworkPlay framework
Play framework
Andrew Skiba
 
Rupy2012 ArangoDB Workshop Part1
Rupy2012 ArangoDB Workshop Part1Rupy2012 ArangoDB Workshop Part1
Rupy2012 ArangoDB Workshop Part1
ArangoDB Database
 
Advanced CouchDB Rotterdam.rb July 2010
Advanced CouchDB Rotterdam.rb July 2010Advanced CouchDB Rotterdam.rb July 2010
Advanced CouchDB Rotterdam.rb July 2010
Sander van de Graaf
 
MongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your Data
MongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your DataMongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your Data
MongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your Data
MongoDB
 
Putting rails and couch db on the cloud - Indicthreads cloud computing confe...
Putting rails and couch db on the cloud -  Indicthreads cloud computing confe...Putting rails and couch db on the cloud -  Indicthreads cloud computing confe...
Putting rails and couch db on the cloud - Indicthreads cloud computing confe...
IndicThreads
 
CouchDB at JAOO Århus 2009
CouchDB at JAOO Århus 2009CouchDB at JAOO Århus 2009
CouchDB at JAOO Århus 2009
Jason Davies
 
NoSQL - An introduction to CouchDB
NoSQL - An introduction to CouchDBNoSQL - An introduction to CouchDB
NoSQL - An introduction to CouchDB
Jonathan Weiss
 
DataMapper on Infinispan
DataMapper on InfinispanDataMapper on Infinispan
DataMapper on Infinispan
Lance Ball
 
Puppet and AWS: Getting the best of both worlds
Puppet and AWS: Getting the best of both worldsPuppet and AWS: Getting the best of both worlds
Puppet and AWS: Getting the best of both worlds
Puppet
 
Meetup#1: 10 reasons to fall in love with MongoDB
Meetup#1: 10 reasons to fall in love with MongoDBMeetup#1: 10 reasons to fall in love with MongoDB
Meetup#1: 10 reasons to fall in love with MongoDB
Minsk MongoDB User Group
 
Data manipulation for configuration management using Ansible
Data manipulation for configuration management using AnsibleData manipulation for configuration management using Ansible
Data manipulation for configuration management using Ansible
Joel W. King
 
Elasticsearch – mye mer enn søk! [JavaZone 2013]
Elasticsearch – mye mer enn søk! [JavaZone 2013]Elasticsearch – mye mer enn søk! [JavaZone 2013]
Elasticsearch – mye mer enn søk! [JavaZone 2013]
foundsearch
 
CouchDB : More Couch
CouchDB : More CouchCouchDB : More Couch
CouchDB : More Couch
delagoya
 
CouchDB on Rails - FrozenRails 2010
CouchDB on Rails - FrozenRails 2010CouchDB on Rails - FrozenRails 2010
CouchDB on Rails - FrozenRails 2010
Jonathan Weiss
 

Similar to NoSQL CGN: CouchDB (11/2011) (20)

CouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 HourCouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 Hour
 
Craig Brown speaks on ElasticSearch
Craig Brown speaks on ElasticSearchCraig Brown speaks on ElasticSearch
Craig Brown speaks on ElasticSearch
 
elasticsearch basics workshop
elasticsearch basics workshopelasticsearch basics workshop
elasticsearch basics workshop
 
De vuelta al pasado con SQL y stored procedures
De vuelta al pasado con SQL y stored proceduresDe vuelta al pasado con SQL y stored procedures
De vuelta al pasado con SQL y stored procedures
 
CouchDB Open Source Bridge
CouchDB Open Source BridgeCouchDB Open Source Bridge
CouchDB Open Source Bridge
 
Couchdb Nosql
Couchdb NosqlCouchdb Nosql
Couchdb Nosql
 
Play framework
Play frameworkPlay framework
Play framework
 
Rupy2012 ArangoDB Workshop Part1
Rupy2012 ArangoDB Workshop Part1Rupy2012 ArangoDB Workshop Part1
Rupy2012 ArangoDB Workshop Part1
 
Advanced CouchDB Rotterdam.rb July 2010
Advanced CouchDB Rotterdam.rb July 2010Advanced CouchDB Rotterdam.rb July 2010
Advanced CouchDB Rotterdam.rb July 2010
 
MongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your Data
MongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your DataMongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your Data
MongoDB .local Toronto 2019: Using Change Streams to Keep Up with Your Data
 
Putting rails and couch db on the cloud - Indicthreads cloud computing confe...
Putting rails and couch db on the cloud -  Indicthreads cloud computing confe...Putting rails and couch db on the cloud -  Indicthreads cloud computing confe...
Putting rails and couch db on the cloud - Indicthreads cloud computing confe...
 
CouchDB at JAOO Århus 2009
CouchDB at JAOO Århus 2009CouchDB at JAOO Århus 2009
CouchDB at JAOO Århus 2009
 
NoSQL - An introduction to CouchDB
NoSQL - An introduction to CouchDBNoSQL - An introduction to CouchDB
NoSQL - An introduction to CouchDB
 
DataMapper on Infinispan
DataMapper on InfinispanDataMapper on Infinispan
DataMapper on Infinispan
 
Puppet and AWS: Getting the best of both worlds
Puppet and AWS: Getting the best of both worldsPuppet and AWS: Getting the best of both worlds
Puppet and AWS: Getting the best of both worlds
 
Meetup#1: 10 reasons to fall in love with MongoDB
Meetup#1: 10 reasons to fall in love with MongoDBMeetup#1: 10 reasons to fall in love with MongoDB
Meetup#1: 10 reasons to fall in love with MongoDB
 
Data manipulation for configuration management using Ansible
Data manipulation for configuration management using AnsibleData manipulation for configuration management using Ansible
Data manipulation for configuration management using Ansible
 
Elasticsearch – mye mer enn søk! [JavaZone 2013]
Elasticsearch – mye mer enn søk! [JavaZone 2013]Elasticsearch – mye mer enn søk! [JavaZone 2013]
Elasticsearch – mye mer enn søk! [JavaZone 2013]
 
CouchDB : More Couch
CouchDB : More CouchCouchDB : More Couch
CouchDB : More Couch
 
CouchDB on Rails - FrozenRails 2010
CouchDB on Rails - FrozenRails 2010CouchDB on Rails - FrozenRails 2010
CouchDB on Rails - FrozenRails 2010
 

Recently uploaded

GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
Federico Razzoli
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
jpupo2018
 

Recently uploaded (20)

GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
 

NoSQL CGN: CouchDB (11/2011)

  • 1. Relax! Sebastian Cohnen @tisba / tisba.de Mittwoch, 16. November 11
  • 2. About Me • Freier Entwickler ❤ Ruby/Rails & node.js ❤ Performance & Scalability Engineering ❤ Distributed Load Testing ❤ CouchDB, Redis & Riak und ebenfalls interessiert an Erlang, AMQP, ... Mittwoch, 16. November 11
  • 3. Users of Couchdb BBC meebo UbuntuOne ... adcloud Mittwoch, 16. November 11
  • 4. CouchDB: Basics Schema-frei Dokumenten-orientiert Key/Value-Speicher fehlertolerant & robust Mittwoch, 16. November 11
  • 5. Key Features HTTP + JSON Multi-Master Replikation AP aus CAP Append-only inkrementelle, materialisierte Views (map/reduce) Mittwoch, 16. November 11
  • 6. HTTP & JSON Mittwoch, 16. November 11
  • 8. Create A Database $ curl -w%{http_code} -X PUT http://127.0.0.1:5984/test_db ↵ {"ok":true} 201 $ $ curl -w%{http_code} -X GET http://127.0.0.1:5984/test_db ↵ {"db_name":"test_db","doc_count":0,"doc_del_count":0, "update_seq":1,"purge_seq":0, "compact_running":false, "disk_size":16473, "instance_start_time": "1253091887127542","disk_format_version":4} 200 * $ alias curl='curl -w%{http_code} -X' Mittwoch, 16. November 11
  • 9. create A Document $ curl POST -d '{"hello":"world"}' http://127.0.0.1:5984/ test_db ↵ {"ok":true,"id":"67729d5013cf3f8858eb29cb17e5a723","rev":"1-1 5f65339921e497348be384867bb940f"} 201 read $ curl GET http://127.0.0.1:5984/test_db/ 67729d5013cf3f8858eb29cb17e5a723 ↵ {"_id":"67729d5013cf3f8858eb29cb17e5a723","_rev":"1-15f653399 21e497348be384867bb940f","hello":"world"} 200 Mittwoch, 16. November 11
  • 10. update $ curl PUT -d '{"_rev":"1-15f65339921e497348be384867bb940f", "hello":"world","message":"about to show CRUD in couch"}' http://127.0.0.1:5984/test_db/ 2f41f56816191b94ecbd127151faa242 ↵ {"ok":true,"id":"2f41f56816191b94ecbd127151faa242","rev":"2-2 873c60120aa6dbe2204cd2c1a0e8722"} 201 $ curl GET http://127.0.0.1:5984/test_db/ 2f41f56816191b94ecbd127151faa242 ↵ {"_id":"2f41f56816191b94ecbd127151faa242","_rev":"2-2873c6012 0aa6dbe2204cd2c1a0e8722","hello":"world","message":"about to show CRUD in couch"} 200 Mittwoch, 16. November 11
  • 11. delete $ curl DELETE http://127.0.0.1:5984/test_db/ 67729d5013cf3f8858eb29cb17e5a723? rev=1-15f65339921e497348be384867bb940f ↵ {"ok":true,"id":"67729d5013cf3f8858eb29cb17e5a723","rev":"2-2 d715caed35974bb33de24d1d6c95779"} 200 $ curl GET http://127.0.0.1:5984/test_db/ 67729d5013cf3f8858eb29cb17e5a723 ↵ {"error":"not_found","reason":"deleted"} 404 Mittwoch, 16. November 11
  • 12. CouchApps Dokumente können Attachments haben CouchDB als HTTP Server HTML+CSS+JS ausgeliefert von CouchDB greift via HTTP auf CouchDB als Datenbank zu Beispiel: Kabul War Diary http://upondata.com:5984/afgwar/_design/afgwardiary/ index.html Mittwoch, 16. November 11
  • 14. Replikation Replikation läuft via HTTP asynchron inkrementell (online-offline) automatische Konfliktlösung Multi-Version Concurrency Control (MVCC) Multi-Master als default filterbar Mittwoch, 16. November 11
  • 16. Accessing Data direkter Zugriff via http://server/DATABASE/DOC-ID materialisierte Views bestehen aus einer map-Phase und einer optionalen reduce-Phase show & list: (Dokument) Transformationen filters, externals, ... Mittwoch, 16. November 11
  • 17. Views sortiert, inkrementell, effizienter Zugriff via B-Trees build-in Viewserver: JavaScript (Spidermonkey) Erlang 3rd Party Viewserver in Ruby, Python, Java, Perl, ... Mittwoch, 16. November 11
  • 18. map/reduce map: Eine Funktion, welche key/value Paare in einen Index schreibt Beispiel Tag-Cloud: 1 function(doc) { 2 if (doc.tags) { 3 for(var idx in doc.tags) { 4 emit(doc.tags[idx], 1); 5 } 6 } 7 } Mittwoch, 16. November 11
  • 19. map example {“body”:”[...]”, “tags”:[“erlang”, “couchdb”]} {“body”:”[...]”, “tags”:[“couchdb”, “talk”, “rails”]} map-function(doc) {“key”:“couchdb”, “value”:1} {“key”:“couchdb”, “value”:1} {“key”:“erlang”, “value”:1} {“key”:“rails”, “value”:1} {“key”:“talk”, “value”:1} * indices are automatically sorted Mittwoch, 16. November 11
  • 20. map/reduce reduce wird verwendet, um das Ergebnis der map- Phase zu verarbeiten 1 function(keys, values, rereduce) { 2 return sum(values); 3 } Mittwoch, 16. November 11
  • 21. reduce example {“key”:“erlang”: “value”:1} {“key”:“couchdb”: “value”:1} {“key”:“couchdb”: “value”:1} {“key”:“talk”: “value”:1} {“key”:“rails”: “value”:1} reduce function(...) {"key":"erlang","value":1} {"key":"couchdb","value":2} {"key":"talk","value":1} {"key":"rails","value":1} Mittwoch, 16. November 11
  • 22. CouchDB: Pros HTTP (Proxy, Caches, Loadbalancer, ...) HTTP (CouchDB als Webserver, 2-tier Apps!) Replikation Views sind sortiert; effizienter Zugriff auf Ranges Mittwoch, 16. November 11
  • 23. Cons Append-only erfordert Compaction Append-only & MVCC/Konfliktlösung führen zu Probleme bei Update-heavy Anwendungen keine verteilte Datenbank (sharding, clustering) Mittwoch, 16. November 11
  • 24. Get it! http://couchdb.apache.org/downloads.html brew install couchdb / apt-get install couchdb / ... freies Hosting: www.iriscouch.com BigCouch (cloudant.com / https://github.com/cloudant/bigcouch) dynamo-style CouchDB Cluster Couchbase (www.couchbase.com) Membase+CouchDB Mittwoch, 16. November 11
  • 25. Thanks! Q & A? ? Sebastian Cohnen @tisba Mittwoch, 16. November 11
  • 26. Understanding reduce 1 function(keys, values, rereduce) {} a b c d | e f g h | i j k l | m n 1 2 1 3 | 1 2 3 1 | 2 3 3 1 | 1 8 7 7 | 9 9 14 18 32 function( [[“a”,id1],[“b”,id2],[“c”,id3],[“d”,id4]], [1, 2, 1, 3], false) {...} function(null, [ 7, 7], true) {...} function(null, [ 9, 9], true) {...} function(null, [14,18], true) {...} Mittwoch, 16. November 11