3. SkySQL
•Leading provider of open
source databases, services and
solutions
•Home for the founders and the
original developers of the core
of MySQL
•The creators of MariaDB, the
drop-off, innovative
replacement of MySQL
Friday, 3 May 13
6. PAGE
[Allegedly] Reasons to adopt NoSQL
•Not all the needs for a database
fit with the relational model
•Key/value stores?
•Who needsACID?
•Who needs schemas?
•Relational databases cannot
handle many modern workloads
•Scalability is an issue in general
•RDBMSs are pretty inflexible
•There is no elasticity
•Schemas and administration is
too complicated, especially
during the development phase
•SQL is unnecessarily complicated
•NOSQL = Not Only SQL
6
Friday, 3 May 13
7. PAGE
NoSQL vs SQL
7
NoSQL
•Schema-less (or dynamic schema)
•Dynamic horizontal scaling
•Good to store and retrieve a great quantity of
data
•Great Flexibility
•FullACID not required - “BASE is better”
•BasicallyAvailable, Soft state, Eventually
consistent
•Objects: Collections, Documents, Fields
•NoSQL DBs:
•Key/Value
•BigTable
•Document
•Graph
(My)SQL
•Rigid Schema design
•Static or no horizontal scaling
•Good to store and retrieve data that has
relationship between the elements
•Pretty inflexible
•ACID as a given
•Atomic, Consistent, Isolated, Durable
•Objects: Tables, Rows, Columns
•SQL DBs:
•Row-based
•Columnar
•Object Relational
Friday, 3 May 13
8. PAGE
Understanding the CAP Theorem
•CA
•Synchronous Replication
•Two Phase Commit
•MySQL,ACID/RDBMSs
•CP
•MongoDB, HBase, Redis, MemcacheD
•AP
•Cassandra, Riak, CouchDB
8
C A
P
Friday, 3 May 13
12. PAGE
When is MySQL a good fit?
•Complex (but well defined)
schema
•ACID and Consistency as a must
•Interaction/Integration with
tools and applications that speak
MySQL
•Typically “simple” data
•Data “limited” in size
•Application-based scalability
•Applications require “complex”
queries (read: joins)
•Many developers / Few DBs
•In-house expertise
12
Friday, 3 May 13
13. PAGE
When is NoSQL a good fit?
•Schema-less for startup
applications
•Performance is more important
than consistency andACID
features
•Documents, binary data and
more
•Lots of data, unstructured
•Scalability and elasticity out of
the box will solve lots of
problems
•Applications mainly have
“simple” queries (read: access
to single tables, by key or simple
conditions)
•One man job (for each module)
13
Friday, 3 May 13
27. PAGE
Cassandra Storage Engine
•Column Family == Table
•Rowkey, static and dynamic
columns allowed
•Batch key access support
SET cassandra_default_thrift_host =
'192.168.0.10'
CREATE TABLE cassandra_tbl (
rowkey INT PRIMARY KEY,
col1 VARCHAR(25),
col2 BIGINT,
dyn_cols BLOB DYNAMIC_COLUMN_STORAGE = yes )
ENGINE = cassandra
KEYSPACE = 'cassandra_key_space'
COLUMN_FAMILY = 'column_family_name';
27
Friday, 3 May 13
28. PAGE
Connect Storage Engine
•Any file format as MySQLTABLE:
•ODBC
•Text, XML, *ML
•Excel,Access etc.
•MariaDB CREATE TABLE options
•Multi-file table
•TableAutocreation
•Condition push down
•Read/Write and Multi Storage Engine Join
•CREATE INDEX
28
CREATE TABLE handout
ENGINE = CONNECT
TABLE_TYPE = XML
FILE_NAME = 'handout.htm'
HEADER = yes OPTION_LIST =
'name = TABLE,
coltype = HTML,
attribute =
(border=1;cellpadding=5)';
Friday, 3 May 13
29. PAGE
Join us at the Solutions Day
•Cassandra and Connect Storage Engine
•Map/Reduce approach - Proxy optimisation
•Multiple protocols and more
29
Friday, 3 May 13