SlideShare a Scribd company logo
How I learned to use SQL
             and then learned not to use it
                            Henrik Ingo

                             Froscon
                            2011-08-20




2011-07-26     OSCON 2011                     1
Henrik Ingo


                      open source technology and
                      strategy specialist
                      active in MySQL, Drupal
                      communities
                      current: Senior Performance
                      Architect at Nokia Ovi
                      worked in mobile and LAMP
                      with business management,
                      sales, R&D
                      author of "Open Life: The
                      Philosophy of Open Source"
                      www.openlife.cc
                      henrik.ingo@openlife.cc

2011-07-26    OSCON 2011                            2
1994




2011-07-26   OSCON 2011   3
1994


USSR fell 4 years ago
     Finland yet to win first gold medal in hockey
             Windows 3.0 replacing MS-DOS
               Windows 95 did not yet exist
                  I learn how to write .bat scripts from my dad
                 Word 6.0 replacing WordPerfect 5.1
                Excel 5.0 replacing Lotus
               I had not yet used Internet

2011-07-26                        OSCON 2011                      4
1994



                                                   SQL
                                            Standard Interpreted
C++ & Visual Basic
                                Flexible and expressive command line env

             LAN                          "SQL for secretaries"
      Printer Database                 Good for English speakers
                                     2000: Bad for IDE w IntelliSense

         Client - Server architecture

                 Stored procedures rule
         DBA is king of business logic
2011-07-26                     OSCON 2011                               5
1997




2011-07-26   OSCON 2011   6
1997




2011-07-26   OSCON 2011   7
Learning SQL


NoSQL advocates say:               Henrik says:
    SQL is hard to learn               MS Access easy to learn
    To really scale, you must          Darn, I always got
    de-normalize                       normalization
    Most people don't get              I know, teaching n:n
    normalization right                relations was always fun
    Impedance mismatch                 INSERT INTO t ...
    between oo and sql                 serialize($obj)
    I just need a simple key-          SELECT value FROM t
    value store                        WHERE key=?;


2011-07-26                    OSCON 2011                          8
1997

                                                  WorldWideWeb
                                           Free Software
                                              1998: Open Source

                                  LAMP stack
                                     Where P = Perl, runs +90% of web "apps"
                         Oracle doesn't support Linux
                     PostgreSQL doesn't support Windows
                       MiniSQL has poor performance

             Wish I had a simple data store for my web apps that
             was really fast and scalable and Free Software...



2011-07-26                           OSCON 2011                                9
1997




2011-07-26   OSCON 2011   10
1997


ERROR: Could not connect to MySQL: ERROR 1040: Too many connections




                             "Slashdotted"
                             Web jargon ca 1997.
                             "Your site is down because
                             it isn't web scale."




 2011-07-26                        OSCON 2011                         11
History of MySQL


1985... ISAM key-value store
 - Trivia: Access is also ISAM db

                        Data Warehousing: bulk loads, reporting.
                         - Flexible attitude to errors during insert


 SQL support added (HTML)
                                    ODBC (Excel)
                                    - BI tool #1


             1995.. Released under FOSS-like license


2011-07-26                    OSCON 2011                               12
1997



"Read-mostly"
 - No MVCC
 - Not transactional
                                  Not crash safe

Scales well for 2-3 CPUs
 - This will work well for the next 10 years



                                 Not ANSI SQL

2011-07-26                     OSCON 2011          13
1997


This site is currently offline for nightly backup.
Please come back after 15 minutes.




                       (No online backups)




 2011-07-26                    OSCON 2011            14
1997-2007



 InnoDB and BDB
  - Transactions!                    Replication
                                      - Statement based
                                      - Asynchronous


             SAP partnership
             - 4 CPU servers
             - Support SQL-92 "enterprise" features
             - Oracle acquires InnoDB and BDB



                                Online backup tool
2011-07-26                      OSCON 2011                15
2007




                     Users are not happy!
We want a database that
- does not conform to SQL standard
- has no transactions
- is not crash safe
- impossible to do consistent backups

- but scales to more than 4 cores!


2011-07-26                OSCON 2011    16
You see where I'm going, don't you...




2011-07-26                 OSCON 2011                17
Sorry, that was a cheap shot...




                  ...I just couldn't resist :-)




2011-07-26              OSCON 2011                18
It really started with...




2011-07-26          OSCON 2011           19
Actual questions from Memcache users, ca 2007:




How can I dump all records
from a memcached instance?



                 How can I make
                 memcached
                 highly available?
                                                 Backups?

2011-07-26                      OSCON 2011                    20
Answers from Memcache developers




It's a cache. Please use it
together with a real database!


             Why would you ever
             want to do that?



                    No no no, you're doing it wrong!
2011-07-26               OSCON 2011                21
So clearly there was a market demand...




2011-07-26                  OSCON 2011                 22
Things NoSQL guys do really well


        No SQL (parsing)
        Schemaless = Win! for agile development


                 HA with quorum consistency: R + W > N
                    Transparent sharding


                            Graph databases
                              N:N relationships, what's the big deal?
                              Actually makes sense to give up on SQL!


             Map Reduce
               Bypass ETL, get clean data


                            Implemented in Java or Python (or Erlang)


2011-07-26                              OSCON 2011                      23
Best of both worlds


NoSQL                                    MySQL
    No SQL                                   HandlerSocket
    .                                        Memcache API, NDB API

    Simple key-value store                   BLOB
    .                                        SELECT v FROM ... WHERE k=?

    ...and secondary indexes                 Functional indexes
                                             Virtual columns, etc...

    Quorum consistency                       Synchronous replication
    .                                        Galera, NDB

    Graph databases                          Damn N:N relations!
    Map Reduce against text files            Map Reduce against RDBMS
    Java and Python                          C++ can be done right
    .                                        Drizzle


2011-07-26                          OSCON 2011                             24
Clayton Christensen on Disruptive innovation




2011-07-26                     OSCON 2011                   25
Clayton Christensen on Disruptive innovation




                     First they ignore you
                   Then they laugh at you
                      Then they fight you
                          Then you win


                                            - Gandhi

2011-07-26                     OSCON 2011                   26
It used to be




2011-07-26     OSCON 2011    27
The future is




2011-07-26     OSCON 2011    28
The future is




             All Open Source




2011-07-26          OSCON 2011    29

More Related Content

PDF
eZ Accelerator v1
PDF
Paris NoSQL User Group - In Memory Data Grids in Action (without transactions...
DOC
PPTX
Relational database revised
PPTX
12 Ways to Use PLCs & SQL Databases Together
PPTX
Why You Should Use Oracle SQL Developer
PDF
Sql Adv
eZ Accelerator v1
Paris NoSQL User Group - In Memory Data Grids in Action (without transactions...
Relational database revised
12 Ways to Use PLCs & SQL Databases Together
Why You Should Use Oracle SQL Developer
Sql Adv

Similar to Froscon2011: How i learned to use sql and then learned not to use it (20)

PDF
Databases and the Cloud
PDF
My sql tutorial-oscon-2012
PDF
PostgreSQL and MySQL
PPTX
PDF
Cassandra at Morningstar (Feb 2011)
PPTX
DataStax C*ollege Credit: What and Why NoSQL?
PPTX
Handling Massive Writes
PDF
Oracle my sql cluster cge
PDF
Getting started with MySQL
PDF
UKOUG 2011: MySQL Architectures for Oracle DBA's
PDF
OpenExpo: MySQL, Where are you going?
PDF
In-memory Database and MySQL Cluster
PDF
Free Software and the Future of Database Technology
PDF
MySQL - Open Database
PDF
MySQL Cluster Scaling to a Billion Queries
ODP
Vote NO for MySQL
PDF
Drizzle 7.0, Future of Virtualizing
PPT
Lecture 9: Dynamic web application
PDF
Choosing a MySQL High Availability solution - Percona Live UK 2011
PDF
MySQL Breakfast in London - 24 June 2010
Databases and the Cloud
My sql tutorial-oscon-2012
PostgreSQL and MySQL
Cassandra at Morningstar (Feb 2011)
DataStax C*ollege Credit: What and Why NoSQL?
Handling Massive Writes
Oracle my sql cluster cge
Getting started with MySQL
UKOUG 2011: MySQL Architectures for Oracle DBA's
OpenExpo: MySQL, Where are you going?
In-memory Database and MySQL Cluster
Free Software and the Future of Database Technology
MySQL - Open Database
MySQL Cluster Scaling to a Billion Queries
Vote NO for MySQL
Drizzle 7.0, Future of Virtualizing
Lecture 9: Dynamic web application
Choosing a MySQL High Availability solution - Percona Live UK 2011
MySQL Breakfast in London - 24 June 2010
Ad

More from Henrik Ingo (16)

PDF
ICPE25 Henrik Ingo Optimizing Hunter Nyrkiö slides (1).pdf
PDF
SPEC June 2025 - Using e-divisive means change detection in continuous benchm...
PDF
Introduction to new high performance storage engines in mongodb 3.0
PDF
Meteor - The next generation software stack
PDF
MongoDB for Oracle Experts - OUGF Harmony 2014
PDF
Building Your First MongoDB App
PDF
Analytics with MongoDB Aggregation Framework and Hadoop Connector
PDF
Whats new in mongoDB 2.4 at Copenhagen user group 2013-06-19
PDF
Failover or not to failover
PDF
Spatial functions in MySQL 5.6, MariaDB 5.5, PostGIS 2.0 and others
PDF
Introducing Xtrabackup Manager
PDF
Using and Benchmarking Galera in different architectures (PLUK 2012)
PDF
Froscon 2012 how big corporations play the open source game
PDF
Introduction to Galera
PDF
Fixed in drizzle
PDF
How to grow your open source project 10x and revenues 5x OSCON2011
ICPE25 Henrik Ingo Optimizing Hunter Nyrkiö slides (1).pdf
SPEC June 2025 - Using e-divisive means change detection in continuous benchm...
Introduction to new high performance storage engines in mongodb 3.0
Meteor - The next generation software stack
MongoDB for Oracle Experts - OUGF Harmony 2014
Building Your First MongoDB App
Analytics with MongoDB Aggregation Framework and Hadoop Connector
Whats new in mongoDB 2.4 at Copenhagen user group 2013-06-19
Failover or not to failover
Spatial functions in MySQL 5.6, MariaDB 5.5, PostGIS 2.0 and others
Introducing Xtrabackup Manager
Using and Benchmarking Galera in different architectures (PLUK 2012)
Froscon 2012 how big corporations play the open source game
Introduction to Galera
Fixed in drizzle
How to grow your open source project 10x and revenues 5x OSCON2011
Ad

Recently uploaded (20)

PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Spectroscopy.pptx food analysis technology
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
KodekX | Application Modernization Development
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Digital-Transformation-Roadmap-for-Companies.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Spectroscopy.pptx food analysis technology
Network Security Unit 5.pdf for BCA BBA.
KodekX | Application Modernization Development
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Unlocking AI with Model Context Protocol (MCP)
Understanding_Digital_Forensics_Presentation.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Spectral efficient network and resource selection model in 5G networks
Programs and apps: productivity, graphics, security and other tools
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
20250228 LYD VKU AI Blended-Learning.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
The AUB Centre for AI in Media Proposal.docx
sap open course for s4hana steps from ECC to s4
Dropbox Q2 2025 Financial Results & Investor Presentation

Froscon2011: How i learned to use sql and then learned not to use it

  • 1. How I learned to use SQL and then learned not to use it Henrik Ingo Froscon 2011-08-20 2011-07-26 OSCON 2011 1
  • 2. Henrik Ingo open source technology and strategy specialist active in MySQL, Drupal communities current: Senior Performance Architect at Nokia Ovi worked in mobile and LAMP with business management, sales, R&D author of "Open Life: The Philosophy of Open Source" www.openlife.cc henrik.ingo@openlife.cc 2011-07-26 OSCON 2011 2
  • 3. 1994 2011-07-26 OSCON 2011 3
  • 4. 1994 USSR fell 4 years ago Finland yet to win first gold medal in hockey Windows 3.0 replacing MS-DOS Windows 95 did not yet exist I learn how to write .bat scripts from my dad Word 6.0 replacing WordPerfect 5.1 Excel 5.0 replacing Lotus I had not yet used Internet 2011-07-26 OSCON 2011 4
  • 5. 1994 SQL Standard Interpreted C++ & Visual Basic Flexible and expressive command line env LAN "SQL for secretaries" Printer Database Good for English speakers 2000: Bad for IDE w IntelliSense Client - Server architecture Stored procedures rule DBA is king of business logic 2011-07-26 OSCON 2011 5
  • 6. 1997 2011-07-26 OSCON 2011 6
  • 7. 1997 2011-07-26 OSCON 2011 7
  • 8. Learning SQL NoSQL advocates say: Henrik says: SQL is hard to learn MS Access easy to learn To really scale, you must Darn, I always got de-normalize normalization Most people don't get I know, teaching n:n normalization right relations was always fun Impedance mismatch INSERT INTO t ... between oo and sql serialize($obj) I just need a simple key- SELECT value FROM t value store WHERE key=?; 2011-07-26 OSCON 2011 8
  • 9. 1997 WorldWideWeb Free Software 1998: Open Source LAMP stack Where P = Perl, runs +90% of web "apps" Oracle doesn't support Linux PostgreSQL doesn't support Windows MiniSQL has poor performance Wish I had a simple data store for my web apps that was really fast and scalable and Free Software... 2011-07-26 OSCON 2011 9
  • 10. 1997 2011-07-26 OSCON 2011 10
  • 11. 1997 ERROR: Could not connect to MySQL: ERROR 1040: Too many connections "Slashdotted" Web jargon ca 1997. "Your site is down because it isn't web scale." 2011-07-26 OSCON 2011 11
  • 12. History of MySQL 1985... ISAM key-value store - Trivia: Access is also ISAM db Data Warehousing: bulk loads, reporting. - Flexible attitude to errors during insert SQL support added (HTML) ODBC (Excel) - BI tool #1 1995.. Released under FOSS-like license 2011-07-26 OSCON 2011 12
  • 13. 1997 "Read-mostly" - No MVCC - Not transactional Not crash safe Scales well for 2-3 CPUs - This will work well for the next 10 years Not ANSI SQL 2011-07-26 OSCON 2011 13
  • 14. 1997 This site is currently offline for nightly backup. Please come back after 15 minutes. (No online backups) 2011-07-26 OSCON 2011 14
  • 15. 1997-2007 InnoDB and BDB - Transactions! Replication - Statement based - Asynchronous SAP partnership - 4 CPU servers - Support SQL-92 "enterprise" features - Oracle acquires InnoDB and BDB Online backup tool 2011-07-26 OSCON 2011 15
  • 16. 2007 Users are not happy! We want a database that - does not conform to SQL standard - has no transactions - is not crash safe - impossible to do consistent backups - but scales to more than 4 cores! 2011-07-26 OSCON 2011 16
  • 17. You see where I'm going, don't you... 2011-07-26 OSCON 2011 17
  • 18. Sorry, that was a cheap shot... ...I just couldn't resist :-) 2011-07-26 OSCON 2011 18
  • 19. It really started with... 2011-07-26 OSCON 2011 19
  • 20. Actual questions from Memcache users, ca 2007: How can I dump all records from a memcached instance? How can I make memcached highly available? Backups? 2011-07-26 OSCON 2011 20
  • 21. Answers from Memcache developers It's a cache. Please use it together with a real database! Why would you ever want to do that? No no no, you're doing it wrong! 2011-07-26 OSCON 2011 21
  • 22. So clearly there was a market demand... 2011-07-26 OSCON 2011 22
  • 23. Things NoSQL guys do really well No SQL (parsing) Schemaless = Win! for agile development HA with quorum consistency: R + W > N Transparent sharding Graph databases N:N relationships, what's the big deal? Actually makes sense to give up on SQL! Map Reduce Bypass ETL, get clean data Implemented in Java or Python (or Erlang) 2011-07-26 OSCON 2011 23
  • 24. Best of both worlds NoSQL MySQL No SQL HandlerSocket . Memcache API, NDB API Simple key-value store BLOB . SELECT v FROM ... WHERE k=? ...and secondary indexes Functional indexes Virtual columns, etc... Quorum consistency Synchronous replication . Galera, NDB Graph databases Damn N:N relations! Map Reduce against text files Map Reduce against RDBMS Java and Python C++ can be done right . Drizzle 2011-07-26 OSCON 2011 24
  • 25. Clayton Christensen on Disruptive innovation 2011-07-26 OSCON 2011 25
  • 26. Clayton Christensen on Disruptive innovation First they ignore you Then they laugh at you Then they fight you Then you win - Gandhi 2011-07-26 OSCON 2011 26
  • 27. It used to be 2011-07-26 OSCON 2011 27
  • 28. The future is 2011-07-26 OSCON 2011 28
  • 29. The future is All Open Source 2011-07-26 OSCON 2011 29