Explore Sample Data with Data Tools

  • tutorial
    Use Couchbase Capella’s Data Tools to explore and work with your data.

    Your trial database comes with a sample dataset. You can use this data to try out Capella’s Data Tools.

    To start exploring your data, you can:

    View and Edit Documents with the Documents Viewer

    Documents in Capella are grouped through buckets. You can add scopes and collections to a bucket to group related documents together.

    For more information about buckets, scopes, and collections, see Data Service.

    To view and edit a document in your database:

    1. Do one of the following:

      1. From the Start page, click Query Sample Data.

      2. Go to Data Tools.

    2. Go to Documents.

    3. In the Collection list, set the collection to airport.

    4. In the Limit field, enter 8.

    5. Click airport_1261.

    6. In the Document pane, change the airport’s city from "Amiens" to "Rouen".

    7. Click Save.

    The document airport_1261 now has its city set to "Rouen".

    Run Your First Query with the Query Workbench

    To run your first query:

    1. Do one of the following:

      1. From the Start page, click Query Sample Data.

      2. Go to Data Tools  Query.

    2. In the Query Editor, paste the following query:

      SELECT route.airlineid, airline.name, route.sourceairport, route.destinationairport
      FROM `travel-sample` route
      INNER JOIN `travel-sample` airline
      ON route.airlineid = META(airline).id
      WHERE route.type = "route"
      AND route.destinationairport = "SFO"
      ORDER BY route.sourceairport;
    3. Press Enter or click Execute.

      The results from the query are displayed in JSON format.

    To view how Capella executed the query in a graphical format, select the Plan tab.

    The Query Workbench shows a data-flow diagram with query operators. The initial scans display on the right, and the final output of the query displays on the left.

    The Query Workbench highlights any operators that might use a lot of resources. For example, in this query, the Fetch operator takes almost 90% of the total time spent on the query.

    For more information about how to use the Query Workbench, see Query Workbench.

    Speed Up Your Query with an Index

    You can use the Index Service to improve query performance:

    1. With the same query in the Query Editor, click Advise.

    2. In the query results, copy the recommended CREATE INDEX command from the index_statement attribute without the quotation marks:

      The Couchbase Capella Query Workbench. The Advise results are shown for the previous sample query. The
    3. Replace the query in the Query Editor with the CREATE INDEX command.

    4. To create the index, click Execute.

    5. Click History.

    6. To load the original query back into the Query Editor, in the list of queries, click the SELECT query.

    7. To run the query again, click Execute.

    With the index, the query execution time changes from around 172ms to 24ms.

    For more information about indexes in Capella, see Index Service.

    Next Steps

    After you query sample data, you can Explore the SDK Playground to see how to access your data with the Couchbase SDKs.

    If you want to connect to your database:

    1. Generate database credentials to securely connect and control access to your database. For more information, see Configure Database Credentials

    2. Add your current IP address as an allowed IP for your database. For more information, see Configure Allowed IP Addresses

    3. Choose and install a Couchbase SDK

    4. (Optional) Download the security certificate for your database and add it to your application’s server machine or IDE:

      1. From the Start page, go to Settings  Security Certificate.

      2. Click Download.