Add a Table

A database called eventdb is automatically created for you during the installation of IBM® Db2® Event Store Enterprise Edition. This section describes how to add tables to that database.

About this task

Restriction: You can only have one database in IBM Db2 Event Store.
You can use the IBM Db2 Event Store end user client to manage and monitor your database. However, you must use the IBM Db2 Event Store APIs to insert data and to query the data in your database. For more information, see the following sections of the API:

Procedure

  1. Open the IBM Db2 Event Store web client.
    Remember: The URL has the format: https://ibm-nginx-svc/eventstore.
  2. Find the database in the My databases > View all databases page.
  3. Add your tables to the database:
    1. Go to the database tab and click Add table.
    2. On the Name page, specify the name of the table.
    3. On the Columns page, specify the columns that you want to include in the table.
      For each column, specify the name of the column, the data type, and whether the column can have a null value.
    4. On the Keys page, click Add key. Specify the primary keys for the table.
      A primary key is a value that is unique for each entry. It can be a single value, such as a transaction number, or a combination of values, such as a customer ID and a timestamp.
      Important: The primary keys cannot be a string.
    5. Specify a subset of the primary keys that you want to shard the database on.
    6. Click Create.
      Important: After you create a table, you cannot edit it.

Results

After you create your database tables, you can use the APIs to add data to the database and to query the data.

Additionally, you can use the Monitoring page to identify and troubleshoot issues with your database.