MySQL Overview

34
September 2004 | MySQL ® Overview | www.mysql.com 1 MySQL ® Overview Aaron Byers Sr. Sales Manager - Telecom & Networking

Transcript of MySQL Overview

September 2004 | MySQL® Overview | www.mysql.com 1

MySQL® Overview

Aaron ByersSr. Sales Manager - Telecom & Networking

September 2004 | MySQL® Overview | www.mysql.com 2

About MySQL

September 2004 | MySQL® Overview | www.mysql.com 3

MySQL• Founded in 1980’s• WW Headquarters in Uppsala,

Sweden– US Headquarters in Seattle– Executive office in Cupertino

• 200 employees, in 18 countries• US $19.5M Investment

– Led by Benchmark Capital• Over 6 Million Active

Installations– Most popular Open Source

RDBMS– Dual Licensing Model

September 2004 | MySQL® Overview | www.mysql.com 4

Where does MySQL fit?

Oracle, MS, IBM

Enterprise

SleepyCatPostgreSQL

Standalone

BirdstepSolid

EmbeddedEmbedded and

Distributed Data Management

September 2004 | MySQL® Overview | www.mysql.com 6

Telecom Customers – Q1 2005

September 2004 | MySQL® Overview | www.mysql.com 7

MySQL Technology

September 2004 | MySQL® Overview | www.mysql.com 8

MySQL Server• High Performance RDBMS• Standards based SQL, aiming for SQL-99• Stable• Scalable

– Embedded in hardware– Extremely high load applications– Master/Slave Replication

• Easy to use• Modular

– Storage Engines– Compile and runtime feature flexibility to conserve resources

September 2004 | MySQL® Overview | www.mysql.com 9

Client Library Support

• C API: libmysql• PHP utilizing C API• Connector/J, JDBC Type IV JDBC Driver• Connector/ODBC• Perl DBD::DBI• ADO.Net, OleDB, Ruby, Erlang, Eiffel, Smalltalk, etc.

supported by third parties

September 2004 | MySQL® Overview | www.mysql.com 10

Server Design

• Written in C, C++, ASM• Majority (80%) in C

– client library, network communications, I/O, storage engines• Parse tree and optimizer implemented C++• String functionality in ASM on platforms that require it for

performance.

September 2004 | MySQL® Overview | www.mysql.com 11

Process Model

• Multithreaded• 1 Connection means 1 Thread• Minimum overhead per client

– Network buffers (configurable, limits max query size)– Thread Stack (e.g. 128-256K on Linux)– read_buffer_size – read_rnd_buffer_size– sort_buffer_size– tmp_table_size

• Deployments with 1000s of concurrent connections not uncommon

September 2004 | MySQL® Overview | www.mysql.com 12

MySQL Storage Engines

September 2004 | MySQL® Overview | www.mysql.com 13

MySQL Internal Architecture

Parse OptimizeRetrieve

Store

MySQL

MyI

SA

M

Inno

DB

MyS

QLC

lust

er

MySQL DatabaseManagement Level

Table Handler /Storage Engine

Level

Hea

p

Cus

tom

September 2004 | MySQL® Overview | www.mysql.com 14

What properties are Storage Engine dependent?

• Very few!– Transactional capabilities– Locking– Backup and Recovery– Optimization (partly)– Pricing (licenses, support)

• Storage Engines are Transparent– Tables of different types within one query

September 2004 | MySQL® Overview | www.mysql.com 15

MyISAM

• Fastest for read or write applications, since there are no transaction overheads

• Large-grained (table-level) locks• Non-locking inserts when inserted at end of table (logging

applications)• Less disk space since there is no transaction log or

multiversioning overhead• Uses less memory for updates

September 2004 | MySQL® Overview | www.mysql.com 16

Heap

• Stored in memory• Does not survive server restart• Hash or Btree indexes• No partial-key index searches• Fixed-length record format• No BLOB/TEXT support

September 2004 | MySQL® Overview | www.mysql.com 17

Redo

Log

The InnoDB Storage EngineIn memory On disk (workspace)

Log

files

Tabl

e sp

ace

Log File 1Log File 2Log File 3

Buffer pool(buffered

data pages)

Add’t’l Mem Pool

Log Buffer(buffered

log records)

ibdata2data file

ibdata1data file

Undo Log

COMMIT(+ checkpoint)

checkpoint

September 2004 | MySQL® Overview | www.mysql.com 18

InnoDB• Full ACID compliance• Row level locking with Next-Key Locking• Multi-Versioning

– Consistent non-locking read• Commit and rollback segments

– Fault and crash tolerant• Foreign Key Constraints• Large Tablespaces, Raw Partitions, Hot Backups• Transparent with other MySQL storage engines• Tuned for performance and large data sets• Next-generation index and data storage

– Clustered Indexes

September 2004 | MySQL® Overview | www.mysql.com 20

InnoDB Size Limits• Columns per table: 1000

– hard limit since it is encoded in 10 bits in the transaction header

• Max row size: 4 GB

• Maximum tablespace size: 64 TB

• Transaction size: Unlimited– limited by tablespace size

September 2004 | MySQL® Overview | www.mysql.com 21

MySQL Cluster• Acquisition of a database unit from Ericsson, people and all IP

• Integrated as new Storage Engine for MySQL Server– MySQL Cluster

• Draws from Ericsson’s extensive experience in buildingreliable solutions for the Telecom/IP industry

• Parallel server architecture with unmatchedavailability, performance, and scalability

September 2004 | MySQL® Overview | www.mysql.com 22

Cluster Advantages• Flexible and cost-efficient scaling

– Scales as one logical database• Transparent and independent scaling of database and application• Easier development• Easier to maintain in operation (as opposed to partitioned database

instances)– Demonstrated linear scalability on low-cost hardware

• Lower hardware cost– No need for expensive specialized hardware

• Performance– In-memory performance

• Carrier grade availability characteristics– Availability mechanisms transparent to application

September 2004 | MySQL® Overview | www.mysql.com 23

MySQL Technical Features

September 2004 | MySQL® Overview | www.mysql.com 24

Supported Operating Systems

• AIX 4.x• Amiga• BSDI 2.x (mit-pthreads)• BSDI 3.0, 3.1, 4.x (native)• Caldera (SCO) OpenServer • Caldera UnixWare 7.0.1• DEC Unix 4.x• FreeBSD 2.x, 3.x, 4.x• HP-UX 10.20 / 11.x • Linux 2.0+

• Mac OS X• NetBSD• Novell Netware 6.5+• OpenBSD• QNX• SGI Irix 6.x • Solaris (SPARC, x86)• SunOS 4.x • Tru64 Unix • Windows 95, 98, Me, NT,

2000, XP, 2003

September 2004 | MySQL® Overview | www.mysql.com 25

Supported Development ToolsC API based• PHP • Perl• ODBC• C • C++• Python • Ruby• Tcl • Eiffel• Lasso• Common LISP• Cobol

Other• Java (Connector/J)• .NET

Through ODBC• VB, VBA• Word, Excel, Access• Delphi• ASP• ADO• .NET

September 2004 | MySQL® Overview | www.mysql.com 26

Standards

• What standards does MySQL follow?– Entry Level SQL-92– ODBC Level 0-3.51– JDBC Type IV Driver– JDBC Spec 3.0 to fullest MySQL capabilities

• Goals– Full SQL-99 compliance– Adopt new upcoming SQL-2003 specification

September 2004 | MySQL® Overview | www.mysql.com 27

Advanced Features

• Advanced features MySQL supports– Multiple storage engines– NDB Cluster– Replication– Embeddable– Internationalization– Fulltext searching– Spatial Data

• Lets discuss each of the above in a bit more detail

September 2004 | MySQL® Overview | www.mysql.com 28

Replicationwww.mysql.com/replication

• Details– Very easy to setup and configure– Very light-weight on network– Implemented as master-slave– Asynchronous logical replication

• Why?– Allows for virtually unlimited scalability of read queries– Useful for hot standby/high availability– Load balancing

September 2004 | MySQL® Overview | www.mysql.com 29

Embeddable

• MySQL normally runs as a standalone daemon• Alternatively can be embedded

– MySQL + Your application = Single executable– Ability to be embedded in C or C++ programs– Footprint can vary

• Minimum about 4 MB RAM/ 4MB HDD• Depends on various factors

– Features required– Operating System– Libraries used

– Very easy to do, part of base C API

September 2004 | MySQL® Overview | www.mysql.com 30

Internationalizationwww.mysql.com/unicode

• Fully supported on many levels in 4.1• Prior to 4.1, declared on a server level• Able to declare both character set and collation (sorting

order)• Many levels where they are able to be set (server,

database, table, column)• Can mix them even in the same table

September 2004 | MySQL® Overview | www.mysql.com 31

Fulltext Searchwww.mysql.com/fulltext

• What?– Natural language matching technology– Given a string to match and it determines relevancy– Results sorted by relevancy– Allows boolean matching

• Why?– Very easy search engines– Much faster than freeform LIKE statements– Generally better results than LIKE

September 2004 | MySQL® Overview | www.mysql.com 32

Spatial Data Manipulationwww.mysql.com/gis

• What?– Added in MySQL 4.1– Enables ability to store geometry shapes such as point,

line, polygon, etc. in both WKT and WKB formats– Fully searchable using optimized R-Tree indexes

• Why?– Very useful for GIS applications– Useful for other applications as well

• Find all stores in a set radius

September 2004 | MySQL® Overview | www.mysql.com 33

The eWeek Database Benchmark

First ever fully independent benchmark

September 2004 | MySQL® Overview | www.mysql.com 34

eWeek Independent Benchmark• January 2002/Updated July

2003• According to eWeek, the

benchmark was the first independent full scale test of database management systems.

• Databases tested:– MySQL 4.0– Oracle 9i– IBM DB2 7.2– Microsoft SQL Server SP2– Sybase 12.5

September 2004 | MySQL® Overview | www.mysql.com 35

eWeek Latency Test● Response times of the

different databases

● It better to be at the bottom

● MySQL is the yellow line under the red Oracle line

The test was a virtual web bookstore with 50 Million books. It used a few large Windows servers and about 50 clients machines. Source code to the tests have been published!