SlideShare una empresa de Scribd logo
1 de 33
Descargar para leer sin conexión
Next Generation Data
Storage with CouchDb
    Jan Lehnardt <jan@php.net>




                                 1
About Me
• Freelancing Developer with strong focus on
  the Web for ~6 Years
• Studies in Computer Science and
  Linguistics (not yet finished :-)
• Co-founder of FREISATZ
• Love Rock music and kittens

                                               2
About You?

•What do you work on?
• What are you interested in?
• Why are you here?


                                3
Target Audience
•   (Let’s see how well this matches the responses to the last slide)




• Webdevelopers, interested in new
    technology
• System Architects that look for scalable and
    fault tolerant software solutions
• Anybody else is welcome, too
                                                                        4
Forget SQL

• Just for a moment, imagine you know
  nothing about relational data, normalization
  and other fancy terminology


• You only want to store data

                                                 5
The Four Pillars of Data
     Management




                           6
Four Pillars (1): Save

•   Save data securely,
    permanent etc...
 •   i.e. ACID compliant
• Save data efficient

                             7
Four Pillars (II): See

• Make data available for easy
  retrieval
• Integrate simple reporting
  methods
• Provide (fulltext) search
                                 8
Four Pillars (III): Secure

• Enable strong
 compartmentalization of data
• Assign users, groups and roles
 to data
• Allow connections over SSL
                                   9
Four Pillars (IV): Share

• To make it complete:
 • Do all that in a distributed
     way
 •   On- and Offline(!)


                                  10
No Relations
• Enter CouchDb
 • New implementation, no legacy
 • Designed to…
   • …implement the four Pillars
   • …leverage recent paradigm shifts
                                        11
CouchDb for Database
      Experts

 Now, remember SQL and all you
 know about traditional database
 systems



                                   12
Databases


Pool for related data




                        13
Documents
• Records of data
• Individual storage elements
 • Can have an arbitrary (JSON)
    structure…
 • …but don’t have to!
 • Attachments
• Have IDs & revisions
                                  14
Views

• Similar to Views
 • Compiled, pre-defined subset of stored
    data
• External JavaScript Daemon(s)

                                           15
CouchDb Features
Roubust Data Storage        Repliaction

      REST API         User Authentication

   JavaScript Views    Built on Erlang/OTP
                       Your Feature Here, it’s
   Fulltext Search        Open Source!

                                                 16
Documents

• Individual storage elements
 • Can have an arbitrary (JSON)
    structure…
 • …but don’t have to!
 • Attachments
• Have IDs & revisions
                                  17
Example Document
{
    _id:”098F6BCD4621D373CADE4E832627B4F6”,
    _rev: 4134847,
    “BugId”: “098F6BCD4621D373CADE4E832627B4F6”,
    “Counter”:1,
    “Name”:”test”,
    “Type”:”Project”
}




                                                   18
Data Storage

• State-of-the-art storage model
 • MVCC with optimistic locking
   • Sacles magnitudes better than
      pessimistic locking
• Append-only writes

                                     19
REST API

• Easy retrieval using a method proven to be
  scalable: HTTP
• Exchange in industry-standard formats
  (JSON)
• Simple and intuitive interface

                                               20
Example URIs

• http://server/company/_all_docs
• http://server/company/765432
• http://server/company/_design/people
• http://server/company/_design/people?
  count=7&startkey=”L”&endkey=”M”



                                          21
JavaScript Views

• JS Functions to perform pattern matching
  on documents
• Map-Reduce to define document subsets
• (Actual language changeable)


                                             22
Example View
function(doc) {
    map(doc.time, {
     'teaser':doc.text.substr(0,10),
     '_id':doc.id
     });
}


                                       23
Example View
function(doc) {
  if(“Article” == doc.type) {
       map(doc.time, {
        'teaser':doc.text.substr(0,10),
        '_id':doc.id
        });
  }}
                                          24
Fulltext Search

• Leverages Lucene
 • Reference implementation included
• Simple API to plug in other search
  technology




                                       25
Security and
       Authentication
• Not yet implemented
• Will have
 • Standard user authentication for
    applications
 • Document ownership

                                      26
Replication
• Bi-directional replication (or
  synchronization) between any number of
  instances.
  • Online, and:
  • Offline(!)
   • Including consistent conflict resolution
      for disconnected systems. Wow!


                                               27
Erlang Core

• Awkward syntax, but hey :-)
• Multi-everything
• Lightweight threading
• Awesome performance
• Die-on-error design

                                28
Demo



       29
Cool things to do with CouchDb

• Distributed Anything-Application
• The Wiki
• Version Control System
• FUSE plugin
• MySQL Storage Engine
                                     30
About Damien

• Damien Katz
• Ex-Iris/Lotus/IBM
• Helped creating the Lotus Notes
  Database / Domino




                                    31
Links

• http://couchdb.com/
• http://couchdbwiki.com/
• http://damienkatz.net/
• http://jan.prima.de/
• The Book

                            32
Cheers!


You’ve been great!


                     33

Más contenido relacionado

La actualidad más candente

Marian Marinov Clusters With Glusterfs
Marian Marinov Clusters With GlusterfsMarian Marinov Clusters With Glusterfs
Marian Marinov Clusters With Glusterfs
Ontico
 

La actualidad más candente (20)

Get expertise with mongo db
Get expertise with mongo dbGet expertise with mongo db
Get expertise with mongo db
 
MongoDB NoSQL - Developer Guide
MongoDB NoSQL - Developer GuideMongoDB NoSQL - Developer Guide
MongoDB NoSQL - Developer Guide
 
Mongo db
Mongo dbMongo db
Mongo db
 
MongoDB basics & Introduction
MongoDB basics & IntroductionMongoDB basics & Introduction
MongoDB basics & Introduction
 
Steam Learn: An introduction to Redis
Steam Learn: An introduction to RedisSteam Learn: An introduction to Redis
Steam Learn: An introduction to Redis
 
RESTful services on IBM Domino/XWork (ICON UK 21-22 Sept. 2015)
RESTful services on IBM Domino/XWork (ICON UK 21-22 Sept. 2015)RESTful services on IBM Domino/XWork (ICON UK 21-22 Sept. 2015)
RESTful services on IBM Domino/XWork (ICON UK 21-22 Sept. 2015)
 
RocksDB storage engine for MySQL and MongoDB
RocksDB storage engine for MySQL and MongoDBRocksDB storage engine for MySQL and MongoDB
RocksDB storage engine for MySQL and MongoDB
 
Scaling and hardware provisioning for databases (lessons learned at wikipedia)
Scaling and hardware provisioning for databases (lessons learned at wikipedia)Scaling and hardware provisioning for databases (lessons learned at wikipedia)
Scaling and hardware provisioning for databases (lessons learned at wikipedia)
 
Redis IU
Redis IURedis IU
Redis IU
 
A powerful web application server (intravision IBM Connect 2013 Update) Febru...
A powerful web application server (intravision IBM Connect 2013 Update) Febru...A powerful web application server (intravision IBM Connect 2013 Update) Febru...
A powerful web application server (intravision IBM Connect 2013 Update) Febru...
 
Mongo db
Mongo dbMongo db
Mongo db
 
The Hive Think Tank: Rocking the Database World with RocksDB
The Hive Think Tank:  Rocking the Database World with RocksDBThe Hive Think Tank:  Rocking the Database World with RocksDB
The Hive Think Tank: Rocking the Database World with RocksDB
 
Using NoSQL MongoDB with ColdFusion
Using NoSQL MongoDB with ColdFusionUsing NoSQL MongoDB with ColdFusion
Using NoSQL MongoDB with ColdFusion
 
Comparison with storing data using NoSQL(CouchDB) and a relational database.
Comparison with storing data using NoSQL(CouchDB) and a relational database.Comparison with storing data using NoSQL(CouchDB) and a relational database.
Comparison with storing data using NoSQL(CouchDB) and a relational database.
 
The Hive Think Tank: Rocking the Database World with RocksDB
The Hive Think Tank: Rocking the Database World with RocksDBThe Hive Think Tank: Rocking the Database World with RocksDB
The Hive Think Tank: Rocking the Database World with RocksDB
 
Marian Marinov Clusters With Glusterfs
Marian Marinov Clusters With GlusterfsMarian Marinov Clusters With Glusterfs
Marian Marinov Clusters With Glusterfs
 
Introduction to mongo db
Introduction to mongo dbIntroduction to mongo db
Introduction to mongo db
 
Mongo performance tuning: tips and tricks
Mongo performance tuning: tips and tricksMongo performance tuning: tips and tricks
Mongo performance tuning: tips and tricks
 
Making MySQL Agile-ish
Making MySQL Agile-ishMaking MySQL Agile-ish
Making MySQL Agile-ish
 
Grails and Neo4j
Grails and Neo4jGrails and Neo4j
Grails and Neo4j
 

Destacado

When Superheros Dont Have A Job
When Superheros Dont Have A JobWhen Superheros Dont Have A Job
When Superheros Dont Have A Job
air
 
Worth Spending Few Minutes... Heart Attack!
Worth Spending Few Minutes... Heart Attack!Worth Spending Few Minutes... Heart Attack!
Worth Spending Few Minutes... Heart Attack!
air
 
Deportes Extremos-Victor Arenal y Sergio Calvo
Deportes Extremos-Victor Arenal y Sergio CalvoDeportes Extremos-Victor Arenal y Sergio Calvo
Deportes Extremos-Victor Arenal y Sergio Calvo
guest75a280
 
www.schreibman.de
www.schreibman.dewww.schreibman.de
www.schreibman.de
guest186fb1
 
Trancend|Orb - Building brands transcending business- Intro deck
Trancend|Orb - Building brands transcending business- Intro deck Trancend|Orb - Building brands transcending business- Intro deck
Trancend|Orb - Building brands transcending business- Intro deck
Prathish Nair
 

Destacado (20)

FAZe
FAZeFAZe
FAZe
 
When Superheros Dont Have A Job
When Superheros Dont Have A JobWhen Superheros Dont Have A Job
When Superheros Dont Have A Job
 
Diario Aperto: una ricerca sociale attraverso i modi di raccontare e ascoltar...
Diario Aperto: una ricerca sociale attraverso i modi di raccontare e ascoltar...Diario Aperto: una ricerca sociale attraverso i modi di raccontare e ascoltar...
Diario Aperto: una ricerca sociale attraverso i modi di raccontare e ascoltar...
 
Worth Spending Few Minutes... Heart Attack!
Worth Spending Few Minutes... Heart Attack!Worth Spending Few Minutes... Heart Attack!
Worth Spending Few Minutes... Heart Attack!
 
Spinnen in de straat
Spinnen in de straatSpinnen in de straat
Spinnen in de straat
 
Deportes Extremos-Victor Arenal y Sergio Calvo
Deportes Extremos-Victor Arenal y Sergio CalvoDeportes Extremos-Victor Arenal y Sergio Calvo
Deportes Extremos-Victor Arenal y Sergio Calvo
 
Vacations
VacationsVacations
Vacations
 
Thesis Carohorn
Thesis CarohornThesis Carohorn
Thesis Carohorn
 
Designing Web2
Designing Web2Designing Web2
Designing Web2
 
Learntolive
LearntoliveLearntolive
Learntolive
 
Juggling
JugglingJuggling
Juggling
 
Tablets e Ingles
Tablets e  InglesTablets e  Ingles
Tablets e Ingles
 
Metaprogramming in Ruby
Metaprogramming in RubyMetaprogramming in Ruby
Metaprogramming in Ruby
 
Alaska Railway Routes
Alaska Railway RoutesAlaska Railway Routes
Alaska Railway Routes
 
Evolving From Scrum To Lean
Evolving From Scrum To LeanEvolving From Scrum To Lean
Evolving From Scrum To Lean
 
B D D Intro
B D D  IntroB D D  Intro
B D D Intro
 
www.schreibman.de
www.schreibman.dewww.schreibman.de
www.schreibman.de
 
GOF patterns in Ruby
GOF patterns in RubyGOF patterns in Ruby
GOF patterns in Ruby
 
Trancend|Orb - Building brands transcending business- Intro deck
Trancend|Orb - Building brands transcending business- Intro deck Trancend|Orb - Building brands transcending business- Intro deck
Trancend|Orb - Building brands transcending business- Intro deck
 
Anti Patterns2008
Anti Patterns2008Anti Patterns2008
Anti Patterns2008
 

Similar a Couch Db

Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorial
oscon2007
 
VTi Knowledge Database: a LinkedData project
VTi Knowledge Database: a LinkedData projectVTi Knowledge Database: a LinkedData project
VTi Knowledge Database: a LinkedData project
Tom Klaasen
 
From One to a Cluster
From One to a ClusterFrom One to a Cluster
From One to a Cluster
guestd34230
 
Rails Conf Europe 2007 Notes
Rails Conf  Europe 2007  NotesRails Conf  Europe 2007  Notes
Rails Conf Europe 2007 Notes
Ross Lawley
 

Similar a Couch Db (20)

Brainwave A Basic Overview Bar Camp
Brainwave A Basic Overview Bar CampBrainwave A Basic Overview Bar Camp
Brainwave A Basic Overview Bar Camp
 
Advanced Deployment
Advanced DeploymentAdvanced Deployment
Advanced Deployment
 
Between Cocoa and Cocoa Touch: A Comparative Introduction
Between Cocoa and Cocoa Touch: A Comparative IntroductionBetween Cocoa and Cocoa Touch: A Comparative Introduction
Between Cocoa and Cocoa Touch: A Comparative Introduction
 
Some news about the SW
Some news about the SWSome news about the SW
Some news about the SW
 
Instant J Chem: one-stop information hub for medicinal chemists: US UGM 2008
Instant J Chem: one-stop information hub for medicinal chemists: US UGM 2008Instant J Chem: one-stop information hub for medicinal chemists: US UGM 2008
Instant J Chem: one-stop information hub for medicinal chemists: US UGM 2008
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorial
 
ArangoDB
ArangoDBArangoDB
ArangoDB
 
Java EE and NoSQL using JBoss EAP 7 and OpenShift
Java EE and NoSQL using JBoss EAP 7 and OpenShiftJava EE and NoSQL using JBoss EAP 7 and OpenShift
Java EE and NoSQL using JBoss EAP 7 and OpenShift
 
VTi Knowledge Database: a LinkedData project
VTi Knowledge Database: a LinkedData projectVTi Knowledge Database: a LinkedData project
VTi Knowledge Database: a LinkedData project
 
From One to a Cluster
From One to a ClusterFrom One to a Cluster
From One to a Cluster
 
Extending The My Sql Data Landscape
Extending The My Sql Data LandscapeExtending The My Sql Data Landscape
Extending The My Sql Data Landscape
 
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
 
SSJS, NoSQL, GAE and AppengineJS
SSJS, NoSQL, GAE and AppengineJSSSJS, NoSQL, GAE and AppengineJS
SSJS, NoSQL, GAE and AppengineJS
 
Application Architecture Trends
Application Architecture TrendsApplication Architecture Trends
Application Architecture Trends
 
NOSQL Overview
NOSQL OverviewNOSQL Overview
NOSQL Overview
 
Open Social Summit Korea Overview
Open Social Summit Korea OverviewOpen Social Summit Korea Overview
Open Social Summit Korea Overview
 
Modern Webdevelopment With Ruby On Rails
Modern Webdevelopment With Ruby On RailsModern Webdevelopment With Ruby On Rails
Modern Webdevelopment With Ruby On Rails
 
Brandon
BrandonBrandon
Brandon
 
LuSql: (Quickly and easily) Getting your data from your DBMS into Lucene
LuSql: (Quickly and easily) Getting your data from your DBMS into LuceneLuSql: (Quickly and easily) Getting your data from your DBMS into Lucene
LuSql: (Quickly and easily) Getting your data from your DBMS into Lucene
 
Rails Conf Europe 2007 Notes
Rails Conf  Europe 2007  NotesRails Conf  Europe 2007  Notes
Rails Conf Europe 2007 Notes
 

Más de Ross Lawley

Thinking Functionally In Ruby
Thinking Functionally In RubyThinking Functionally In Ruby
Thinking Functionally In Ruby
Ross Lawley
 
Kanban For Software Engineering Apr 242
Kanban For Software Engineering Apr 242Kanban For Software Engineering Apr 242
Kanban For Software Engineering Apr 242
Ross Lawley
 
How To Fail With Agile
How To Fail With AgileHow To Fail With Agile
How To Fail With Agile
Ross Lawley
 
User Experience Pain Free
User Experience Pain FreeUser Experience Pain Free
User Experience Pain Free
Ross Lawley
 
Learning To Love Forms Webvisions 07 21033
Learning To Love Forms Webvisions 07 21033Learning To Love Forms Webvisions 07 21033
Learning To Love Forms Webvisions 07 21033
Ross Lawley
 
Wiki Design Luke W
Wiki Design  Luke WWiki Design  Luke W
Wiki Design Luke W
Ross Lawley
 
When Interface Design Attacks
When Interface Design AttacksWhen Interface Design Attacks
When Interface Design Attacks
Ross Lawley
 

Más de Ross Lawley (10)

Thinking Functionally In Ruby
Thinking Functionally In RubyThinking Functionally In Ruby
Thinking Functionally In Ruby
 
Kanban For Software Engineering Apr 242
Kanban For Software Engineering Apr 242Kanban For Software Engineering Apr 242
Kanban For Software Engineering Apr 242
 
Kanban Vs Scrum
Kanban Vs ScrumKanban Vs Scrum
Kanban Vs Scrum
 
How To Fail With Agile
How To Fail With AgileHow To Fail With Agile
How To Fail With Agile
 
Designing For Web2
Designing For Web2 Designing For Web2
Designing For Web2
 
User Experience Pain Free
User Experience Pain FreeUser Experience Pain Free
User Experience Pain Free
 
L R U G - JRuby
L R U G - JRubyL R U G - JRuby
L R U G - JRuby
 
Learning To Love Forms Webvisions 07 21033
Learning To Love Forms Webvisions 07 21033Learning To Love Forms Webvisions 07 21033
Learning To Love Forms Webvisions 07 21033
 
Wiki Design Luke W
Wiki Design  Luke WWiki Design  Luke W
Wiki Design Luke W
 
When Interface Design Attacks
When Interface Design AttacksWhen Interface Design Attacks
When Interface Design Attacks
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
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...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

Couch Db

  • 1. Next Generation Data Storage with CouchDb Jan Lehnardt <jan@php.net> 1
  • 2. About Me • Freelancing Developer with strong focus on the Web for ~6 Years • Studies in Computer Science and Linguistics (not yet finished :-) • Co-founder of FREISATZ • Love Rock music and kittens 2
  • 3. About You? •What do you work on? • What are you interested in? • Why are you here? 3
  • 4. Target Audience • (Let’s see how well this matches the responses to the last slide) • Webdevelopers, interested in new technology • System Architects that look for scalable and fault tolerant software solutions • Anybody else is welcome, too 4
  • 5. Forget SQL • Just for a moment, imagine you know nothing about relational data, normalization and other fancy terminology • You only want to store data 5
  • 6. The Four Pillars of Data Management 6
  • 7. Four Pillars (1): Save • Save data securely, permanent etc... • i.e. ACID compliant • Save data efficient 7
  • 8. Four Pillars (II): See • Make data available for easy retrieval • Integrate simple reporting methods • Provide (fulltext) search 8
  • 9. Four Pillars (III): Secure • Enable strong compartmentalization of data • Assign users, groups and roles to data • Allow connections over SSL 9
  • 10. Four Pillars (IV): Share • To make it complete: • Do all that in a distributed way • On- and Offline(!) 10
  • 11. No Relations • Enter CouchDb • New implementation, no legacy • Designed to… • …implement the four Pillars • …leverage recent paradigm shifts 11
  • 12. CouchDb for Database Experts Now, remember SQL and all you know about traditional database systems 12
  • 14. Documents • Records of data • Individual storage elements • Can have an arbitrary (JSON) structure… • …but don’t have to! • Attachments • Have IDs & revisions 14
  • 15. Views • Similar to Views • Compiled, pre-defined subset of stored data • External JavaScript Daemon(s) 15
  • 16. CouchDb Features Roubust Data Storage Repliaction REST API User Authentication JavaScript Views Built on Erlang/OTP Your Feature Here, it’s Fulltext Search Open Source! 16
  • 17. Documents • Individual storage elements • Can have an arbitrary (JSON) structure… • …but don’t have to! • Attachments • Have IDs & revisions 17
  • 18. Example Document { _id:”098F6BCD4621D373CADE4E832627B4F6”, _rev: 4134847, “BugId”: “098F6BCD4621D373CADE4E832627B4F6”, “Counter”:1, “Name”:”test”, “Type”:”Project” } 18
  • 19. Data Storage • State-of-the-art storage model • MVCC with optimistic locking • Sacles magnitudes better than pessimistic locking • Append-only writes 19
  • 20. REST API • Easy retrieval using a method proven to be scalable: HTTP • Exchange in industry-standard formats (JSON) • Simple and intuitive interface 20
  • 21. Example URIs • http://server/company/_all_docs • http://server/company/765432 • http://server/company/_design/people • http://server/company/_design/people? count=7&startkey=”L”&endkey=”M” 21
  • 22. JavaScript Views • JS Functions to perform pattern matching on documents • Map-Reduce to define document subsets • (Actual language changeable) 22
  • 23. Example View function(doc) { map(doc.time, { 'teaser':doc.text.substr(0,10), '_id':doc.id }); } 23
  • 24. Example View function(doc) { if(“Article” == doc.type) { map(doc.time, { 'teaser':doc.text.substr(0,10), '_id':doc.id }); }} 24
  • 25. Fulltext Search • Leverages Lucene • Reference implementation included • Simple API to plug in other search technology 25
  • 26. Security and Authentication • Not yet implemented • Will have • Standard user authentication for applications • Document ownership 26
  • 27. Replication • Bi-directional replication (or synchronization) between any number of instances. • Online, and: • Offline(!) • Including consistent conflict resolution for disconnected systems. Wow! 27
  • 28. Erlang Core • Awkward syntax, but hey :-) • Multi-everything • Lightweight threading • Awesome performance • Die-on-error design 28
  • 29. Demo 29
  • 30. Cool things to do with CouchDb • Distributed Anything-Application • The Wiki • Version Control System • FUSE plugin • MySQL Storage Engine 30
  • 31. About Damien • Damien Katz • Ex-Iris/Lotus/IBM • Helped creating the Lotus Notes Database / Domino 31
  • 32. Links • http://couchdb.com/ • http://couchdbwiki.com/ • http://damienkatz.net/ • http://jan.prima.de/ • The Book 32