starrock realtime databse engine — mysql compatible 1 fe 3 be 1 docker compose
starrock realtime databse engine — mysql compatible 1 fe 3 be 1 docker compose

StarRocks Real-time Database Engine (MySQL Compatible) – 1 FE, 3 BE, Docker Compose

Overview

StarRocks is a high-performance, real-time analytical database engine designed for fast SQL queries on large-scale datasets. It is fully compatible with the MySQL protocol, allowing users to connect using standard MySQL clients, BI tools, and applications without changing existing workflows.


Architecture Components

1. Frontend (FE) – 1 Instance

The Frontend node acts as the control plane of the StarRocks cluster.

Responsibilities:

  • Accepts client connections through the MySQL protocol.
  • Parses and optimizes SQL queries.
  • Maintains cluster metadata and catalog information.
  • Coordinates query execution across Backend nodes.
  • Manages user authentication and permissions.

In this architecture, a single FE node serves as the cluster leader and query coordinator.


2. Backend (BE) – 3 Instances

The Backend nodes are responsible for storage and computation.

Responsibilities:

  • Store data partitions and replicas.
  • Execute query plans distributed by the FE.
  • Perform aggregation, filtering, joins, and analytics.
  • Return processed results to the FE.

Using three Backend nodes enables:

  • Parallel query execution
  • Higher throughput
  • Better scalability
  • Improved fault tolerance

3. MySQL Compatibility

StarRocks supports the MySQL wire protocol.

This means users can connect with:

  • MySQL Client
  • MySQL Workbench
  • DBeaver
  • JDBC/ODBC Drivers
  • Python Connectors
  • BI Platforms such as Tableau and Power BI

Example connection:

mysql -h localhost -P 9030 -u root

Default MySQL-compatible port:

9030

4. Docker Compose Deployment

The entire cluster can be deployed using a single Docker Compose file.

Benefits:

  • Easy installation and management
  • Consistent environments
  • Simplified upgrades
  • Rapid development and testing

Example deployment command:

docker compose up -d

Query Execution Flow

  1. A client sends a SQL query to the FE node.
  2. FE parses and optimizes the query.
  3. FE generates a distributed execution plan.
  4. The execution plan is sent to the three BE nodes.
  5. BE nodes process data in parallel.
  6. Results are aggregated and returned to the FE.
  7. FE sends the final result back to the client.

Key Advantages

Real-time Analytics
Process and analyze fresh data with low query latency.

Massively Parallel Processing (MPP)
Multiple Backend nodes execute queries simultaneously.

MySQL Compatible
No need to change existing applications or tools.

Horizontal Scalability
Add more BE nodes as data volume grows.

Cloud-Native Deployment
Easily deployed using Docker Compose or Kubernetes.

High Performance
Optimized for OLAP workloads, dashboards, and reporting systems.


Typical Use Cases

  • Business Intelligence (BI)
  • Real-time dashboards
  • Log analytics
  • E-commerce analytics
  • IoT telemetry analysis
  • Data warehouse modernization
  • Operational reporting