Keynote for the Open DB Camp track (developer room) at Froscon2011. The point is to compare the history of MySQL with the evolution of new NoSQL systems.
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
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
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
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
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
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
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