19. Application
MySQL Connector / ODBCX DevAPI
X DevAPI
X DevAPI
SQL
result
MySQL
Storage
Optimizer
MySQL
connection
handling
X Plugin
Classic
MySQL protocolX protocol
20. Application
MySQL Connector / ODBC
MySQL Shell
Node.js Application
Windows Application
JavaScript / Python
MySQL C / Node.js
MySQL connector / Net
X DevAPI
X DevAPI
X DevAPI
SQL
result
MySQL
Storage
Optimizer
MySQL
connection
handlingX PluginX Plugin
Classic
MySQL protocolX protocol
23. List / Drop a
Collection
db.getCollections()
[
<Collection:items_table>,
<Collection:meetup_collection>
]
-- drop collection
db.dropCollection('meetup_collection')
db.getCollections()
[
<Collection:items_table>
]
24. A New
Document
with SQL:
insert into items_table values(‘phone’,21443,’blue’);
insert into items_table values(‘phone’,567734,’pink’);
with X DevAPI:
db.items_table.add({"name":"phone","price":21443,"color":"blue"}).
add({"name":"tablet","price":567734,"color":"pink"})
25. A New
Document
with SQL:
insert into items_table values(‘phone’,21443,’blue’);
insert into items_table values(‘phone’,567734,’pink’);
with X DevAPI:
db.items_table.add({"name":"phone","price":21443,"color":"blue"}).
add({"name":"tablet","price":567734,"color":"pink"})
//OR
db.items_table.add({"name":"phone","price":21443,"color":"blue"})
db.items_table.add({"name":"tablet","price":567734,"color":"pink"})
26. Find a
Document
with SQL:
select * from items_table where price > 25000;
with X DevAPI:
db.items_table.find("price>25000")
db.items_table.find("price>:param").bind(‘param’,’25000’)
27. Modify a
Document
with SQL:
update items_table set price=11111 where name = 'phone’;
with X DevAPI:
db.items_table.modify("name=phone").set("price","11111")
db.items_table.find("name='phone'")
{
"_id": "00005dc476b00000000000000009",
"name": "phone",
"color": "blue",
"price": 11111
}
39. Mysql InnoDB
cluster
Mysql replication
Primary election when the current
primary failure VS
Need to have a script or additional
infrastructure for automatic failover
Advances AdminAPI for administrative
purpose
No AdminAPI, regular commands
Easy to scale with innodb cluster requires some effort to scale
Not mature Solution Mature Solution
VS
40.
41. X DevAPI allows you
to work with MySQL
as a document store
(both relational and
schema-less data).
Takeaways
42. X DevAPI allows you
to work with MySQL
as a document store
(both relational and
schema-less data).
Takeaways
ProxySQL doesn’t
support it, but we got
around it with InnoDB
cluster.