WeScale is an open-source database proxy built with application developers in mind. It aims to simplify and enhance the
interaction between your application and the database, making development more efficient and enjoyable.
While databases have evolved to include complex and common application requirements like transactions and indexing,
modern applications have a growing set of shared needs that aren’t suitable or haven’t yet been integrated into the database layer.
This gap has led to the rise of various database middleware solutions such as
client-side connection pools, SQL retry libraries, online DDL tools, and more.
As a database proxy, WeScale serves as a crucial bridge between the application layer and the database layer.
It leans towards the application side, offering features specifically designed to simplify the developer experience.
- To Get Started On Your Local Machine with WeScale, simply clone the repository and follow the installation instructions provided in the documentation.
- To Deploy WeScale on Kubernetes, you can use the powerful Kubeblocks Operator to quickly launch a WeScale cluster in a Kubernetes cluster. We recommend this method for production environments.
To Start WeScale with Docker, you can simply run the following command:
docker network create wescale-network
docker run -itd --network wescale-network --name mysql-server \
-p 3306:3306 \
-e MYSQL_ROOT_PASSWORD=passwd \
-e MYSQL_ROOT_HOST=% \
-e MYSQL_LOG_CONSOLE=true \
mysql/mysql-server:8.0.32 \
--bind-address=0.0.0.0 \
--port=3306 \
--log-bin=binlog \
--gtid_mode=ON \
--enforce_gtid_consistency=ON \
--log_replica_updates=ON \
--binlog_format=ROW
docker run -itd --network wescale-network --name wescale \
-p 15306:15306 \
-w /vt/examples/wesql-server \
-e MYSQL_ROOT_USER=root \
-e MYSQL_ROOT_PASSWORD=passwd \
-e MYSQL_PORT=3306 \
-e MYSQL_HOST=mysql-server \
apecloud/apecloud-mysql-scale:0.3.8 \
/vt/examples/wesql-server/init_single_node_cluster.sh
Now you can connect to WeScale and the original MySQL server:
# Connect to WeScale
mysql -h127.0.0.1 -uroot -ppasswd -P15306
# You can still connect to the original MySQL server
mysql -h127.0.0.1 -uroot -ppasswd -P3306
Try out Declarative DDL:
SET @@enable_declarative_ddl=true;
CREATE DATABASE if not exists test;
USE test;
CREATE TABLE if not exists test_table (
id int primary key,
name varchar(255)
);
SHOW CREATE TABLE test_table;
CREATE TABLE if not exists test_table (
id int primary key,
name varchar(255),
email varchar(255),
profile varchar(255),
index (name, email)
);
SHOW CREATE TABLE test_table;
Clean up the containers:
docker rm -f mysql-server wescale
docker network rm wescale-network
Join our Discord to discuss features, get help, and connect with other users.
- Declarative-DDL.md
- OnlineDDL.md
- Transaction Chopping.md
- Filters
- Write a Wasm Plugin In WeScale
- Branch
- Show Tablets Query Plans
- Transparent Failover.md
- Authentication & Authorization.md
- Read-Write-Split & LoadBalancer.md
- Read-After-Write-Consistency.md
- Architecture.md
- Life of A Query.md
- Introduction To WeScale.md
- Dive into Read-Write-Splitting of WeScale.md
- Performance Comparison WeScale vs MySQL.md
- Execution Process of DROP TABLE in OnlineDDL Mode.md
- Scaling-database-connections.md
Once you have WeScale up and running, you can monitor the cluster using prometheus and grafana.
cd ./examples/metrics && ./start_dashboard.sh
Open your browser and navigate to http://localhost:3000/dashboards
to view the dashboard.
We welcome contributions to WeScale! If you have any ideas, bug reports, or feature requests, please feel free to open an issue or submit a pull request.
WeScale is released under the Apache 2.0 License.
WeScale is a fork of the Vitess project, which is a database clustering system for horizontal scaling of MySQL. We would like to thank the Vitess team for their hard work.