Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Lightning talks percona live mysql_2012
1. Lightning talks
Giuseppe Maxia
Continuent, Inc
April 11, 2012
Wednesday, April 11, 12
2. Lineup
Stewart Smith The 5 minutes tour of Drizzle
Jeff Mace What can possibly go wrong?
Nicolai Plum MAKE.DATABASES.FAST
Bill Karwin Schemadoc
Robert Hodges It's the application, stupid!
Robert Buck NuoDB overview
David Holoboff Diagnosis and possible fixes
Lawrence Schwartz OLTP and OLAP
Baron Schwartz Building a scalable system
Sheeri Cabral How to become a rock star DBA
Giuseppe Maxia Cruelty on database clusters
Wednesday, April 11, 12
3. The 5 minutes tour of
Drizzle
Stewart Smith
Wednesday, April 11, 12
67. MAKE.DATABASES.FAST
Nicolai Plum
Booking.com, part of priceline.com (Nasdaq: PCLN), headquartered in Amsterdam, 50+ offices worldwide. www.booking.com/offices
Wednesday, April 11, 12
68. The business
• Booking.com
– Leading online hotel reservation agency
– Part of the Priceline Group of Companies
– Sustained rapid business growth
– All powered by MySQL
Booking.com, part of priceline.com (Nasdaq: PCLN), headquartered in Amsterdam, 50+ offices worldwide. www.booking.com/offices
Wednesday, April 11, 12
69. The challenge
Booking.com, part of priceline.com (Nasdaq: PCLN), headquartered in Amsterdam, 50+ offices worldwide. www.booking.com/offices
Wednesday, April 11, 12
70. The problem…
• Hundreds of database servers
• Many replication slaves
• Few DBAs, some more sysadmins
• Need to make tens of servers each day
Booking.com, part of priceline.com (Nasdaq: PCLN), headquartered in Amsterdam, 50+ offices worldwide. www.booking.com/offices
Wednesday, April 11, 12
71. If you do this manually
You are doing it wrong
Booking.com, part of priceline.com (Nasdaq: PCLN), headquartered in Amsterdam, 50+ offices worldwide. www.booking.com/offices
Wednesday, April 11, 12
72. Among our weapons are…
• Network OS installation
• Puppet configuration management
• Database cloning
• and a fanatical devotion to automation!
Booking.com, part of priceline.com (Nasdaq: PCLN), headquartered in Amsterdam, 50+ offices worldwide. www.booking.com/offices
Wednesday, April 11, 12
73. Server installation
• Server Database
• PXE netboot
• CentOS kickstart
Booking.com, part of priceline.com (Nasdaq: PCLN), headquartered in Amsterdam, 50+ offices worldwide. www.booking.com/offices
Wednesday, April 11, 12
74. System configuration
• Now we have a server that can run Puppet
• Puppet does
– OS setup
– Software installation
– LVM setup and filesystem creation (tailored by role)
• Prefer ongoing configuration management tools to
single perfect installation tools
Booking.com, part of priceline.com (Nasdaq: PCLN), headquartered in Amsterdam, 50+ offices worldwide. www.booking.com/offices
Wednesday, April 11, 12
75. Database cloning
• Now we have a server ready to run a database
• Copying databases based on LVM snapshots
• create_clone program
– Copy via SSH and rsync
– LVM snapshot
– Fix my.cnf (server id!) automatically
Booking.com, part of priceline.com (Nasdaq: PCLN), headquartered in Amsterdam, 50+ offices worldwide. www.booking.com/offices
Wednesday, April 11, 12
76. Things we learned
• Waiting for actions to complete takes a lot of person
time – automate batches of work as much as
possible
• You really need a Server Database, and drive
everything from it
• Most hardware can’t support being a clone source
and in service, you need spares
• Online snapshots break in subtle ways; best stop the
database.
Booking.com, part of priceline.com (Nasdaq: PCLN), headquartered in Amsterdam, 50+ offices worldwide. www.booking.com/offices
Wednesday, April 11, 12
77. Things we learned
DBAs are toolsmiths,
not database installers
Booking.com, part of priceline.com (Nasdaq: PCLN), headquartered in Amsterdam, 50+ offices worldwide. www.booking.com/offices
Wednesday, April 11, 12
78. Thank you
• … if you like the way we work, we are hiring
• http://www.booking.com/jobs
Booking.com, part of priceline.com (Nasdaq: PCLN), headquartered in Amsterdam, 50+ offices worldwide. www.booking.com/offices
Wednesday, April 11, 12
80. Schemadoc
Bill Karwin, Percona Inc.
Wednesday, April 11, 12
81. Schema Can Be Unclear
CREATE TABLE AccountActivity (
Id INT PRIMARY KEY,
Name VARCHAR(100),
Status VARCHAR(20),
EntityNum INT,
Order INT
);
www.percona.com
Wednesday, April 11, 12
82. Schema Can Be Unclear
CREATE TABLE AccountActivity (
Id INT PRIMARY KEY,
whose name?
Name VARCHAR(100),
Status VARCHAR(20),
EntityNum INT,
Order INT
);
www.percona.com
Wednesday, April 11, 12
83. Schema Can Be Unclear
CREATE TABLE AccountActivity (
Id INT PRIMARY KEY,
whose name?
Name VARCHAR(100),
Status VARCHAR(20), what are the values?
EntityNum INT,
Order INT
);
www.percona.com
Wednesday, April 11, 12
84. Schema Can Be Unclear
CREATE TABLE AccountActivity (
Id INT PRIMARY KEY,
whose name?
Name VARCHAR(100),
Status VARCHAR(20), what are the values?
EntityNum INT, what’s an entity?
Order INT what’s a number?
);
www.percona.com
Wednesday, April 11, 12
85. Schema Can Be Unclear
CREATE TABLE AccountActivity (
Id INT PRIMARY KEY,
whose name?
Name VARCHAR(100),
Status VARCHAR(20), what are the values?
EntityNum INT, what’s an entity?
Order INT what’s a number?
); commerce, or ordinal?
www.percona.com
Wednesday, April 11, 12
86. Comments!
CREATE TABLE AccountActivity (
Id INT PRIMARY KEY,
Name VARCHAR(100)
COMMENT ‘person who placed the order’,
Status VARCHAR(20)
COMMENT ‘new, open, or closed’,
EntityNum INT
COMMENT ‘how many items in the order’,
Order INT
COMMENT ‘reference to the Orders table’
) COMMENT ‘any change to e-commerce
orders’;
www.percona.com
Wednesday, April 11, 12
87. Length
• Limits increased in MySQL 5.5.3:
• Per column: 1024 characters
• Per index: 1024 characters
• Per table: 2048 characters
• Per partition: 80 characters
(MySQL 5.6 increases this to 1024)
www.percona.com
Wednesday, April 11, 12
88. “Is there a tool for MySQL
like javadoc for Java code?”
www.percona.com
Wednesday, April 11, 12
89. development
dba
documentation
www.percona.com
Wednesday, April 11, 12
90. schemadoc
www.percona.com
Wednesday, April 11, 12
91. Usage
$ schemadoc -v h=dbserver,D=EcommerceDB,u=root,p=xxxx
Loading metadata...
Running online analysis...
done.
Outputting to html.
Rendering pages for tables. done.
Rendering pages for views done.
Rendering pages for procedures done.
Rendering pages for triggers done.
Rendering page for schema summary... done.
Rendering page for schema link... done.
Rendering page for deprecated-list... done.
Rendering page for all-index... done.
Rendering page for help-doc... done.
Rendering page for allschema-frame... done.
Rendering page for index... done.
www.percona.com
Wednesday, April 11, 12
93. hooray.
www.percona.com
Wednesday, April 11, 12
94. But Wait, There’s More
• Parses SQL dump file
• Reads from a live MySQL instance
• Document many schemas
• Update one schema at a time
www.percona.com
Wednesday, April 11, 12
95. Schema Analysis
• Number of indexes and columns per data type
• Columns with same name but different type
• ENUM columns that aren’t NOT NULL
• Use of FLOAT or DOUBLE
• Tables with one index per column
• Tables with one index over all columns
• Tables with no indexes
• INT(N) other than default N
• Lack of INT UNSIGNED columns
www.percona.com
Wednesday, April 11, 12
96. Schema Analysis
• Tables that look like Entity-Attribute-Value
• Tables that look like Polymorphic Associations
• Superfluous primary key
• Report table with least / most indexes
• IP addresses stored in VARCHAR
• Excessive use of VARCHAR(255),
report actual max string length
• ...And supports plugins for other checks!
www.percona.com
Wednesday, April 11, 12
97. yes, we get it.
www.percona.com
Wednesday, April 11, 12
98. Future of Schemadoc
• Integrate with Percona Toolkit library
• Read extra metadata (foreign keys)
• Show table sizes and growth rates
• Show SQL privileges (who has access?)
• CLI for adding / updating comments
• Batch-mode output
• Redesign HTML output with modern look & feel
www.percona.com
Wednesday, April 11, 12
122. DIAGNOSIS AND
POSSIBLE FIXES:
A MULTIPLE CHOICE PRIMER
FOR BEGINNING DBAS
Wednesday, April 11, 12
123. This talk is for entertainment value only.
Any perceived similarity between what you
will hear in the next five minutes and true
life scenarios are merely coincidental, with
no intent of harm or liability.
Wednesday, April 11, 12
154. OLTP and OLAP
Lawrence Schwartz
Wednesday, April 11, 12
155. OLTP and OLAP
Have Your Cake and Eat it Too!
Lawrence Schwartz
Wednesday, April 11, 12
156. Avoiding the B-tree Valley of Death
“The real end-game for Big Data is to have transactional a
analytic data on the same database.”
However, Today’s database categories - OLAP, OLTP are
compromises to get around dated, rigid indexing technology
B-tree
Valley of
Usage
Death
OLAP OLTP
Columnar DBs Hadoop
MongoDB
Read-intensive Write-intensive
Wednesday, April 11, 12
157. B-trees Perform Poorly on Disk
MySQL + InnoDB MySQL + TokuDB
Based on B-Tree Indexes Based on Fractal Tree Indexes
• Random Workloads Lead To Frequent • Continuous Rebalancing and
Drive Head Movement Aggregation at Nodes
• MySQL Can’t Take Advantage of Full • Eliminates Fragmentation,
Drive I/O Potential Maximizes Disk I/O
Wednesday, April 11, 12
158. B-trees Can’t Handle Big Data
MySQL + InnoDB MySQL + TokuDB
• Performance Drops to a Trickle above • 20x Insertion Rates at One
50-100M Rows Billion Rows
• Delayed Checkpoints Diminish • Stand Up More Indexes for
Performance Better Query Performance
Wednesday, April 11, 12
159. B-trees Aren’t Agile
MySQL + InnoDB MySQL + TokuDB
• Big Database Schema Changes Take • Changes Complete in Seconds
Hours To Complete
• Allows Business' Data Models
• Changes Have to Wait for Scheduled to Immediately Adapt
Downtime
Wednesday, April 11, 12
160. B-trees Don’t Compress Well
MySQL + InnoDB MySQL + TokuDB
• Compression ~2x to ~2.5x Typical • High Compression
• Compression Impacts Performance • No Impact to Performance
Wednesday, April 11, 12
161. TokuDB Eliminates Death Valley
“While TokuDB® is effectively an operational database technology, it
does blur the lines between operations and analytics”
eCommerce
Personalization
Social
Cloud Networks
Assets
Logfile analysis
Fractal Tree® Indexes
are the Solution
Usage
Real Time
OLAP Analytic
OLTP
OLAP OLTP
Read-intensive Write-intensive
Wednesday, April 11, 12
186. Some Help You Can Get
MySQL Community Team
Volunteers – UG video: Richard Laskey
“What can I help you do?”
Technocation for grants
- meetup.com fees
- Open SQL/DB Camp
- Postgres Open
- Open Source Bridge
- Drizzle Day
(donate to www.technocation.org!)
Wednesday, April 11, 12
187. It Takes a Community
Permission to use pictures granted by:
Ronald Bradford
Francesca Simon-Carboni Photography
Colin Charles
Jeremy Cole
James Duncan Davidson
Keith Larson
Gerry Narvaja
Wednesday, April 11, 12