Skip to main content

Tutorial

This tutorial will guide you through the installation and configuration of WeSQL. In this series of tutorials, we will use containers to run WeSQL, as containers make the packaging and distribution of WeSQL very simple. Additionally, the containers include scripts to save manual operations.

If you're a hardcore enthusiast, you can try compiling WeSQL from source and running it using the compiled binaries. For that, refer to the section The Hardest Way.

We will go through a series of examples to demonstrate how to use WeSQL. The first two examples run on a single computer with Docker installed (desktop, laptop, or EC2), while the third example runs on multiple servers in AWS.

  • The first example installs one WeSQL-Server container and one WeScale on your local machine using Docker. You will then connect to WeSQL-Server and WeScale using a MySQL client to execute some SQL queries. And the data you write to the MySQL running on your local machine will be persisted to AWS S3! Isn't that amazing? And you can explore the features of WeScale.

  • The second example installs three WeSQL-Server containers on your local machine using Docker (this is for simplicity! You can absolutely use three EC2 instances to follow this tutorial). One is the data node, and the other two are logger nodes. And we use Docker's bridge network to assign three different IPs to them. In this experiment, we will demonstrate that by killing any one container (whether it's the data node or a logger node), clearing its data, and then recreating the container and connecting it to S3, the system will recover, and the database will still remain intact!

  • The third example runs WeSQL on AWS EKS. You will need an EKS cluster with at least three nodes. In this example, we will showcase WeSQL’s serverless capabilities. Currently, WeSQL’s serverless functionality relies on Kubernetes. For more information, refer to the Serverless technical documentation.