Skip to main content

Get started

This guide will help you get started with RisingWave. We will cover:

Install and run RisingWave

You can run RisingWave in three ways:

  • Use the pre-built library (only for Linux)
  • Install and run from a Docker image (Linux & macOS)
  • Build from the source code (Linux & macOS)

Use the pre-built library (Linux)

  1. Download the pre-built library.

  2. Unzip the library.

    tar xvf risingwave-v0.1.9-x86_64-unknown-linux.tar.gz
  3. Run RisingWave.

    ./risingwave playground

    RisingWave is now started.

Install and run from a Docker image (Linux & macOS)

You can install and run RisingWave from a Docker image. Currently, only x86-64 platforms are supported.

Ensure you have Docker intalled on your machine. For installation instructions, see Install Docker.

  1. Download the docker container image of the latest nightly build of RisingWave.

    docker pull
  2. Run RisingWave from the Docker image.

    docker run -it --network host playground

Build from source (Linux & macOS)

  1. Download the source code of RisingWave.

    git clone
  2. Install dependencies.

    RisingWave has the following dependencies. Please ensure all the dependencies have been installed before running RisingWave.

    • Rust
    • CMake
    • Protocol Buffers
    • OpenSSL
    • PostgreSQL terminal (14.1 or higher)
    • Tmux

    Select your operating system and run the following commands to install the dependencies.

brew install postgresql cmake protobuf openssl tmux

Run one of the following cammands to install rustup:

curl --proto '=https' --tlsv1.2 -sSf | sh


brew install rustup-init && rustup-init
  1. Run RisingWave.

    To run RisingWave, in the terminal, navigate to the directory where RisingWave is downloaded, and run the following command.

    ./risedev playground

    All services in RisingWave will be started.

Connect to RisingWave

After RisingWave is started, you can connect to it via the Postgres interactive terminal psql.

psql -h localhost -p 4566 -d dev -U root

You can now issue SQL queries to manage your streams and data.

Connect to a streaming source

Use the CREATE SOURCE command to connect RisingWave to a streaming source.

To connect to a Kafka topic:

with (
[ROW SCHEMA LOCATION 's3://path'];

For supported streaming sources and sample SQL statements, see CREATE SOURCE.

Query and manage data

RisingWave uses Postgres-compatible SQL as the interface to manage and query data.

Before we start, ensure that you have connected to RisingWave via psql.

Now let us create a table to store data about taxi trips.

CREATE TABLE taxi_trips(

We want to create a materialized view to dynamically calculate the average speed of all trips.

SELECT COUNT(id) as no_of_trips,
SUM(distance) as total_distance,
SUM(duration) as total_duration,
SUM(distance) / SUM(duration) as avg_speed
FROM taxi_trips;

Now let us add some data to the table.

INSERT INTO taxi_trips
('1', 4, 10);

We can now query the average speed.

SELECT * FROM mv_avg_speed;

Here is the result we get.

 no_of_trips | total_distance | total_duration | avg_speed      
1 | 5 | 10 | 0.4

Now let us add a new record.

INSERT INTO taxi_trips
('2', 6, 10);

As soon as we insert the new record, the materialied view mv_avg_speed will be refreshed to re-calculate the results. Let us see if the results are updated.

SELECT * FROM mv_avg_speed;

Here is the result we get.

 no_of_trips | total_distance | total_duration | avg_speed      
2 | 10 | 20 | 0.5

You can see that the results are based on the two rows of data. The calculation is performed automatically behind the scene. No matter how many more rows of data we insert, we can always get the latest results by querying the values of the materialized view.

Creating a materialized view from a source is similar.

To create a materialized view from a source:
CREATE MATERIALIZED VIEW debezium_json_mysql_mv 
SELECT COLUMN1, COLUMN2, COLUMN3 FROM debezium_json_mysql_source;

With RisingWave, you can also create a materialized view from an existing materialized view.

To create a materialized view from existing materialized views:
SELECT m1.v1 as m1v1, m1.v2 as m1v2, m2.v1, m2.v2
INNER JOIN m2 ON m1.v1 = m2.v1;

For the complete list of supported SQL commands, please navigate to SQL reference → Commands.

Help us make this doc better!