SlideShare una empresa de Scribd logo
1 de 38
Descargar para leer sin conexión
Who Am I?
• Chris Anderson <jchris@apache.org>
• CouchDB committer
• Blog: http://jchrisa.net
Couch History
•   Damien Katz <http://damienkatz.net/>

•   Worked on Lotus Notes & MySQL

•   Started CouchDB in 2005

•   2006: Moved to Erlang, JSON and JavaScript

•   Approaching 0.9 Release
2008 Erlang User of the Year
This Talk
  • Hello CouchDB
  • Hands on with CouchApp
  • The Future
  • Get Involved
Hello CouchDB
• JSON Documents
• HTTP / REST (You already know the API)
• ACID Storage Engine
• Map Reduce Views
• Replication for Freedom
• Portable Standalone Applications
JSON Documents
   {“json” : “key / value pairs”,
       “_id” : “some uuid”,
       “_rev” : “mvcc key”,
“string keys” : [1,2,3,”four”,null],
     “schema free” : true}
      Your programming
   language supports JSON.
JSON Documents
   {“json” : “key / value pairs”,
       “_id” : “some uuid”,
       “_rev” : “mvcc key”,
“string keys” : [1,2,3,”four”,null],
 “schema free” : “flexible”}
      Adapt data as your
      application changes.
HTTP / CRUD
You already know the API.

  GET             read

  PUT        create or update

 DELETE           delete

  POST        bulk operation
ACID Storage Engine
• Append Only
• Multi Version Concurrency Control
• B-Tree Indexes O(log n)
• Attachment Streaming

              Oooh, self-similar
Map Reduce Views
    Docs                                   Map
{ “user” : “Chris”,                                        { “key” : “Alice”, “value” : 5 }
    “points” : 3 }     function(doc) {                      { “key” : “Bob”, “value” : 7 }
  { “user” : “Joe”,       if (doc.user && doc.points) {    { “key” : “Chris”, “value” : 3 }
                             emit(doc.user, doc.points);
   “points” : 10 }                                          { “key” : “Joe”, “value” : 10 }
                          }
{ “user” : “Alice”,                                        { “key” : “Mary”, “value” : 9 }
                       }
    “points” : 5 }
{ “user” : “Mary”,
                                        Reduce
    “points” : 9 }
 { “user” : “Bob”,
    “points” : 7 }    function(keys, values, rereduce) {
                                                                 Alice ... Chris: 15
                        return sum(values);
                                                                   Everyone: 34
                      }
Peer-Based Replication
     for Freedom

         Triggered
        Incremental
          Filtered*
Let’s Replicate
       Everything!
• Take full advantage of CouchDB
• View-source             Open Source
• The Future is Distributed
But that’s not RESTful!
           Representational State Transfer...
              it’s more than just verbs,
                   it’s the hyperlinks.
                     Webpage
 Webpage                                 Webpage

                               Webpage

                           ∴
                   We need HTML.
Render JSON Docs as HTML
shows/post.js        /drl/_show/sofa/post/Hello-World-For-Real-This-Time
Render Views as HTML
lists/index.js   /drl/_list/sofa/index/recent-posts?descending=true&limit=8
Hands On with CouchApp
 • CouchApp is just some filesystem helpers
 • Embodies “best practices”
 • CouchApp is not opinionated, CouchDB is.
 • Don’t shoot the messenger.
Install CouchApp
   sudo easy_install couchapp

                     or
git clone git://github.com/jchris/couchapp.git
Check Your CouchDB
   http://127.0.0.1:5984/_utils/
Setup Credentials
                    Leaky Abstraction!
              edit:
/usr/local/etc/couchdb/local.ini

              add:
            [admins]
   username = secretpassword
Get the Example App
            (ajax version)
              couchapp clone
http://jchrisa.net/sofa-ajax/_design/sofa

                 cd sofa

              couchapp push
http://user:pass@localhost:5984/sofa-ajax
The Guts
First Post!
Firebug to see requests
Upgrade to real HTML
           couchapp clone
http://jchrisa.net/drl/_design/sofa

              cd sofa

            couchapp push
http://user:pass@localhost:5984/sofa
How’s it Work?

      Macros so functions
     can be in multiple files.
Templating
The Future
• Key-Centric Identity?
 • P2P Topologies don’t leave room to trust
    the server.
• Multi-Node clusters
 • High performance, large databases
Resources
• #couchdb and #couchapp on
  irc.freenode.net
• http://couchdb.apache.org for mailing lists
• http://planet.couchdb.org/
• http://books.couchdb.org/relax/
• Twitter search for “couchdb”
Thank You!

Más contenido relacionado

La actualidad más candente

XForms and eXist: A Perfect Couple
XForms and eXist: A Perfect CoupleXForms and eXist: A Perfect Couple
XForms and eXist: A Perfect Coupleebruchez
 
Presentation of JSConf.eu
Presentation of JSConf.euPresentation of JSConf.eu
Presentation of JSConf.euFredrik Wendt
 
Usecase examples of Packer
Usecase examples of Packer Usecase examples of Packer
Usecase examples of Packer Hiroshi SHIBATA
 
MongoDB's New Aggregation framework
MongoDB's New Aggregation frameworkMongoDB's New Aggregation framework
MongoDB's New Aggregation frameworkChris Westin
 
Introduction to asynchronous DB access using Node.js and MongoDB
Introduction to asynchronous DB access using Node.js and MongoDBIntroduction to asynchronous DB access using Node.js and MongoDB
Introduction to asynchronous DB access using Node.js and MongoDBAdrien Joly
 
React PHP: the NodeJS challenger
React PHP: the NodeJS challengerReact PHP: the NodeJS challenger
React PHP: the NodeJS challengervanphp
 
Devsumi2012 攻めの運用の極意
Devsumi2012 攻めの運用の極意Devsumi2012 攻めの運用の極意
Devsumi2012 攻めの運用の極意Ryosuke IWANAGA
 
Ansible 101, Gennadiy Mykhailiuta
Ansible 101, Gennadiy MykhailiutaAnsible 101, Gennadiy Mykhailiuta
Ansible 101, Gennadiy MykhailiutaTetiana Saputo
 
DSLs Internas e Ruby
DSLs Internas e RubyDSLs Internas e Ruby
DSLs Internas e RubyFabio Kung
 
Drupal cambs ansible for drupal april 2015
Drupal cambs ansible for drupal april 2015Drupal cambs ansible for drupal april 2015
Drupal cambs ansible for drupal april 2015Ryan Brown
 

La actualidad más candente (20)

EC2
EC2EC2
EC2
 
What is nodejs
What is nodejsWhat is nodejs
What is nodejs
 
XForms and eXist: A Perfect Couple
XForms and eXist: A Perfect CoupleXForms and eXist: A Perfect Couple
XForms and eXist: A Perfect Couple
 
Presentation of JSConf.eu
Presentation of JSConf.euPresentation of JSConf.eu
Presentation of JSConf.eu
 
Babushka
BabushkaBabushka
Babushka
 
Usecase examples of Packer
Usecase examples of Packer Usecase examples of Packer
Usecase examples of Packer
 
Puppet Camp 2012
Puppet Camp 2012Puppet Camp 2012
Puppet Camp 2012
 
Configuration Management in Ansible
Configuration Management in Ansible Configuration Management in Ansible
Configuration Management in Ansible
 
Practical ngx_mruby
Practical ngx_mrubyPractical ngx_mruby
Practical ngx_mruby
 
Triple Blitz Strike
Triple Blitz StrikeTriple Blitz Strike
Triple Blitz Strike
 
MongoDB's New Aggregation framework
MongoDB's New Aggregation frameworkMongoDB's New Aggregation framework
MongoDB's New Aggregation framework
 
Introduction to asynchronous DB access using Node.js and MongoDB
Introduction to asynchronous DB access using Node.js and MongoDBIntroduction to asynchronous DB access using Node.js and MongoDB
Introduction to asynchronous DB access using Node.js and MongoDB
 
React PHP: the NodeJS challenger
React PHP: the NodeJS challengerReact PHP: the NodeJS challenger
React PHP: the NodeJS challenger
 
Devsumi2012 攻めの運用の極意
Devsumi2012 攻めの運用の極意Devsumi2012 攻めの運用の極意
Devsumi2012 攻めの運用の極意
 
Ansible 101, Gennadiy Mykhailiuta
Ansible 101, Gennadiy MykhailiutaAnsible 101, Gennadiy Mykhailiuta
Ansible 101, Gennadiy Mykhailiuta
 
DSLs Internas e Ruby
DSLs Internas e RubyDSLs Internas e Ruby
DSLs Internas e Ruby
 
About Data::ObjectDriver
About Data::ObjectDriverAbout Data::ObjectDriver
About Data::ObjectDriver
 
Very Xd Hw9
Very Xd Hw9Very Xd Hw9
Very Xd Hw9
 
Express js
Express jsExpress js
Express js
 
Drupal cambs ansible for drupal april 2015
Drupal cambs ansible for drupal april 2015Drupal cambs ansible for drupal april 2015
Drupal cambs ansible for drupal april 2015
 

Destacado

Inter-Regional Cooperation, FARA/AARINENA
Inter-Regional Cooperation, FARA/AARINENAInter-Regional Cooperation, FARA/AARINENA
Inter-Regional Cooperation, FARA/AARINENAAARINENA
 
Feria abril PEÑA CAMPERA ´10
Feria abril PEÑA CAMPERA ´10Feria abril PEÑA CAMPERA ´10
Feria abril PEÑA CAMPERA ´10leticiaanton
 
Fiesta Infantil 09
Fiesta Infantil 09Fiesta Infantil 09
Fiesta Infantil 09leticiaanton
 
Council 142 inf-3 ciard
Council 142 inf-3 ciardCouncil 142 inf-3 ciard
Council 142 inf-3 ciardAARINENA
 

Destacado (8)

Inter-Regional Cooperation, FARA/AARINENA
Inter-Regional Cooperation, FARA/AARINENAInter-Regional Cooperation, FARA/AARINENA
Inter-Regional Cooperation, FARA/AARINENA
 
Toledo2010
Toledo2010Toledo2010
Toledo2010
 
Feria abril PEÑA CAMPERA ´10
Feria abril PEÑA CAMPERA ´10Feria abril PEÑA CAMPERA ´10
Feria abril PEÑA CAMPERA ´10
 
Fiesta Infantil 09
Fiesta Infantil 09Fiesta Infantil 09
Fiesta Infantil 09
 
CouchDB To The Edge
CouchDB To The EdgeCouchDB To The Edge
CouchDB To The Edge
 
Viaje a Riaza 10
Viaje a Riaza 10Viaje a Riaza 10
Viaje a Riaza 10
 
Council 142 inf-3 ciard
Council 142 inf-3 ciardCouncil 142 inf-3 ciard
Council 142 inf-3 ciard
 
Btree Nosql Oak
Btree Nosql OakBtree Nosql Oak
Btree Nosql Oak
 

Similar a Introduction to CouchDB and CouchApps

CouchDB at JAOO Århus 2009
CouchDB at JAOO Århus 2009CouchDB at JAOO Århus 2009
CouchDB at JAOO Århus 2009Jason Davies
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Railsdosire
 
jQuery Presentation to Rails Developers
jQuery Presentation to Rails DevelopersjQuery Presentation to Rails Developers
jQuery Presentation to Rails DevelopersYehuda Katz
 
mongodb-introduction
mongodb-introductionmongodb-introduction
mongodb-introductionTse-Ching Ho
 
DPC2007 PHP And Oracle (Kuassi Mensah)
DPC2007 PHP And Oracle (Kuassi Mensah)DPC2007 PHP And Oracle (Kuassi Mensah)
DPC2007 PHP And Oracle (Kuassi Mensah)dpc
 
Web Development: The Next Five Years
Web Development: The Next Five YearsWeb Development: The Next Five Years
Web Development: The Next Five Yearssneeu
 
OSML and OpenSocial 0.9
OSML and OpenSocial 0.9OSML and OpenSocial 0.9
OSML and OpenSocial 0.9MySpaceDevTeam
 
CouchDB Open Source Bridge
CouchDB Open Source BridgeCouchDB Open Source Bridge
CouchDB Open Source BridgeChris Anderson
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Coursepeter_marklund
 
Facebook的缓存系统
Facebook的缓存系统Facebook的缓存系统
Facebook的缓存系统yiditushe
 
Building production websites with Node.js on the Microsoft stack
Building production websites with Node.js on the Microsoft stackBuilding production websites with Node.js on the Microsoft stack
Building production websites with Node.js on the Microsoft stackCellarTracker
 
PECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterPECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterZendCon
 
Intravert Server side processing for Cassandra
Intravert Server side processing for CassandraIntravert Server side processing for Cassandra
Intravert Server side processing for CassandraEdward Capriolo
 
NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"
NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"
NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"DataStax Academy
 
RubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - KeynoteRubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - KeynoteDr Nic Williams
 

Similar a Introduction to CouchDB and CouchApps (20)

CouchDB at JAOO Århus 2009
CouchDB at JAOO Århus 2009CouchDB at JAOO Århus 2009
CouchDB at JAOO Århus 2009
 
Couchdb Nosql
Couchdb NosqlCouchdb Nosql
Couchdb Nosql
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Rails
 
jQuery Presentation to Rails Developers
jQuery Presentation to Rails DevelopersjQuery Presentation to Rails Developers
jQuery Presentation to Rails Developers
 
mongodb-introduction
mongodb-introductionmongodb-introduction
mongodb-introduction
 
DPC2007 PHP And Oracle (Kuassi Mensah)
DPC2007 PHP And Oracle (Kuassi Mensah)DPC2007 PHP And Oracle (Kuassi Mensah)
DPC2007 PHP And Oracle (Kuassi Mensah)
 
Web Development: The Next Five Years
Web Development: The Next Five YearsWeb Development: The Next Five Years
Web Development: The Next Five Years
 
OSML and OpenSocial 0.9
OSML and OpenSocial 0.9OSML and OpenSocial 0.9
OSML and OpenSocial 0.9
 
CouchDB Open Source Bridge
CouchDB Open Source BridgeCouchDB Open Source Bridge
CouchDB Open Source Bridge
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
 
Ruby on Rails Presentation
Ruby on Rails PresentationRuby on Rails Presentation
Ruby on Rails Presentation
 
Os Wilhelm
Os WilhelmOs Wilhelm
Os Wilhelm
 
Facebook的缓存系统
Facebook的缓存系统Facebook的缓存系统
Facebook的缓存系统
 
MySQL Proxy tutorial
MySQL Proxy tutorialMySQL Proxy tutorial
MySQL Proxy tutorial
 
Building production websites with Node.js on the Microsoft stack
Building production websites with Node.js on the Microsoft stackBuilding production websites with Node.js on the Microsoft stack
Building production websites with Node.js on the Microsoft stack
 
PECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterPECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life better
 
Intravert Server side processing for Cassandra
Intravert Server side processing for CassandraIntravert Server side processing for Cassandra
Intravert Server side processing for Cassandra
 
NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"
NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"
NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"
 
RubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - KeynoteRubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - Keynote
 
Sprockets
SprocketsSprockets
Sprockets
 

Último

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
 
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
 
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...Martijn de Jong
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
🐬 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
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
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
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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
 
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
 

Último (20)

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
 
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
 
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...
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
🐬 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...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
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
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
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
 

Introduction to CouchDB and CouchApps

  • 1.
  • 2. Who Am I? • Chris Anderson <jchris@apache.org> • CouchDB committer • Blog: http://jchrisa.net
  • 3. Couch History • Damien Katz <http://damienkatz.net/> • Worked on Lotus Notes & MySQL • Started CouchDB in 2005 • 2006: Moved to Erlang, JSON and JavaScript • Approaching 0.9 Release
  • 4. 2008 Erlang User of the Year
  • 5. This Talk • Hello CouchDB • Hands on with CouchApp • The Future • Get Involved
  • 6. Hello CouchDB • JSON Documents • HTTP / REST (You already know the API) • ACID Storage Engine • Map Reduce Views • Replication for Freedom • Portable Standalone Applications
  • 7. JSON Documents {“json” : “key / value pairs”, “_id” : “some uuid”, “_rev” : “mvcc key”, “string keys” : [1,2,3,”four”,null], “schema free” : true} Your programming language supports JSON.
  • 8. JSON Documents {“json” : “key / value pairs”, “_id” : “some uuid”, “_rev” : “mvcc key”, “string keys” : [1,2,3,”four”,null], “schema free” : “flexible”} Adapt data as your application changes.
  • 9. HTTP / CRUD You already know the API. GET read PUT create or update DELETE delete POST bulk operation
  • 10. ACID Storage Engine • Append Only • Multi Version Concurrency Control • B-Tree Indexes O(log n) • Attachment Streaming Oooh, self-similar
  • 11. Map Reduce Views Docs Map { “user” : “Chris”, { “key” : “Alice”, “value” : 5 } “points” : 3 } function(doc) { { “key” : “Bob”, “value” : 7 } { “user” : “Joe”, if (doc.user && doc.points) { { “key” : “Chris”, “value” : 3 } emit(doc.user, doc.points); “points” : 10 } { “key” : “Joe”, “value” : 10 } } { “user” : “Alice”, { “key” : “Mary”, “value” : 9 } } “points” : 5 } { “user” : “Mary”, Reduce “points” : 9 } { “user” : “Bob”, “points” : 7 } function(keys, values, rereduce) { Alice ... Chris: 15 return sum(values); Everyone: 34 }
  • 12. Peer-Based Replication for Freedom Triggered Incremental Filtered*
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21. Let’s Replicate Everything! • Take full advantage of CouchDB • View-source Open Source • The Future is Distributed
  • 22. But that’s not RESTful! Representational State Transfer... it’s more than just verbs, it’s the hyperlinks. Webpage Webpage Webpage Webpage ∴ We need HTML.
  • 23. Render JSON Docs as HTML shows/post.js /drl/_show/sofa/post/Hello-World-For-Real-This-Time
  • 24. Render Views as HTML lists/index.js /drl/_list/sofa/index/recent-posts?descending=true&limit=8
  • 25. Hands On with CouchApp • CouchApp is just some filesystem helpers • Embodies “best practices” • CouchApp is not opinionated, CouchDB is. • Don’t shoot the messenger.
  • 26. Install CouchApp sudo easy_install couchapp or git clone git://github.com/jchris/couchapp.git
  • 27. Check Your CouchDB http://127.0.0.1:5984/_utils/
  • 28. Setup Credentials Leaky Abstraction! edit: /usr/local/etc/couchdb/local.ini add: [admins] username = secretpassword
  • 29. Get the Example App (ajax version) couchapp clone http://jchrisa.net/sofa-ajax/_design/sofa cd sofa couchapp push http://user:pass@localhost:5984/sofa-ajax
  • 32. Firebug to see requests
  • 33. Upgrade to real HTML couchapp clone http://jchrisa.net/drl/_design/sofa cd sofa couchapp push http://user:pass@localhost:5984/sofa
  • 34. How’s it Work? Macros so functions can be in multiple files.
  • 36. The Future • Key-Centric Identity? • P2P Topologies don’t leave room to trust the server. • Multi-Node clusters • High performance, large databases
  • 37. Resources • #couchdb and #couchapp on irc.freenode.net • http://couchdb.apache.org for mailing lists • http://planet.couchdb.org/ • http://books.couchdb.org/relax/ • Twitter search for “couchdb”