SlideShare ist ein Scribd-Unternehmen logo
1 von 53
Downloaden Sie, um offline zu lesen
Who am I?
Myles Braithwaite
We Develop Websites
What is CouchDB?
Erlang
Apache CouchDB is a distributed, fault-tolerant and schema-
free document-oriented database accessible via a RESTful
HTTP/JSON API. Among other features, it provides robust,
incremental replication with bi-directional conflict detection
and resolution, and is queryable and indexable using a table-
oriented view engine with JavaScript acting as the default view
definition language.

   Quote from http://couchdb.org/.
Document-Oriented
    Database
• Each record is store as a document.
• Any number of fields of any length.
• Fields can also contain multiple pieces of
  data.
<people>
	 <person first_name=quot;Mylesquot;
    last_name=quot;Braithwaitequot;>
	 	 <emails>
	 	 	 <email value=quot;me@myles.tkquot;/>
	 	 	 <email value=quot;myles@miys.netquot;/>
	 	 </emails>
	 </person>
</people>
[
	   {
	   	   quot;first_namequot;: quot;Mylesquot;,
	   	   quot;last_namequot;: quot;Braithwaitequot;,
	   	   quot;emailsquot;: [
	   	   	 { quot;emailquot;: quot;me@myles.tkquot; },
	   	   	 { quot;emailquot;: quot;myles@miys.netquot; }
	   	   ]
	   }
]
Relational Database it would require two tables
What is RESTful HTTP?
Does anyone not know
   what HTTP is?
REST
• Representational State Transfer
• The foundation of all Web Services
 • SOAP,
 • XML-RPC,
 • and basic HTTP methods like:
   • POST, GET, PUT, DELETE
RESTful HTTP Methods           CRUD
       POST            Create, Update & Delete
        GET                     Read
        PUT               Create & Replace
      DELETE                   Delete
“Django may be built for the Web, but CouchDB is built of the
Web. I’ve never seen software that so completely embraces the
philosophies behind HTTP. CouchDB makes Django look old-
school in the same way that Django makes ASP look outdated.”

                    — Jacob Kaplan-Moss, Django Developer
What is JSON?
• JavaScript version of XML.
• A less dramatic/lightweight version of XML.
• Google and Yahoo are using it in there Web
  Services.
Distributed
Bi-Directional Conflict
    Detection and
      Resolution
Bi-Directional Conflict
    Detection and
      Resolution
Bi-Directional Conflict
    Detection and
      Resolution
Query Documents with
      JavaScript
Views
• Map Functions
• Reduce Functions
• Lookup Views -- Demo
• Complex Keys -- Demo
Map Functions

function(doc) {
	emit(null, doc);
}
Map Functions
function(doc) {
   if (doc.first_name && doc.last_name) {
     var full_name =Text
                     (doc.first_name
       + quot; quot; + doc.last_name)
     emit(full_name, doc);
   }
};
Reduce Functions

function (key, values, rereduce) {
	 return sum(values);
}
Futon
Basically the
PHPMyAdmin for
   CouchDB
Demo Time
$ curl -X PUT -v 'http://127.0.0.1:5984/
temp_database/'

> PUT /temp_database/ HTTP/1.1
> User-Agent: curl
> Host: 127.0.0.1:5984
> Accept: */*
>
< HTTP/1.1 201 Created
< Server: CouchDB
< Date: Tue, 09 Dec 2008 20:32:15 GMT
< Content-Type: text/plain;charset=utf-8
< Content-Length: 11
<
{quot;okquot;:true}
$ curl -X DELETE -v 'http://127.0.0.1:5984/
temp_database/'

> DELETE /temp_database/ HTTP/1.1
> User-Agent: curl
> Host: 127.0.0.1:5984
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: CouchDB
< Date: Tue, 09 Dec 2008 20:35:26 GMT
< Content-Type: text/plain;charset=utf-8
< Content-Length: 11
<
{quot;okquot;:true}
$ curl 'http://127.0.0.1:5984/'

{quot;couchdbquot;:quot;Welcomequot;,quot;versionquot;:quot;0.8
.1-incubatingquot;}
$ curl 'http://127.0.0.1:5984/
address_book/'

{quot;db_namequot;:quot;address_bookquot;,quot;doc_countquot;:
18,quot;doc_del_countquot;:2,quot;update_seqquot;:
117,quot;compact_runningquot;:false,quot;disk_sizequot;:
242905}
$ curl 'http://127.0.0.1:5984/
address_book/_all_docs/'

{quot;total_rowsquot;:18,quot;offsetquot;:0,quot;rowsquot;:[
{quot;idquot;:quot;1074d8805eaa79dfec356d34aa719a95quot;,
quot;keyquot;:quot;1074d8805eaa79dfec356d34aa719a95quot;,
quot;valuequot;:{quot;revquot;:quot;3720758831quot;}},
...
$ curl 'http://127.0.0.1:5984/
address_book/_all_docs?count=1'

{quot;total_rowsquot;:18,quot;offsetquot;:0,quot;rowsquot;:[
{quot;idquot;:quot;1074d8805eaa79dfec356d34aa719a95quot;,
quot;keyquot;:quot;1074d8805eaa79dfec356d34aa719a95quot;,
quot;valuequot;:{quot;revquot;:quot;3720758831quot;}}
]}
curl 'http://127.0.0.1:5984/address_book/
1074d8805eaa79dfec356d34aa719a95/'

{quot;_idquot;:quot;1074d8805eaa79dfec356d34aa719a95quot;
,quot;_revquot;:quot;3720758831quot;,quot;Fromquot;:
{quot;namequot;:quot;Myles
Braithwaitequot;,quot;emailquot;:quot;me@mylesbraithwaite
.netquot;},quot;Toquot;:quot;tlug@ss.orgquot;,quot;Subjectquot;:quot;Re:
[TLUG]: Re: [TLUG-ANNOUNCE]: TLUG
Meeting. Tue Sep 9quot;,quot;Datequot;:quot;Wed, 10 Sep
2008 15:28:22 -0400quot;,quot;bodyquot;:quot;...quot;}
$ curl 'http://127.0.0.1:5984/
address_book/
1074d8805eaa79dfec356d34aa719a95?
rev=3720758831'
$ curl 'http://127.0.0.1:5984/
address_book/
1074d8805eaa79dfec356d34aa719a95?
revs=true'

{quot;_idquot;:quot;1074d8805eaa79dfec356d34aa719a95quot;
,quot;_revquot;:quot;3720758831quot;,
...
quot;_revsquot;:
[quot;3720758831quot;,quot;1987563969quot;,quot;3227393092quot;]}
$ curl 'http://127.0.0.1:5984/address_book/_view/
contacts/contact_list/'

{quot;total_rowsquot;:5,quot;offsetquot;:0,quot;rowsquot;:[
{quot;idquot;:quot;93a31f6756545d9d59ca53fba6f92fe0quot;,quot;keyquot;:quot;My
les Braithwaitequot;,quot;valuequot;:
{quot;_idquot;:quot;93a31f6756545d9d59ca53fba6f92fe0quot;,quot;_revquot;:quot;
3685624062quot;,quot;fnquot;:{quot;family-
namequot;:quot;Braithwaitequot;,quot;given-namequot;:quot;Mylesquot;},quot;emailquot;:
[{quot;valuequot;:quot;me@mylesbraithwaite.netquot;,quot;typequot;:quot;Person
alquot;},
{quot;valuequot;:quot;myles@monkeyinyoursoul.comquot;,quot;typequot;:quot;Work
quot;}],quot;orgquot;:{quot;organization-namequot;:quot;Monkey in your
Soulquot;}}}
...
Use Cases
What CouchDB should
  not be used for!
• A relational database.
• A replacement for relational databases.
• An object-oriented database. Or more
  specifically, meant to function as a seamless
  persistence layer for an OO programming
  language.
Pictures
•   http://flickr.com/photos/
    83737641@N00/2377691249/
                                          •   http://flickr.com/photos/
                                              photonquantique/2596581870/
                                                                                   •   http://flickr.com/photos/
                                                                                       mbiddulph/2037845171/



•   http://flickr.com/photos/
    dragon2309/1490657223/
                                          •   http://flickr.com/photos/
                                              malcolmtredinnick/202679799/
                                                                                   •   http://flickr.com/photos/cgc/
                                                                                       130309167/



•   http://flickr.com/photos/herzogbr/
    359841353/
                                          •   http://flickr.com/photos/
                                              andrewmoir/3012531/
                                                                                   •   http://www.flickr.com/photos/
                                                                                       daveaustria/2654190796



•   http://flickr.com/photos/irisheyes/
    1160297224/
                                          •   http://flickr.com/photos/apesara/
                                              2499666202/



•   http://flickr.com/photos/
    jessefriedman/1435220149/
                                          •   http://flickr.com/photos/
                                              mehrwert/18711050/



•   http://flickr.com/photos/tomnatt/
    2763592134/
                                          •   http://flickr.com/photos/
                                              bohemianrabbit/2815366720/



•   http://flickr.com/photos/
    theo_reth/188334429/
                                          •   http://flickr.com/photos/ianturton/
                                              2155423758/

Weitere ähnliche Inhalte

Ähnlich wie GTALUG Presentation on CouchDB

How I failed to present on using DVCS to control archival metadata
How I failed to present on using DVCS to control archival metadataHow I failed to present on using DVCS to control archival metadata
How I failed to present on using DVCS to control archival metadata
Mark Matienzo
 

Ähnlich wie GTALUG Presentation on CouchDB (20)

Making Mobile Sites Faster
Making Mobile Sites FasterMaking Mobile Sites Faster
Making Mobile Sites Faster
 
Suw Charman - Preparing for Enterprise Adoption FOWA
Suw Charman - Preparing for Enterprise Adoption FOWASuw Charman - Preparing for Enterprise Adoption FOWA
Suw Charman - Preparing for Enterprise Adoption FOWA
 
The Shape of Alpha
The Shape of AlphaThe Shape of Alpha
The Shape of Alpha
 
How I failed to present on using DVCS to control archival metadata
How I failed to present on using DVCS to control archival metadataHow I failed to present on using DVCS to control archival metadata
How I failed to present on using DVCS to control archival metadata
 
The Ecology of Information: A Future in a Library Without Walls
The Ecology of Information:  A Future in a Library Without WallsThe Ecology of Information:  A Future in a Library Without Walls
The Ecology of Information: A Future in a Library Without Walls
 
Functional Interaction Design
Functional Interaction DesignFunctional Interaction Design
Functional Interaction Design
 
Map Analytics - Ignite Spatial
Map Analytics - Ignite SpatialMap Analytics - Ignite Spatial
Map Analytics - Ignite Spatial
 
Introduction to CouchDB
Introduction to CouchDBIntroduction to CouchDB
Introduction to CouchDB
 
Playful IAs @ Euro IA Summit 2007
Playful IAs @ Euro IA Summit 2007Playful IAs @ Euro IA Summit 2007
Playful IAs @ Euro IA Summit 2007
 
Designing The Digital Experience
Designing The Digital ExperienceDesigning The Digital Experience
Designing The Digital Experience
 
Making Mobile Sites Faster
Making Mobile Sites FasterMaking Mobile Sites Faster
Making Mobile Sites Faster
 
Pecha Kucha @CiL2008
Pecha Kucha @CiL2008Pecha Kucha @CiL2008
Pecha Kucha @CiL2008
 
미래를 읽는 기술(Future Inc) Pechakucha
미래를 읽는 기술(Future Inc) Pechakucha미래를 읽는 기술(Future Inc) Pechakucha
미래를 읽는 기술(Future Inc) Pechakucha
 
Speed Matters!
Speed Matters!Speed Matters!
Speed Matters!
 
Jabber Bot
Jabber BotJabber Bot
Jabber Bot
 
You Are A Neuron
You Are A NeuronYou Are A Neuron
You Are A Neuron
 
Flickr Open Api Mashup
Flickr Open Api MashupFlickr Open Api Mashup
Flickr Open Api Mashup
 
RailsConf 2008
RailsConf 2008RailsConf 2008
RailsConf 2008
 
Rubyから教わったものづくり
Rubyから教わったものづくりRubyから教わったものづくり
Rubyから教わったものづくり
 
Game wardenpowerpoint2
Game wardenpowerpoint2Game wardenpowerpoint2
Game wardenpowerpoint2
 

Mehr von Myles Braithwaite (8)

Take a Stroll in the Bazaar
Take a Stroll in the BazaarTake a Stroll in the Bazaar
Take a Stroll in the Bazaar
 
jrnl Presentation @ March 2015 GTALUG Meeting
jrnl Presentation @ March 2015 GTALUG Meetingjrnl Presentation @ March 2015 GTALUG Meeting
jrnl Presentation @ March 2015 GTALUG Meeting
 
Apache CouchDB Presentation @ Sept. 2104 GTALUG Meeting
Apache CouchDB Presentation @ Sept. 2104 GTALUG MeetingApache CouchDB Presentation @ Sept. 2104 GTALUG Meeting
Apache CouchDB Presentation @ Sept. 2104 GTALUG Meeting
 
GTALUG Short Talk On Mercurial
GTALUG Short Talk On MercurialGTALUG Short Talk On Mercurial
GTALUG Short Talk On Mercurial
 
Apache CouchDB talk at Ontario GNU Linux Fest
Apache CouchDB talk at Ontario GNU Linux FestApache CouchDB talk at Ontario GNU Linux Fest
Apache CouchDB talk at Ontario GNU Linux Fest
 
So You Want A Personal Website?
So You Want A Personal Website?So You Want A Personal Website?
So You Want A Personal Website?
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
 
Django GTALUG Presentation
Django GTALUG PresentationDjango GTALUG Presentation
Django GTALUG Presentation
 

Kürzlich hochgeladen

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Kürzlich hochgeladen (20)

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 

GTALUG Presentation on CouchDB