MySQL Technical Overview Mayuresh Nirhali Member Technical Staff Solaris RPE Mayuresh.Nirhali@Sun.COM 1
Agenda MySQL AB > Sun Microsystems Technology Stacks MySQL Server Architecture Pluggable Storage Engines Server Internals Administration and Enterprise Services High Availability Solutions MySQL Enterprise Scale Out Architectures Summary Q & A 2
MySQL AB Founded in 1995 Truly global company 6 million product installations 50,000 downloads each day Dramatically reduces TCO of database management Bundled by more than 100 SW and HW companies Sold by partners such as HP, Dell, Novell, and others Acquired by Sun Microsystems 3
Chosen by Successful, Modern Companies Embedded Batteries included database in software applications Network elements High Volume Web Sites Dynamic content ecommerce Gaming & entertainment Scale Out Enterprise Data Warehousing High Volume Transactions Departmental Intranet/Extranet Scale Out 4
MySQL Software Priorities Performan ce Reliability sfish Set New Records for Speed & Price/Performance in SPEC Benchmarks Ease of 15 Use Minute Rule Study found comparatively fewer bugs in MySQL* Up and running in 15 minutes Lower TCO * Robert Lemos CNET News.com Feb 4, 2005 5
Second Generation Open Source Vibrant Community + Strong Company Sun builds the product in house Community helps maintain the code quality Quid Pro Quo dual licensing for OEM/ISV market Cost effective commercial licenses for commercial use Open source GPL license for open source projects Annual MySQL Enterprise subscription for Enterprise, Web and OEM development/testing Per server annual subscription Includes support, MySQL Network Monitoring and Advisory Service, Knowledge Base, Monthly and Quarterly updates and Hotfixes MySQL Support Worldwide 24 x 7 support Training and certification Consulting 6
Popular Technology Stacks CoolStack/LAMP J2EE.NET Perl Jav a.net / C# MySQ L MySQ L MySQ L Apach e Linux or Solari s Apach e Tomc at JBoss Linux or Solari s IIS Apach e JBoss Windo ws 7
Supported Technology Platforms Programming Languages Perl Database Web & Application Server Internet Information Server Apache Tomcat Operating System HP-UX Hardware Storage 8
MySQL Scaling Vertical Scale Up Expensive SMP hardware Virtualise to run multiple MySQL instances. Horizontal Scale Out Commodity Intel / AMD Open source software 9
MySQL 5.0 Performance Reliability Ease of Use Stored Procedures Cluster query push down Query optimizations Archive Engine InnoDB storage improvements Faster Increased SQL Mode Triggers Views Precision Math Distributed Transactions Cluster object support Better Instance Manager Information Schema Cursors Enhanced GUI Tools Migration Toolkit Manageability 10
MySQL 5.1 Partitioning Row based Replication Online operations Event Scheduler XML & Xpath Support information_schema Improvements Mysqlslap New Upgrade Advisor (Enterprise) 11
MySQL Architecture 12
Pluggable Storage Engine Architecture MySQL supports several storage engines that act as handlers for different table types. Choose, create, or extend a storage engine that best suits your applications unique requirements. What is most important to you? Read Intensive Replication OLTP Online Backups Transactions Data Warehousing Performance Foreign Keys Scalability Small Footprint Level of Concurrency Row Level Locking Indexes Types Embedded Storage Utilization Table Level Locking High Availability Clustering 13
Pluggable Storage Engine Architecture Storage Engines are available on a per table basis Changing from one storage engine to another can be done via a simple SQL command: ALTER TABLE mytable ENGINE=MyISAM; Innodb MyISAM 14
Pluggable Storage Engine Architecture * s are supported, however, the partial rollback of a transaction is not supported. Cluster supports the READ_COMMITTED, REPEATABLE_READ, and SERIALIZAB 15
Fast Facts Storage Engines MyISAM Default MySQL engine No practical limits on data storage Very efficient storage Easily handles high speed data loads Has B tree, R tree, and Full text Indexes Supported by special index memory caches Offers compressed data option Supports geospatial operations Uses table level locks Does not do transactions Backup/point in time recovery supported Best Use Cases High traffic Web sites Data warehouses MySQL Server MyISAM 16
Fast Facts Storage Engines InnoDB Provides ACID transaction support 64TB data storage limit per tablespace Higher storage cost Slower data load speed than most other engines Offers MVCC/Snapshot read Has B tree and clustered indexes Supported by special data & index memory caches Provides foreign key support Does not offer compressed data option Uses row level locks and has custom isolation levels Has crash recovery Backup/point in time recovery supported Best Use Cases Online transaction processing applications MySQL Server Innodb 17
Fast Facts Storage Engines Cluster (NDB) Transaction support All data and index reside in main memory High data load speed Offers MVCC/Snapshot read Has B tree indexes Very fast primary key lookup capabilities Offers 99.999% uptime Shared nothing architecture Has high speed API for access as well as SQL API Online backup/point in time recovery supported MySQL Server Best Use Cases Highly available, always on/up applications Fast directory/key lookup applications Cluster (NDB) 18
Fast Facts Storage Engines Archive Provides automatic data compression Offers storage savings up to 80% No practical storage limit Fastest data load speed of any storage engine Offers MVCC/Snapshot read No index support Has special insert buffer for fast insert speed Only supports INSERT and SELECT operations Uses row level locks Backup/point in time recovery supported MySQL Server Best Use Cases Historical data warehouses Data archiving applications Data auditing Archive Archive 19
Fast Facts Storage Engines Federated Allows creation of one logical database from many physical Acts as pointer from one database to another target object No special middleware needed for remote data access Speed of operations depends on network/misc. factors Actions constrained by target engine object properties Security handled through federated table definition All SQL operations supported (as per target object) Best Use Cases Distributed database environments Data Mart environments MySQL Server Federated 20
Fast Facts Storage Engines Other Memory tables reside in RAM; data is lost on shutdown Memory tables support both B tree and hash indexes BDB tables offer transaction support with COMMIT/ROLLBACK Merge tables are collections of underlying MyISAM tables Merge tables offer one form of data partitioning Custom storage engines may be plugged into MySQL Best Use Cases Memory: fast lookups for data objects BDB: Online transaction processing Merge: Large databases with partitioned data Custom: special application situations MySQL Server Memory BDB Merge Custom 21
MySQL Architecture Connection Pool database activity, SQL operations, and more connections extremely fast. Especially good for high traffic web sites and other lik al coding per storage engine for particular needs. 22
MySQL Architecture SQL Support SQL Interface DML, DDL, Stored Procedures Views, Triggers, etc. ding SELECT, DML, DDL (CREATE, ALTER TABLE, etc.), stored procedures, trigger unctions, string handling, etc.) ns no special coding per storage engine for particular needs. 23
MySQL Architecture Parser/Optimizer Parser Query Translation, Object Privilege Optimizer Access Paths, Statistics ser s privileges on accessing database objects and executing SQL calls. ll SQL calls to internal database language. w best to service user s SQL request. ll storage engines, which means no special coding per storage engine for particular 24
MySQL Architecture Memory Caches and data information in memory for quick access. T statements and result sets, which can result in very fast response times and less ches for quickly referencing database metadata. gine, and user connection caches. 25
MySQL Architecture Admin & Tools Admin & Tools Administrator, Query Analyzer, Workbench,, Migration Toolkit, & Metadata ll storage engines tion, query browsing, database design, migration, metadata management, and more no special coding per storage engine for particular needs. 26
MySQL Architecture Enterprise Services Enterprise Services Replication, Cluster, Backup & Recovery, Security, MySQL Network uthentication, object privileges, data encryption/decryption, and more. ing backup & recovery, replication, clustering, and more. onitoring and Advisory Service, which means no special coding per storage engine for particular needs. 27
High Availability Solutions: Replication lity with Replicate a master/slave data from setup one MySQL server/storage engine combination to a different MySQL S ith the Perform master, you backups can switch using to a the slave server as a backup and continue to process updates on the master whi splitting Extremely the load simple for processing configuration queries to enable between very the robust master replication and slave sent Multiple to the slave replication to reduce topologies the query supported processing load of the master engines Application Master Slave 28
High Availability Solutions: MySQL Cluster hardware to accommodate the growth of users, Load traffic, balanced and data ce of failure ility d across nodes and always available ver High Performance Memory based storage engine Designed to handle thousands of requests per second Simplified Management Cluster management utilities Commodity components d workloads ite Applications MySQL Server Nodes Data Nodes Management Server & Client 29
MySQL Enterprise The best of both worlds Open Source Freedom and Software Protection Publicly Available MySQL Enterprise MySQL Software (community edition) Release early & often Bleeding edge Scripts/Manual Freeware Enterprise Class MySQL Software Monthly and Quarterly updates Update Advisor Technical Alert Advisor Knowledge Base Production Support Indemnification From the developers that built MySQL MySQL Network Monitoring and Advisory Service 30
MySQL Enterprise Technology Partners Support and Services Backup & Recovery High Availability & Clustering Content Management CRM ERP Management Migration ecommerce Tools Reporting Security Hardware & Infrastructure 31
Web Scale-Out Reference Architecture Internet Firewalls DNS Web Cache Proxies Web Servers Load Balancer Firewalls Master Failover Data Warehouse, Images, Multimedia Files, Backups Storage (NAS & SAN) Slaves, Read Only Load Balancer MySQL Databases Sessions & Caching 32
Data Warehouse Reference Architecture Applications Oracle Apps SAP PeopleSoft Siebel Dun & Bradstreet Etc. Databases MySQL Oracle SQL Server DB2 Teradata VSAM IMS IDMS ADABAS Flat Files XML Log Files B2B/B2C Source Servers Extranet ETL & Write Servers Read Servers Business Intelligence Load Balancer MySQL Servers Load Balancer MySQL Masters MySQL Slaves MySQL DBs: InnoDb, MyISAM, Cluster, Archive, etc Metadata Physical Disk Storage ODS DWH DM DM DM OLAP Operational Reporting Extranet & Internet 33
Summary Modern Companies Succeeding with MySQL Member of Vibrant Open Source Ecosystem Supports Many Popular Technology Stacks Enterprise Features Flexible and Open Server Architecture Pluggable Storage Engines Administrative Tools and Enterprise Services High Availability Solutions MySQL Enterprise 34
Thank You! Q & A Ask a question and get a Sun FOSS DVD and OpenSolaris CD!! Using MySQL / want to use MySQL? talk to me and get a key chain! Mayuresh Nirhali mayuresh@sun.com http://blogs.sun.com/wittyman 35