
MYSQL & NOSQL: THE BEST OF BOTH WORLDS Ted Wennmark Principal System Consultant, MySQL 1 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. MySQL & NoSQL: The Best of Both Worlds Ted Wennmark Principal System Consultant MySQL 2 Copyright © 2012, Oracle and/or its affiliates. All rights [email protected] Safe Harbour Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. 3 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. History of MySQL I . 2001 MySQL 3.23 GA – our first GA release ever! . 2005 Oracle Corporation acquired Innobase OY . 2008 Sun acquired MySQL AB for $1 billion . 2010 Oracle acquired Sun on 27 January . 2010 MySQL 5.5 first Oracle release, great feedback from community! . 2012 MySQL 5.6 “Best release ever“ 4 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. History of MySQL II . World’s Most Popular Open Source Database . Over 12 million product installations . 65,000 downloads/day . The ”M” of the widely deployed LAMP stack . MySQL Commercial Editions Available 5 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. World wide use 6 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. World wide use “at night” 7 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Session Agenda • NoSQL – What are people looking for? • RDBMS – What advantages do they still have? • How MySQL Delivers the Best of Both Worlds – MySQL Cluster • NoSQL attributes: Scale-out, performance, ease-of-use, schema flexibility, on-line operations • NoSQL APIs – Key-Value store access to InnoDB (Memcached) • What is coming with future releases 8 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. What NoSQL must deliver • Massive scalability – No application-level sharding • Performance Scalability • High Availability/Fault Tolerance Performance • Ease of use HA – Simple operations/administration Ease of use – Simple APIs – Quickly evolve application & schema 9 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Still a role for the RDBMS? • No best single solution fits all • Mix and match NoSQL RDBMS Simple access patterns Complex queries with joins Scalability Performance Compromise on consistency ACID transactions for performance HA Ease of use Ad-hoc data format Well defined schemas SQL/Joins Simple operation Rich set of tools ACID Transactions 10 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. MySQL Cluster introduction 11 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. MySQL Cluster Architecture REST Scalability Application Nodes Performance HA Node Group 1 Node Group 2 Ease of use F1 F2 Cluster Cluster SQL/Joins a Mgr F3 F4 Mgr Node 1 Node Node 3 Node ACID Transactions a F3 F4 F1 F2 Node 2 Node Data 4 Node Nodes 12 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. MySQL Cluster: Extensive Choice of NoSQL APIs Mix & Match 13 Copyright © 2012, Oracle and/or its affiliates. All rights Copyright 2013, Oracle and/or its affiliates. All rights reserved. reserved. C++ example NdbOperation *op = trx->getNdbOperation(myTable); op->insertTuple(); op->equal("key", i); op->setValue("value", &value); trx->execute( NdbTransaction::Commit ); 14 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 1.2 Billion UPDATEs per Minute 25 20 15 10 Second 5 Millions of UPDATEs per UPDATEs of Millions 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 MySQL Cluster Data Nodes • NoSQL C++ API, flexaSynch benchmark • 30 x Intel E5-2600 Intel Servers, 2 socket, 64GB • ACID Transactions, with Synchronous Replication 15 Copyright © 2012, Oracle and/or its affiliates. All rights Copyright 2013, Oracle and/or its affiliates. All rights reserved. reserved. MySQL Cluster Architecture http://clusterdb.com/u/demo REST Scalability Application Nodes Performance HA a Node Group 1 Node Group 2 Ease of use F1 F2 Cluster Cluster SQL/Joins a Mgr F3 F4 Mgr Node 1 Node Node 3 Node ACID Transactions a F3 F4 F1 F2 Node 2 Node Data 4 Node Nodes 16 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Scale-Out: Auto-Partitioning Table T1 Data Node 1 P1 Data Node 2 P2 P3 Data Node 3 P4 Data Node 4 17 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Scale-Out: Auto-Partitioning Table T1 Data Node 1 F1 P1 Data Node 2 P2 P3 Data Node 3 P4 Data Node 4 18 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Scale-Out: Auto-Partitioning Table T1 Data Node 1 F1 P1 Data Node 2 P2 F1 P3 Data Node 3 P4 Data Node 4 19 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Scale-Out: Auto-Partitioning Table T1 Data Node 1 F1 P1 Data Node 2 P2 F3 F1 P3 Data Node 3 P4 Data Node 4 20 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Scale-Out: Auto-Partitioning Table T1 Data Node 1 F1 F3 P1 Data Node 2 P2 F3 F1 P3 Data Node 3 P4 Data Node 4 21 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Scale-Out: Auto-Partitioning Table T1 Data Node 1 F1 F3 P1 Node Group 1 Data Node 2 P2 F3 F1 P3 Data Node 3 F2 F4 P4 Node Group 2 Data Node 4 F4 F2 22 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Scale-Out: Auto-Partitioning Table T1 Data Node 1 F1 F3 P1 Node Group 1 Data Node 2 P2 F3 F1 P3 Data Node 3 F2 F4 P4 Node Group 2 Data Node 4 F4 F2 23 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Scale-Out: Auto-Partitioning Table T1 Scalability a P1 Performance P2 HA a P3 Ease of use SQL/Joins a P4 ACID Transactions a 24 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Scale-Out Reads & Writes on Commodity Hardware SELECT Queries per Minute 1 200 1 000 800 600 Millions 400 200 0 2 4 8 Number of Data Nodes • 8 x Commodity Intel Servers UPDATE Queries per Minute 120 – 2 x 6-core processors 2.93GHz 100 – x5670 processors (24 threads) 80 – 48GB RAM 60 Millions 40 • Infiniband networking 20 0 • flexAsynch benchmark (NDB API) 4 8 Number of Data Nodes 25 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Scalability a Performance a HA a Ease of use SQL/Joins a ACID Transactions a 26 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. On-line Schema changes On-Line Operations • Scale the cluster (add & remove nodes on-line) • Repartition tables • Upgrade / patch servers & OS • Upgrade / patch MySQL Cluster • Back-Up • Evolve the schema on-line, in real-time 27 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Foreign Key Support . Auto-Installer . Connection Thread Scalability . NoSQL JavaScript for . MySQL 5.6 node.js 28 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. MySQL Cluster 7.3: Auto-Installer • Fast configuration Specify Auto- Workload Discover • Auto-discovery • Workload optimized • Repeatable best practices • For MySQL Cluster Define Deploy 7.2 + 7.3 Topology 29 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Scalability a Performance a HA a Ease of use a SQL/Joins a ACID Transactions a 30 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. NoSQL Access to MySQL Cluster data Mix & Match! Same data accessed simultaneously through SQL & NoSQL interfaces 31 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. MySQL Cluster 7.1: ClusterJ/JPA • New Domain Object Model Persistence API (ClusterJ) : – Java API – High performance, low latency – Feature rich • JPA interface built upon this new Java layer: – Java Persistence API compliant • Implemented as an OpenJPA plugin – Uses ClusterJ where possible, reverts to JDBC for some operations – Higher performance than JDBC – More natural for most Java designers – Easier Cluster adoption for web applications 32 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Java Access Performance http://www.mysql.com/why-mysql/white-papers/mysql_wp_cluster_connector_for_java.php 33 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. NoSQL with Memcached (MySQL Cluster 7.2) • Memcached is a distributed memory based hash- key/value store with no persistence to disk • NoSQL, simple API, popular with developers • MySQL Cluster already provides scalable, in-memory performance with NoSQL (hashed) access as well as persistence – Provide the Memcached API but map to NDB API calls • Writes-in-place, so no need to invalidate cache • Simplifies architecture as caching & database integrated into 1 tier • Access data from existing relational tables 34 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Traditional Memcached Architecture • Two levels of hashing httpd memcached hash key PHP/Perl memcached to find data Memcache friends:12389 memcached memcache key 35 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Cache hit httpd hash key PHP/Perl memcached to find data Memcache friends:12389 VALUE friends:12389 0 31\r\n 101, 11009, 11150, 55881, 77798 \r\n 36 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Cache miss (1): fetch from DB httpd hash key PHP/Perl memcachedmemcache to find data Memcache mysql MySQL Slave 37 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Cache miss (2): manage cache httpd hash key PHP/Perl memcached to find data Memcache 38 Copyright © 2012, Oracle and/or its affiliates.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages59 Page
-
File Size-