Skip to content

5-minute quickstart

Get up and running with Tiger Cloud in 5 minutes

On this page, you will create a Tiger Cloud service, connect to it, create your first hypertable, and run a query. By the end you’ll have a working time-series table and see query results, all in under 5 minutes.

For a more extensive lesson on what hypertables are and why they matter, see Your first hypertable.

Prerequisites for this tutorial

To follow the procedure on this page, you'll need:

  1. Create a service

    In Tiger Console, click New service > Real-time analytics. Choose any provider, region, and compute size. Select a development environment with no replicas and no power-ups.

  2. Wait for the service to be ready

    Click Create service. The service is ready in a few seconds.

  3. Download the database config

    Download the database config and store it somewhere safe, you’ll need the connection string to connect to your service.

For more detail, see Create a Tiger Cloud service.

Pick one way to run SQL:

  • Tiger Console (easiest): In Tiger Console, open your service, then use Data view at the top or SQL Editor at the bottom. You’re connected as soon as you see the query panel.
  • psql: From your terminal, run psql "<your-service-url>" using the connection string from the config file you downloaded.

Run this to confirm you’re connected:

SELECT CURRENT_DATE;

You should see today’s date. If you do, you’re ready for the next step. For connection options, including other clients, see Connect your app.

Step 3: Create your first hypertable and run a query

Section titled “Step 3: Create your first hypertable and run a query”

We’ll create a small hypertable (a table optimized for time-series data), insert a few rows, and query them. You’ll use standard SQL; the database handles partitioning automatically.

  1. Create the hypertable

    Run this in Tiger Console or your SQL client:

    CREATE TABLE conditions (
    time TIMESTAMPTZ NOT NULL,
    location TEXT NOT NULL,
    device TEXT NOT NULL,
    temperature DOUBLE PRECISION NULL,
    humidity DOUBLE PRECISION NULL
    ) WITH (
    tsdb.hypertable,
    tsdb.segmentby = 'device',
    tsdb.orderby = 'time DESC'
    );

    You should see a confirmation that the table was created. The tsdb.hypertable option makes this a hypertable partitioned by time.

  2. Insert sample data
    INSERT INTO conditions (time, location, device, temperature, humidity)
    VALUES
    (NOW() - INTERVAL '2 hours', 'office', 'sensor-1', 22.1, 45.0),
    (NOW() - INTERVAL '1 hour', 'office', 'sensor-1', 22.3, 44.8),
    (NOW(), 'office', 'sensor-1', 22.2, 45.1);
  3. Query the data
    SELECT * FROM conditions ORDER BY time DESC;

    You should see your three rows with the most recent first. You’ve just created a hypertable, inserted time-series data, and queried it, all with standard SQL.

Tips

What just happened? The table is partitioned by time into chunks behind the scenes. You didn’t have to manage chunks; you just used the table. For the full picture, see Your first hypertable.