This chapter will introduce how to use DistSQL to manage resources and rules in a distributed database.
Introduction #
We will here use MySQL as example, but the same can be applicable to other databases.
- Start the MySQL service.
- Create to be registered MySQL databases.
- Create role and user in MySQL with creation permission for DBPlusEngine-Proxy.
- Start Zookeeper service.
- Add
mode
andauthentication
configurations toserver.yaml
. - Start DBPlusEngine-Proxy.
- Use SDK or terminal connect to DBPlusEngine-Proxy.
Create Logic Database #
- Create logic database
CREATE DATABASE foo_db;
- Use newly created logic database
USE foo_db;
Resource Operation #
For more details please see concentrate rule examples.
Rule Operation #
For more details please see concentrate rule examples.
Notice #
- Currently,
DROP DATABASE
will only remove thelogical distributed database
, not the user’s actual database. DROP TABLE
will delete all logical fragmented tables and actual tables in the database.CREATE DATABASE
will only create alogical distributed database
, so users need to create actual databases in advance.