Distributed Relational Database Service Quick Start

advertisement
Distributed Relational Database Service
Quick Start
Distributed Relational Database Service/Quick Start
Quick Start
Console operation
The general development process of DRDS is to create a DRDS database by selecting a group of RDSs
from the console, create tables and indexes on the console, and then execute function development
and testing after connecting DRDS through a program or command line. Later we connect DRDS for
data maintenance by maintaining the list structure and index generally on the operation platform.
Other advanced functions such as duplication of short table and smooth expansion will be operated
correspondingly on the console, while currently the operations of backup, binlog maintenance and
other relevant operations need log on the rds console.
Enter into the DRDS console (https://drds.console.aliyun.com) and get to init it.
DRDS operation
Application of DRDS
DRDS is a server product. Its access mode is completely same as MySQL database for it is 100%
compatible with MySQL in the protocol. The access mode between MySQL client and Java language is
demonstrated as follows.
1. Application of MySQL client
mysql -h${DRDS_IP_ADDRESS} -P${DRDS_PORT} -u${user} -p${password} -D${DRDS_DBNAME}
DRDS_IP_ADDRESS, DRDS_PORT and DRDS_APPNAME are IP address, port and Libname provided by
DRDS respectively. The user and password are the external access username and password of DRDS
2.Application of the MySQL driver of Java language
Class.forName("com.mysql.jdbc.Driver");
Connection conn =
DriverManager.getConnection("jdbc:mysql://127.0.0.1:123456/sample_schema",
"sample_user", "sample_password");
...
conn.close();
1
Distributed Relational Database Service/Quick Start
For all kinds of languages, such as C, C++, Ruby, Python, Perl and PHP, use their MySQL driver/client
respectively to access to DRDS, and tested by Ali, DRDS is fully compatible with these clients.
SQL supported by DRDS
DRDS supports most MySQL syntax including SHOW DATABASES, SHOW TABLES and USE
${database}, and all kinds of statements including SELECT, UPDATE, INSERT, REPLACE, DELETE, SHOW,
QUIT and limited control commands nearly have no limitation, but considering performance, we will
provide some special optimization ways for the distributed system, including duplication of short
table and distributed index. To obtain the application scenarios and methods of the special
optimization ways, please refer to our console.
SET command support
The supported SET command parameters are AUTOCOMMIT, AUTOCOMMIT,
TX_READ_UNCOMMITTED, TX_READ_COMMITTED, TX_REPEATED_READ, TX_SERIALIZABLE, NAMES,
CHARACTER_SET_CLIENT, CHARACTER_SET_CONNECTION, CHARACTER_SET_RESULTS and
SQL_MODE.
Show the execution plan
EXPLAIN SELECT, UPDATE and DELETE can show the execution plans of the SQLs on the DRDS.
Browse database
SHOW DATABASES, SHOW TABLES and USE ${database}.
Datatable structure
DESC ${table}, SHOW CREATE TABLE ${table}.
Involved transaction
Support commands like START TRANSACTION, BEGIN and SAVEPOINT. The operations across the
nodes are not supported by default.
DML support
Support the common syntax like SELECT, UPDATE, INSERT, REPLACE and DELETE.
Others
Support importing data through LOAD DATA INFILE command in the case of single database and
single table. At present, KILL_QUERY command is not supported.
2
Download