Document Store in MySQL

As of MySQL 8.0.11, the X plugin is included in the installation by default . This plugin allows us to use MySQL as a NoSQL and much more using the X DevAPI .

 

So let’s take a look at the reasons to use NoSQL in MySQL. Probably the first reason that comes to mind is that in today’s application development, SQL (created in 1970) is simply a bit rigid. From my experience, I remember the hours spent at developer meetings, where they discussed what would happen if one new column was added to a table and where the code would have to be intervened everywhere.

Well, but why MySQL? Maybe because

The data uses InnoDB storage, so we can talk about full ACID compatibility . Data stored in the database, more precisely in collections, are in JSON format .

 

Enough theory, after all everything is clearly usa phone number data described in the documentation. Since each field brings with it new terminology, here is a simple table so we know what is what:

phone number data

 

Relational DB (SQL) Document (NoSQL)

connection session
database diagram
table collection
insert create
select find
update modify
delete remove

We will use MySQL Shell and the database from my previous article .

We will create a “blacklist” collection based on data the price also has a number of variables: from blocked IP addresses and insert JSON data obtained

 

 

 

Nice, right?

 

So now, for example, we decide to add an ip_range field to our collection so that we can block entire IP ranges if needed. In classic SQL, this would mean adding a cmo email list  column to the table, here only db.blackhole.modify() is used.

 

Scroll to Top