A MySQL-compatible, high performance, elastic, distributed SQL database.
EloqSQL is a distributed SQL database designed to combine MySQL compatibility with the scalability and performance of modern distributed systems. Built on top of Data Substrate, it replaces traditional storage engines like InnoDB with a flexible, distributed and high-performance eloq engine: Transaction Service. It has distributed buffer pool and support Cassandra, ScyllaDB and DynamoDB as the underlying data store.
EloqSQL delivers full ACID transactions, elastic scaling, and efficient resource utilization, making it ideal for demanding workloads.
EloqSQL is forked from MariaDB, and inherit the parser, optimizer and executor from MariaDB to provide a MySQL compatibility. For the difference between MySQL and MariaDB, please refer to MySQL vs MariaDB.
Explore EloqSQL website for more details.
π Use Cases: Scalable web applications, e-commerce platforms, real-time data processing β anywhere you need MySQL compatibility but demand distributed performance and elasticity.
Seamlessly integrates with MySQL clients and tools, allowing you to leverage existing SQL workflows while benefiting from a distributed backend.
Supports multiple writers and distributed transactions, enabling high concurrency and fault tolerance across a cluster.
Independently scales CPU, memory, log, and storage resources. Scales out effortlessly without requiring data sharding, adapting to your workload dynamically.
Stores data in high-performance key-value engines like Cassandra, ScyllaDB, and DynamoDB, offering better disk compression ratios than InnoDB. Save up to 80% on disk storage costs compared to MySQL.
Supports object storage as tiered storage to reduce costs for cold data.
Leverages the scalable Transaction Service to keep hot data in memory, ensuring low-latency access. Scales the buffer pool dynamically as hot data growsβwithout moving data on disk.
Provides robust transaction support with Read Committed and Repeatable Read isolation levels, ensuring data consistency and reliability.
- Hot Data Management: Hot data resides in the in-memory
Transaction Service
, which scales independently to handle growing datasets efficiently. - Storage Tiering: Combines key-value stores for active data with cost-effective object storage, optimizing both performance and cost.
- No Sharding Required: Unlike traditional distributed databases, EloqSQL scales out naturally without the complexity of sharding.
EloqCtl is the cluster management tool for EloqSQL.
To deploy an EloqKV cluster in production, download EloqCtl and follow the deployment guide.
Download the EloqKV tarball from the EloqData website.
Follow the instruction guide to set up and run EloqSQL on your local machine.
Follow these steps to build and run EloqSQL from source.
We recommend using our Docker image with pre-installed dependencies for a quick build and run of EloqKV.
docker pull eloqdata/eloq-build-ubuntu2404:latest
Or, you can manually run the following script to install dependencies on your local machine (Ubuntu 24.04 example).
bash scripts/install_dependency_ubuntu2404.sh
Fetch the Transaction Service and its dependencies:
git submodule update --init --recursive
Configure and compile with optimized settings:
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=${HOME}/install \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DWITH_READLINE=1 \
-DPLUGIN_HANDLERSOCKET=NO \
-DPLUGIN_ROCKSDB=NO \
-DPLUGIN_ARIA=NO \
-DPLUGIN_ARCHIVE=NO \
-DPLUGIN_CVS=NO \
-DPLUGIN_FEDERATEDX=NO \
-DPLUGIN_TOKUDB=NO \
-DPLUGIN_MROONGA=NO \
-DPLUGIN_OQGRAPH=NO \
-DPLUGIN_CONNECT=NO \
-DPLUGIN_SPIDER=NO \
-DPLUGIN_SPHINX=NO \
-DPLUGIN_HEAP=NO \
-DPLUGIN_MYISAMMRG=NO \
-DPLUGIN_SEQUENCE=NO \
-DINSTALL_MYSQLTESTDIR= \
-DMYSQL_MAINTAINER_MODE=OFF \
-DWITH_SSL=system \
-DUSE_ONE_CASS_SHARD_ENABLED=off \
-DCOROUTINE_ENABLED=ON \
-DBRPC_WITH_GLOG=ON \
-DMARIA_WITH_GLOG=ON \
-DWITH_ASAN=OFF \
-DCMAKE_C_FLAGS_RELWITHDEBINFO="-O2 -g -DNDEBUG -DDBUG_OFF -fno-omit-frame-pointer -fno-strict-aliasing" \
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-O2 -g -DNDEBUG -DDBUG_OFF -fno-omit-frame-pointer -fno-strict-aliasing -felide-constructors -Wno-error" \
-DWITH_KV_STORAGE=CASSANDRA \
-DFORK_HM_PROCESS=OFF \
-DWITH_LOG_SERVICE=ON \
../
cmake --build . --config RelWithDebInfo -j
cmake --install . --config RelWithDebInfo
Download and start a local Cassandra instance:
wget https://archive.apache.org/dist/cassandra/4.1.8/apache-cassandra-4.1.8-bin.tar.gz
tar -zxvf apache-cassandra-4.1.8-bin.tar.gz
./apache-cassandra-4.1.8/bin/cassandra -f
# Wait for Cassandra to start, then verify with:
./apache-cassandra-4.1.8/bin/cqlsh localhost -u cassandra -p cassandra
Edit my-config.cnf with the following example settings:
[mariadb]
plugin_maturity=experimental
max_connections=500
skip-log-bin
thread_stack=16M
port=3316
socket=/tmp/mysqld3316.sock
plugin_load_add=ha_eloq
eloq
eloq_kv_storage=cass
eloq_cass_hosts=127.0.0.1
eloq_cass_user=cassandra
eloq_cass_password=cassandra
eloq_local_ip=127.0.0.1:8000
eloq_ip_list=127.0.0.1:8000
Initialize the database:
export INSTALL_DIR=${HOME}/install
export DATA_DIR=${HOME}/eloqdata
${INSTALL_DIR}/scripts/mysql_install_db --defaults-file=${HOME}/my-config.cnf \
--basedir=${INSTALL_DIR} \
--datadir=${DATA_DIR} \
--plugin-dir=${INSTALL_DIR}/lib/plugin
Launch the server:
cd install
${INSTALL_DIR}/bin/mysqld --defaults-file=${HOME}/my-config.cnf --datadir=${DATA_DIR}
Use a MySQL client to log in:
sudo ${INSTALL_DIR}/bin/mysql -u root -S /tmp/mysqld3316.sock
To deploy EloqSQL cluster, Please refer to EloqCtl.
Star This Repo β to Support Our Journey β Every Star Helps Us Reach More Developers!