SlideShare a Scribd company logo
1 of 38
Download to read offline
NON-RELATIONAL
                               DATABASES




Saturday, October 31, 2009
@JPERRAS - JOEL PERRAS
                    Canadian Geek

                    Blog: http://nerderati.com

                    GitHub: http://github.com/jperras

                    CakePHP Core since Early 2009, PHP dev. since 2001

                    McGill University, Montréal, Canada - Physics,
                    Mathematics & Computer Science

                    Employer: Plank Design (http://plankdesign.com)
                    (Twitter: @plankdesign)

Saturday, October 31, 2009
RELATIONAL DATABASES

                    Many different vendors: MySQL, PostgreSQL,
                    SQLite, Oracle, ...

                    Same basic implementation:

                             B(+)-Trees for pages

                             B(+)-Trees or hash tables for secondary indexes

                             Possibly R-Trees for spatial indexes



Saturday, October 31, 2009
WHAT THEY’RE GOOD AT




Saturday, October 31, 2009
Schemas (relational models)

                    Familiar BCNF structure

                    Strong consistency

                    Transactions

                    Very “mature” & well tested (mostly)

                    Easy adoption/integration



Saturday, October 31, 2009
RDBMS’ES ARE NOT
                             GOING ANYWHERE


                    FriendFeed

                    Wikipedia

                    Google AdWords

                    Facebook




Saturday, October 31, 2009
Most small to medium size applications will
                   never need to go beyond a single database server.




Saturday, October 31, 2009
Always try and follow the Golden Web Application
                                  Development Rule:




Saturday, October 31, 2009
DON’T TRY TO SOLVE A
                     PROBLEM YOU DON’T
                           HAVE




Saturday, October 31, 2009
The web has created new problem domains in
                                data storage and querying.




Saturday, October 31, 2009
MODERN WEB APPS


                    Often use variable schemas

                             Optional fields: contact lists, addresses, favourite
                             movies/books, etc.

                             NULL-itis: null values should not be permitted in
                             BCNF, but are everywhere in web applications.




Saturday, October 31, 2009
MODERN WEB APPS


                    ‘Social’ apps => high write/read ratios

                    Complex Many-to-Many relationships

                             Joins become a problem in federated architectures

                    Eventual consistency is usually acceptable

                    Downtime unacceptable




Saturday, October 31, 2009
OTHER CONCERNS




Saturday, October 31, 2009
RULES OF APP AGING
                                     http://push.cx/2009/rules-of-database-app-aging




                             1. All fields become optional
                             2. All relationships become many-to-many
                             3. Chatter (comments explaining hacks)
                             grows with time.




Saturday, October 31, 2009
SOME GOOD PROBLEMS
                        TO HAVE
                             Even if they are “Hard” ones to solve.




Saturday, October 31, 2009
Load Balancing
                             (you can only live with one machine for so long)




Saturday, October 31, 2009
High Availability
                             (because disks fail, and replication fails)




Saturday, October 31, 2009
What’s a web application developer to do?




Saturday, October 31, 2009
Alternative Data Storage Solutions




Saturday, October 31, 2009
Not a silver bullet.

                            These can solve some problems,
                    but cause others and have their own limitations.

            It’s up to you to weigh the cost/benefit of your chosen
                                    solution.




Saturday, October 31, 2009
THE LANDSCAPE



                    Key/Value Stores/Distributed Hash Tables (DHT)

                    Document-oriented databases

                    Column-oriented databases




Saturday, October 31, 2009
KEY/VALUE STORES


                    Voldemort

                    Scalaris

                    Tokyo Cabinet

                    Redis

                    MemcacheDB




Saturday, October 31, 2009
DOCUMENT ORIENTED
                        DATA STORES


                    CouchDB <- (my favourite!)

                    MongoDB

                    SimpleDB (Amazon)




Saturday, October 31, 2009
COLUMN-ORIENTED
                                 STORES


                    BigTable (Google)

                    HBase (Hadoop Database)

                    Hypertable (BigTable Open Source clone)

                    Cassandra (Facebook)




Saturday, October 31, 2009
How do we use these technologies
                                  alongside CakePHP ?




Saturday, October 31, 2009
This year’s magical word:

                                   DataSources




Saturday, October 31, 2009
CASE STUDY - COUCHDB




                                 http://github.com/jperras/divan
                             (I will make zip/tar available when more stable - stay tuned)


Saturday, October 31, 2009
CASE STUDY - TOKYO
                          CABINET/TYRANT




                              http://github.com/jperras/tyrannical
                             (I will make zip/tar available when more stable - stay tuned)


Saturday, October 31, 2009
Non-relational stores are not relational.




Saturday, October 31, 2009
So don’t try to force the interface to
                                        be relational.




Saturday, October 31, 2009
DESIGNING A NON-
         RELATIONAL DATASOURCE


                    Favour simplicity over transparency

                             Don’t try to implement everything that the
                             MySQL driver implements

                    Use the strengths of the alternative store




Saturday, October 31, 2009
Example Use Cases




Saturday, October 31, 2009
KEY/VALUE STORES


                    Most have atomic increment/decrement operations
                             Great for API rate limiters (e.g. 300 API reqs/hour/account)


                    Counts & sums of normalized data
                             Most popular items, votes, ratings, some statistics


                    And more.




Saturday, October 31, 2009
DOCUMENT STORES

                    Filesystem objects (pdfs, images, excel sheets etc.) -
                    stored as document attachments (size limited).
                             Allows you to reduce reliance on shared filesystems (NFS)


                    Address book

                    Volatile schema situations

                    CouchDB has a very interesting feature set



Saturday, October 31, 2009
There are many, many use cases.




Saturday, October 31, 2009
Thanks to the DataSource adapter implementation
           in CakePHP, creating a model-based interface is simple.




Saturday, October 31, 2009
Thank you!




                                                     @jperras
                                         http://nerderati.com
                                   http://github.com/jperras
Saturday, October 31, 2009
CODE
                  Divan - CouchDB datasource

                  Yantra - State Machine component for application control flow

                  CakPHP TextMate Bundle

                  CakeMate - TextMate/Vim Plugin

                  Tyrannical - Tokyo Tyrant datasource

                        Originally by Martin Samson (pyrolian@gmail.com)

                        Working to improve code - commits coming soon.

                  Currently working on a framework-agnostic, distributed, plugin/library server.



Saturday, October 31, 2009

More Related Content

Viewers also liked

NoSQL support in Informix (JSON storage, Mongo DB API)
NoSQL support in Informix (JSON storage, Mongo DB API)NoSQL support in Informix (JSON storage, Mongo DB API)
NoSQL support in Informix (JSON storage, Mongo DB API)Keshav Murthy
 
Processing Complex Workflows in Advertising using Hadoop
Processing Complex Workflows in Advertising using HadoopProcessing Complex Workflows in Advertising using Hadoop
Processing Complex Workflows in Advertising using HadoopDataWorks Summit
 
Spring Data Neo4j Intro SpringOne 2012
Spring Data Neo4j Intro SpringOne 2012Spring Data Neo4j Intro SpringOne 2012
Spring Data Neo4j Intro SpringOne 2012jexp
 
NoSQL Plus MySQL From MySQL Practitioner\'s Point Of View
NoSQL Plus MySQL From MySQL Practitioner\'s Point Of ViewNoSQL Plus MySQL From MySQL Practitioner\'s Point Of View
NoSQL Plus MySQL From MySQL Practitioner\'s Point Of ViewAlex Esterkin
 
NoSQL, Growing up at Oracle
NoSQL, Growing up at OracleNoSQL, Growing up at Oracle
NoSQL, Growing up at OracleDATAVERSITY
 
Automated Schema Design for NoSQL Databases
Automated Schema Design for NoSQL DatabasesAutomated Schema Design for NoSQL Databases
Automated Schema Design for NoSQL DatabasesMichael Mior
 
Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015
Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015
Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015NoSQLmatters
 
7 Databases in 70 minutes
7 Databases in 70 minutes7 Databases in 70 minutes
7 Databases in 70 minutesKaren Lopez
 
NoSE: Schema Design for NoSQL Applications
NoSE: Schema Design for NoSQL ApplicationsNoSE: Schema Design for NoSQL Applications
NoSE: Schema Design for NoSQL ApplicationsMichael Mior
 
Distribute Key Value Store
Distribute Key Value StoreDistribute Key Value Store
Distribute Key Value StoreSantal Li
 
VLDB 2009 Tutorial on Column-Stores
VLDB 2009 Tutorial on Column-StoresVLDB 2009 Tutorial on Column-Stores
VLDB 2009 Tutorial on Column-StoresDaniel Abadi
 
Neo4j Graph Database Presentation (German)
Neo4j Graph Database Presentation (German)Neo4j Graph Database Presentation (German)
Neo4j Graph Database Presentation (German)jexp
 
NoSQL Database: Classification, Characteristics and Comparison
NoSQL Database: Classification, Characteristics and ComparisonNoSQL Database: Classification, Characteristics and Comparison
NoSQL Database: Classification, Characteristics and ComparisonMayuree Srikulwong
 
NoSQL and Data Modeling for Data Modelers
NoSQL and Data Modeling for Data ModelersNoSQL and Data Modeling for Data Modelers
NoSQL and Data Modeling for Data ModelersKaren Lopez
 
Big data key-value and column stores redis - cassandra
Big data  key-value and column stores redis - cassandraBig data  key-value and column stores redis - cassandra
Big data key-value and column stores redis - cassandraJWORKS powered by Ordina
 
Software Developer and Architecture @ LinkedIn (QCon SF 2014)
Software Developer and Architecture @ LinkedIn (QCon SF 2014)Software Developer and Architecture @ LinkedIn (QCon SF 2014)
Software Developer and Architecture @ LinkedIn (QCon SF 2014)Sid Anand
 
9b. Document-Oriented Databases lab
9b. Document-Oriented Databases lab9b. Document-Oriented Databases lab
9b. Document-Oriented Databases labFabio Fumarola
 
8b. Column Oriented Databases Lab
8b. Column Oriented Databases Lab8b. Column Oriented Databases Lab
8b. Column Oriented Databases LabFabio Fumarola
 

Viewers also liked (19)

NoSQL support in Informix (JSON storage, Mongo DB API)
NoSQL support in Informix (JSON storage, Mongo DB API)NoSQL support in Informix (JSON storage, Mongo DB API)
NoSQL support in Informix (JSON storage, Mongo DB API)
 
Processing Complex Workflows in Advertising using Hadoop
Processing Complex Workflows in Advertising using HadoopProcessing Complex Workflows in Advertising using Hadoop
Processing Complex Workflows in Advertising using Hadoop
 
Spring Data Neo4j Intro SpringOne 2012
Spring Data Neo4j Intro SpringOne 2012Spring Data Neo4j Intro SpringOne 2012
Spring Data Neo4j Intro SpringOne 2012
 
NoSQL Plus MySQL From MySQL Practitioner\'s Point Of View
NoSQL Plus MySQL From MySQL Practitioner\'s Point Of ViewNoSQL Plus MySQL From MySQL Practitioner\'s Point Of View
NoSQL Plus MySQL From MySQL Practitioner\'s Point Of View
 
NoSQL, Growing up at Oracle
NoSQL, Growing up at OracleNoSQL, Growing up at Oracle
NoSQL, Growing up at Oracle
 
Automated Schema Design for NoSQL Databases
Automated Schema Design for NoSQL DatabasesAutomated Schema Design for NoSQL Databases
Automated Schema Design for NoSQL Databases
 
Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015
Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015
Michael Hackstein - NoSQL meets Microservices - NoSQL matters Dublin 2015
 
7 Databases in 70 minutes
7 Databases in 70 minutes7 Databases in 70 minutes
7 Databases in 70 minutes
 
NoSE: Schema Design for NoSQL Applications
NoSE: Schema Design for NoSQL ApplicationsNoSE: Schema Design for NoSQL Applications
NoSE: Schema Design for NoSQL Applications
 
Distribute Key Value Store
Distribute Key Value StoreDistribute Key Value Store
Distribute Key Value Store
 
VLDB 2009 Tutorial on Column-Stores
VLDB 2009 Tutorial on Column-StoresVLDB 2009 Tutorial on Column-Stores
VLDB 2009 Tutorial on Column-Stores
 
Neo4j Graph Database Presentation (German)
Neo4j Graph Database Presentation (German)Neo4j Graph Database Presentation (German)
Neo4j Graph Database Presentation (German)
 
NoSQL Database: Classification, Characteristics and Comparison
NoSQL Database: Classification, Characteristics and ComparisonNoSQL Database: Classification, Characteristics and Comparison
NoSQL Database: Classification, Characteristics and Comparison
 
NoSQL and Data Modeling for Data Modelers
NoSQL and Data Modeling for Data ModelersNoSQL and Data Modeling for Data Modelers
NoSQL and Data Modeling for Data Modelers
 
Big data key-value and column stores redis - cassandra
Big data  key-value and column stores redis - cassandraBig data  key-value and column stores redis - cassandra
Big data key-value and column stores redis - cassandra
 
Software Developer and Architecture @ LinkedIn (QCon SF 2014)
Software Developer and Architecture @ LinkedIn (QCon SF 2014)Software Developer and Architecture @ LinkedIn (QCon SF 2014)
Software Developer and Architecture @ LinkedIn (QCon SF 2014)
 
9b. Document-Oriented Databases lab
9b. Document-Oriented Databases lab9b. Document-Oriented Databases lab
9b. Document-Oriented Databases lab
 
8b. Column Oriented Databases Lab
8b. Column Oriented Databases Lab8b. Column Oriented Databases Lab
8b. Column Oriented Databases Lab
 
Graphdatenbanken mit Neo4j
Graphdatenbanken mit Neo4jGraphdatenbanken mit Neo4j
Graphdatenbanken mit Neo4j
 

Similar to Non-relational databases and modern web apps

SASS: The Next Wave in Styling and Theming
SASS: The Next Wave in Styling and ThemingSASS: The Next Wave in Styling and Theming
SASS: The Next Wave in Styling and ThemingSencha
 
Object Oriented Css For High Performance Websites And Applications
Object Oriented Css For High Performance Websites And ApplicationsObject Oriented Css For High Performance Websites And Applications
Object Oriented Css For High Performance Websites And ApplicationsPerconaPerformance
 
Wave Presentation
Wave PresentationWave Presentation
Wave Presentationbedney
 
Building A Scalable Open Source Storage Solution
Building A Scalable Open Source Storage SolutionBuilding A Scalable Open Source Storage Solution
Building A Scalable Open Source Storage SolutionPhil Cryer
 
How OpenNTF Open Source Solutions Can Save You Time, Money And Your Hair
How OpenNTF Open Source Solutions Can Save You Time, Money And Your HairHow OpenNTF Open Source Solutions Can Save You Time, Money And Your Hair
How OpenNTF Open Source Solutions Can Save You Time, Money And Your HairBruce Elgort
 
Non-Technical Introduction to CrossRef for Libraries
Non-Technical Introduction to CrossRef for LibrariesNon-Technical Introduction to CrossRef for Libraries
Non-Technical Introduction to CrossRef for LibrariesCrossref
 
Hands on with Ruby & MongoDB
Hands on with Ruby & MongoDBHands on with Ruby & MongoDB
Hands on with Ruby & MongoDBWynn Netherland
 
Content Management Selection and Strategy
Content Management Selection and StrategyContent Management Selection and Strategy
Content Management Selection and StrategyIvo Jansch
 
Ibuildings Cms Talk
Ibuildings Cms TalkIbuildings Cms Talk
Ibuildings Cms Talkdean1985
 
Scaling websites with RabbitMQ A(rlvaro Videla)
Scaling websites with RabbitMQ   A(rlvaro Videla)Scaling websites with RabbitMQ   A(rlvaro Videla)
Scaling websites with RabbitMQ A(rlvaro Videla)Ontico
 
Accelerate Your Rails Site with Automatic Generation-Based Action Caching
Accelerate Your Rails Site with Automatic Generation-Based Action CachingAccelerate Your Rails Site with Automatic Generation-Based Action Caching
Accelerate Your Rails Site with Automatic Generation-Based Action Cachingelliando dias
 
Smalltalk Metaprogramming supports Probabilistic Program Analysis
Smalltalk Metaprogramming supports Probabilistic Program AnalysisSmalltalk Metaprogramming supports Probabilistic Program Analysis
Smalltalk Metaprogramming supports Probabilistic Program AnalysisESUG
 
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...JAX London
 
Agile Development with PHP in Practice
Agile Development with PHP in PracticeAgile Development with PHP in Practice
Agile Development with PHP in PracticeLars Jankowfsky
 
How to Install, Use, and Customize Drush
How to Install, Use, and Customize DrushHow to Install, Use, and Customize Drush
How to Install, Use, and Customize DrushAcquia
 
IUT presentation - English
IUT presentation - EnglishIUT presentation - English
IUT presentation - EnglishRaymond Gao
 
It's the Customer, Not the Container
It's the Customer, Not the ContainerIt's the Customer, Not the Container
It's the Customer, Not the Containerjohn wilbanks
 

Similar to Non-relational databases and modern web apps (20)

Performance Strategies
Performance StrategiesPerformance Strategies
Performance Strategies
 
Distribute the workload, PHP Barcelona 2011
Distribute the workload, PHP Barcelona 2011Distribute the workload, PHP Barcelona 2011
Distribute the workload, PHP Barcelona 2011
 
SASS: The Next Wave in Styling and Theming
SASS: The Next Wave in Styling and ThemingSASS: The Next Wave in Styling and Theming
SASS: The Next Wave in Styling and Theming
 
Object Oriented Css For High Performance Websites And Applications
Object Oriented Css For High Performance Websites And ApplicationsObject Oriented Css For High Performance Websites And Applications
Object Oriented Css For High Performance Websites And Applications
 
Wave Presentation
Wave PresentationWave Presentation
Wave Presentation
 
Building A Scalable Open Source Storage Solution
Building A Scalable Open Source Storage SolutionBuilding A Scalable Open Source Storage Solution
Building A Scalable Open Source Storage Solution
 
How OpenNTF Open Source Solutions Can Save You Time, Money And Your Hair
How OpenNTF Open Source Solutions Can Save You Time, Money And Your HairHow OpenNTF Open Source Solutions Can Save You Time, Money And Your Hair
How OpenNTF Open Source Solutions Can Save You Time, Money And Your Hair
 
Non-Technical Introduction to CrossRef for Libraries
Non-Technical Introduction to CrossRef for LibrariesNon-Technical Introduction to CrossRef for Libraries
Non-Technical Introduction to CrossRef for Libraries
 
Hands on with Ruby & MongoDB
Hands on with Ruby & MongoDBHands on with Ruby & MongoDB
Hands on with Ruby & MongoDB
 
Content Management Selection and Strategy
Content Management Selection and StrategyContent Management Selection and Strategy
Content Management Selection and Strategy
 
Ibuildings Cms Talk
Ibuildings Cms TalkIbuildings Cms Talk
Ibuildings Cms Talk
 
Processing
ProcessingProcessing
Processing
 
Scaling websites with RabbitMQ A(rlvaro Videla)
Scaling websites with RabbitMQ   A(rlvaro Videla)Scaling websites with RabbitMQ   A(rlvaro Videla)
Scaling websites with RabbitMQ A(rlvaro Videla)
 
Accelerate Your Rails Site with Automatic Generation-Based Action Caching
Accelerate Your Rails Site with Automatic Generation-Based Action CachingAccelerate Your Rails Site with Automatic Generation-Based Action Caching
Accelerate Your Rails Site with Automatic Generation-Based Action Caching
 
Smalltalk Metaprogramming supports Probabilistic Program Analysis
Smalltalk Metaprogramming supports Probabilistic Program AnalysisSmalltalk Metaprogramming supports Probabilistic Program Analysis
Smalltalk Metaprogramming supports Probabilistic Program Analysis
 
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...
 
Agile Development with PHP in Practice
Agile Development with PHP in PracticeAgile Development with PHP in Practice
Agile Development with PHP in Practice
 
How to Install, Use, and Customize Drush
How to Install, Use, and Customize DrushHow to Install, Use, and Customize Drush
How to Install, Use, and Customize Drush
 
IUT presentation - English
IUT presentation - EnglishIUT presentation - English
IUT presentation - English
 
It's the Customer, Not the Container
It's the Customer, Not the ContainerIt's the Customer, Not the Container
It's the Customer, Not the Container
 

Recently uploaded

Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Recently uploaded (20)

Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

Non-relational databases and modern web apps

  • 1. NON-RELATIONAL DATABASES Saturday, October 31, 2009
  • 2. @JPERRAS - JOEL PERRAS Canadian Geek Blog: http://nerderati.com GitHub: http://github.com/jperras CakePHP Core since Early 2009, PHP dev. since 2001 McGill University, Montréal, Canada - Physics, Mathematics & Computer Science Employer: Plank Design (http://plankdesign.com) (Twitter: @plankdesign) Saturday, October 31, 2009
  • 3. RELATIONAL DATABASES Many different vendors: MySQL, PostgreSQL, SQLite, Oracle, ... Same basic implementation: B(+)-Trees for pages B(+)-Trees or hash tables for secondary indexes Possibly R-Trees for spatial indexes Saturday, October 31, 2009
  • 4. WHAT THEY’RE GOOD AT Saturday, October 31, 2009
  • 5. Schemas (relational models) Familiar BCNF structure Strong consistency Transactions Very “mature” & well tested (mostly) Easy adoption/integration Saturday, October 31, 2009
  • 6. RDBMS’ES ARE NOT GOING ANYWHERE FriendFeed Wikipedia Google AdWords Facebook Saturday, October 31, 2009
  • 7. Most small to medium size applications will never need to go beyond a single database server. Saturday, October 31, 2009
  • 8. Always try and follow the Golden Web Application Development Rule: Saturday, October 31, 2009
  • 9. DON’T TRY TO SOLVE A PROBLEM YOU DON’T HAVE Saturday, October 31, 2009
  • 10. The web has created new problem domains in data storage and querying. Saturday, October 31, 2009
  • 11. MODERN WEB APPS Often use variable schemas Optional fields: contact lists, addresses, favourite movies/books, etc. NULL-itis: null values should not be permitted in BCNF, but are everywhere in web applications. Saturday, October 31, 2009
  • 12. MODERN WEB APPS ‘Social’ apps => high write/read ratios Complex Many-to-Many relationships Joins become a problem in federated architectures Eventual consistency is usually acceptable Downtime unacceptable Saturday, October 31, 2009
  • 14. RULES OF APP AGING http://push.cx/2009/rules-of-database-app-aging 1. All fields become optional 2. All relationships become many-to-many 3. Chatter (comments explaining hacks) grows with time. Saturday, October 31, 2009
  • 15. SOME GOOD PROBLEMS TO HAVE Even if they are “Hard” ones to solve. Saturday, October 31, 2009
  • 16. Load Balancing (you can only live with one machine for so long) Saturday, October 31, 2009
  • 17. High Availability (because disks fail, and replication fails) Saturday, October 31, 2009
  • 18. What’s a web application developer to do? Saturday, October 31, 2009
  • 19. Alternative Data Storage Solutions Saturday, October 31, 2009
  • 20. Not a silver bullet. These can solve some problems, but cause others and have their own limitations. It’s up to you to weigh the cost/benefit of your chosen solution. Saturday, October 31, 2009
  • 21. THE LANDSCAPE Key/Value Stores/Distributed Hash Tables (DHT) Document-oriented databases Column-oriented databases Saturday, October 31, 2009
  • 22. KEY/VALUE STORES Voldemort Scalaris Tokyo Cabinet Redis MemcacheDB Saturday, October 31, 2009
  • 23. DOCUMENT ORIENTED DATA STORES CouchDB <- (my favourite!) MongoDB SimpleDB (Amazon) Saturday, October 31, 2009
  • 24. COLUMN-ORIENTED STORES BigTable (Google) HBase (Hadoop Database) Hypertable (BigTable Open Source clone) Cassandra (Facebook) Saturday, October 31, 2009
  • 25. How do we use these technologies alongside CakePHP ? Saturday, October 31, 2009
  • 26. This year’s magical word: DataSources Saturday, October 31, 2009
  • 27. CASE STUDY - COUCHDB http://github.com/jperras/divan (I will make zip/tar available when more stable - stay tuned) Saturday, October 31, 2009
  • 28. CASE STUDY - TOKYO CABINET/TYRANT http://github.com/jperras/tyrannical (I will make zip/tar available when more stable - stay tuned) Saturday, October 31, 2009
  • 29. Non-relational stores are not relational. Saturday, October 31, 2009
  • 30. So don’t try to force the interface to be relational. Saturday, October 31, 2009
  • 31. DESIGNING A NON- RELATIONAL DATASOURCE Favour simplicity over transparency Don’t try to implement everything that the MySQL driver implements Use the strengths of the alternative store Saturday, October 31, 2009
  • 32. Example Use Cases Saturday, October 31, 2009
  • 33. KEY/VALUE STORES Most have atomic increment/decrement operations Great for API rate limiters (e.g. 300 API reqs/hour/account) Counts & sums of normalized data Most popular items, votes, ratings, some statistics And more. Saturday, October 31, 2009
  • 34. DOCUMENT STORES Filesystem objects (pdfs, images, excel sheets etc.) - stored as document attachments (size limited). Allows you to reduce reliance on shared filesystems (NFS) Address book Volatile schema situations CouchDB has a very interesting feature set Saturday, October 31, 2009
  • 35. There are many, many use cases. Saturday, October 31, 2009
  • 36. Thanks to the DataSource adapter implementation in CakePHP, creating a model-based interface is simple. Saturday, October 31, 2009
  • 37. Thank you! @jperras http://nerderati.com http://github.com/jperras Saturday, October 31, 2009
  • 38. CODE Divan - CouchDB datasource Yantra - State Machine component for application control flow CakPHP TextMate Bundle CakeMate - TextMate/Vim Plugin Tyrannical - Tokyo Tyrant datasource Originally by Martin Samson (pyrolian@gmail.com) Working to improve code - commits coming soon. Currently working on a framework-agnostic, distributed, plugin/library server. Saturday, October 31, 2009