mysql's nosql -- best of both worlds on the same disks
DESCRIPTION
Get the best of both worlds -- SQL access and NoSQL access to the same data using the Memcached protocol. 9x faster than regular SQL, the Memcached protocol use allows applications to drink from the fire hose. Plus now your cache can be stored permanently. Easy and simple to implement.TRANSCRIPT
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.1
➔ Dave Stokes➔ MySQL Community Manager
➔ [email protected] @Stoker
MySQL's NoSQL with SQL – Best of Both Worlds
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.2
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
decision. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole
discretion of Oracle.
Safe Harbor Statement
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.3
MySQL Releases since 2010
• Enterprise Monitor 2.2, 2.3• Cluster 7.1, 7.2, 7.3• Cluster Manager 1, 1.1, 1.3• Workbench 5.2, 6, 6.1• Database 5.5, 5.6, DMR 5.7• Backup 3.5, 3.7, 3.1• Oracle VM for MySQL• Oracle Product Certifications• Windows Installer • Utilities 1.0.6• Audit• Fabric (RC)
● More Developers
● More QA
● More Support
● Making $$
● Classes popular
– Instructor lead
– Self-paced
● We're hiring!
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.4
MySQL 5.6 GA 19 Months Ago – Best GA Ever
● Performance
– Scales to 48 CPU threads
– Up to 230% faster than 5.5
● Faster Optimizer
– Performance
– Diagnostics
– Better Instrumentation● Improved Replication
● NoSQL
– Fast – 9x
– Key/value, ACID
● InnoDB
– Better Transactional throughput
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.5
MySQL Architecture
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.6
Bypassing Syntax Check and Optimizer 9x Faster
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.7
Handler Socket DeNA circa 2010
● Bypasses Optimizer & Parser
● Very Fast
● Limited Security
● Not ACID
● 750,000 accesses second
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.8
Memcached w/InnoDB – a better way
● Runs in same process space, fast –1,140,000 accesses/second
● Data can be structure or unstructured
● InnoDB handles composing/decomposing data as part of multi column support which cuts string handling in your application
● Crash safe and consistent data
● Can tune data passing between InnoDB/Memecached, transaction levels, lock metadata (no DDL while in use)
● Can password protect Memcached via SASL
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.9
Installation
● sudo apt-get install libevent-dev libmemcached-tools
● Memcached.so (already in 5.6/7)
– my.cnf
● plugin-load=libmemcached.so
– Or after boot
● mysql> install plugin daemon_memcached soname "libmemcached.so";
● Check your ulimit (Look for failed to set rlimit for open files in logs)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.10
Installation continues
● Set up configuration tables
– innodb_memcached_config.sql
● Creates innodb_memcached schema– cache_policies
– config_options
– Containers
● Test example
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.11
Test from Memcached side
● telnet 127.0.0.1 11211● set a11 10 0 9● 123456789● STORED● get a11● VALUE a11 0 9● 123456789● END● quit
The arguments to set are
– a11 is the key
– 10 is the flag to use
– 0 is the TTL
– 9 is the length of the string to store
– 123456789 is the string to store
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.12
Test from SQL side
c1 c2 c3 c4 c6
a11 123456789 10 3 0
Data is available through both Memcached & SQL at the same time
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.13
Options you can set
● Separator and table_map_delimiter (config_options)
● Policies (cache_policies)
– Use memcached, InnoDB (or NDB) for data store
● Name, schema, table name, key columns, value columns, flags, cas_column, expiration, index to use on key
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.14
Slide to check if audience is still awake
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.15
Best uses
● Persistent Memcached layer
● Speed
– Drinking or Filling fire hose
● Simple applications, APIs
● When you don't want to pay for servers/disks for NoSQL only
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.16
§ mysql.com- MySQL Products, Editions, Training, Consulting- TCO calculator- Customer use cases and success stories
§ dev.mysql.com- Downloads, Documentation- Forums
- Planet.MySQL.com§ eDelivery.oracle.com
- Download and evaluate all MySQL products
Learn More
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.17
MySQL Central @ Open World
✔ Part of Oracle Open World✔ Learn from the best
✔ MySQL Engineers✔ Customers
✔ Weekday event
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.18
Q&A
[email protected]@stokerslideshare.net/davestokes