Build a KPI Dashboard for your PlanetScale Database with Dashbase

Learn how to use Dashbase to build a KPI dashboard for your PlanetScale database, leveraging Dashbase's MySQL support and AI powered query engine.

PlanetScale
MySQL
Tutorial
Getting Started
Published: 03/01/2024|By: Dashbase Team
PlanetScale and Dashbase Logos

Dashbase is the perfect tool to build a KPI and Metrics dshboard for your PlanetScale database. In this tutorial, we will show you how to connect Dashbase to your PlanetScale database and build your first Dashboard visualizations.

If you are looking for a fast and easy way to understand the usage of your PlanetScale based app, measure your performance and track your KPIs, Dashbase is the right tool for you. You can use AI to quickly craft queries and create charts, build a beutiful dashboard and share it with your team.

What is PlanetScale

PlanetScale is a cloud based database platform that provides a fully managed, horizontally scalable, MySQL-compatible database service. It is built on top of Vitess, a database clustering system for horizontal scaling of MySQL. PlanetScale is a great choice for developers who want to build a scalable, cloud-native application without having to worry about the operational overhead of managing a database.

What is Dashbase

Dashbase is a modern observability platform that provides a powerful, AI-powered query engine and a beautiful dashboarding interface. It is designed to help developers and operators understand the performance of their applications and infrastructure, and to quickly identify and resolve issues. Dashbase supports a wide range of data sources, including MySQL, and provides a rich set of visualization tools to help you build beautiful dashboards.

Prerequisites

Before you begin, you will need the following:

  • A PlanetScale account and a working database. If you don't have a PlanetScale database, sign up to PlanetScale and create a new database.
  • A Dashbase account. If you don't have one, you can create a new account by following the instructions on the Dashbase signup page.

Step 1: Create a Read Only Account for your PlanetScale Database

You'll need to start off by creating a user name and password for your PlanetScale database that Dashbase will use to authenticate and connect to your database. You might already have an account with full privilages which you could use, but it's best practice to create a read only account for security reasons. Thankfully, PlanetScale makes this easy.

Simply log into your PlanetScale account, select the appropriate database and click the "Connect" button. Then you can choose "New Password" to create a new user. Give it any name you'd like (e.g. "dashbase") and set the Role to "Read Only". Then click "Create Password" and you're done. Keep this screen open, as it has all the information you need to connect to your database in the enxt step.

Step 2: Connect Dashbase to your PlanetScale Database

Next up, open up dashbase.ai/app and select the workspace you want to use. If you don't have a workspace yet, you can create a new one by clicking on the "Create Workspace" button. Inside the workspace, click the "Workspace Settings" button on the top right corner and find the data sources section. Click "Add Source" and fill in the connection details for your PlanetScale database.

Here are the details you'll need to fill in:

  • Name: A name for your connection. This can be anything you want, it's just for your reference.
  • Type: Select "MySQL" from the dropdown.
  • Host: This is the hostname of your PlanetScale database. You can find this in the connection string in the PlanetScale UI (the part after the @ - usually it's "aws.connect.psdb.cloud" for PlanetScale Databases).
  • Port: Put in 3306.
  • Username: This will be the username of the read only user you created in Step 1.
  • Password: This will be the password of the read only user you created in Step 1.
  • Database: This is the name of your PlanetScale database. You can see it in the conenction string in the PlanetScale UI (the part after the /).
  • Schemas: Same as your database name.

Once you've filled in all the details, click "Test Connection" to make sure everything is working. If it is, click "Save" to save the connection. You should now see your PlanetScale database listed as a data source in your workspace.

Step 3: Create your first Dashboard

That's it, you have successfully connected Dashbase to your PlanetScale database! Now you can start building your first dashboard. Click on the "Create Dashboard" button in the top right corner of the workspace to create your first dashboard.

Conclusion

In this tutorial, we showed you how to connect Dashbase to your PlanetScale database and build your first dashboard. We hope you found this tutorial helpful and that you are now able to build beautiful KPI dashboards for your PlanetScale databases. If you have any questions or need help, feel free to reach out to the Dashbase Team.