SlideShare una empresa de Scribd logo
1 de 53
Descargar para leer sin conexión
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/

Más contenido relacionado

Similar a 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
 
A Jisc Perspective Of Impact And Evidence
A Jisc Perspective Of Impact And EvidenceA Jisc Perspective Of Impact And Evidence
A Jisc Perspective Of Impact And Evidence
Ian Cooper
 

Similar a 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
 
A Jisc Perspective Of Impact And Evidence
A Jisc Perspective Of Impact And EvidenceA Jisc Perspective Of Impact And Evidence
A Jisc Perspective Of Impact And Evidence
 
미래를 읽는 기술(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
 
Designing The Digital Experience
Designing The Digital ExperienceDesigning The Digital Experience
Designing The Digital Experience
 
RailsConf 2008
RailsConf 2008RailsConf 2008
RailsConf 2008
 

Más de 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
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
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
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
"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 ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 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
 
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...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

GTALUG Presentation on CouchDB