DEV Community

Solomon
Solomon

Posted on

From Managed Cloud DB to Dashboards: Connecting Aiven PostgreSQL with DBeaver, pgAdmin, and Power BI

In this article, I would like to walk you through the journey of storing data, querying data, and visualizing data in an organised and safe manner.
Starting with Aiven, which is a cloud data warehouse host; later on in the article, we will discuss why Aiven.

Secondly, there are DBeaver & pgAdmin; basically, these are command centers for managing, cleaning, and querying the data. The main difference between the two is that PgAdmin only supports PostgreSQL, while DBeaver supports multiple databases.

Lastly, Power BI is a powerful visualization tool used to display a range of visualizations to end users to support data-driven decision-making.

You might ask, "Why connect all these tools?"
The answer is simple: automation and synchronization. By bridging this stack, any changes made to the cloud database can be instantly pushed to the end users. A single click of the "Refresh" button in Power BI automatically updates all the visualizations with real-time data

SETTING UP AIVEN AND WHY AIVEN
The why
Aiven is a completely managed database as opposed to traditional Cloud Providers like AWS or Google Cloud, where you are trapped under their rules and their fluctuating utility bills.
I would want you to think of it like this:
You are a businessperson who wants to deliver goods in the most cost-effective and efficient way
What do you do?
You hire a world-class logistics company instead of buying your own delivery trucks; it gives you the same power to move your goods, but someone else handles all the maintenance, flat tires, and breakdowns for a predictable flat fee.

Basically, that's what Aiven does, but now with data and not goods.

The Setup

  1. Sign Up: Create an account on the Aiven Console.
  2. Deploy the Service: Click Create Project and then click Create Service, select PostgreSQL, and choose your underlying cloud provider and region.
  3. Launch: Pick your plan (in my case, I picked the free tier) and click deploy. Within minutes, your status will change to Running, as shown below

Connecting DBeaver to Aiven
Now that our cloud database is running, we need a command center to talk to it. Let’s start with DBeaver. Because DBeaver is a universal database manager, it handles the connection drivers for us automatically.

What do you do?
Open DBeaver and click on the Plug icon (New Database Connection) in the top left corner.

Select PostgreSQL from the list and click Next.
In the Main tab, fill in your connection details copied straight from your Aiven Console:
Host: Your Aiven host _
URL Port: _5432

Database: defaultdb
Username: avnadmin
Password: "Your secure Aiven password"

Click on the SSL tab at the top. Check the box for Use SSL. Next to Root certificate, browse your computer and select the ca.pem file you downloaded from Aiven. Click Test Connection.

DBeaver will download the drivers, and you will see a success message. Click Finish.

Connecting PGAdmin to Aiven

Next up is pgAdmin. Remember, pgAdmin is specifically built only for PostgreSQL, so its connection settings are tailored a bit differently.

What do you do?

  1. Open pgAdmin, right-click on Servers in the left sidebar, select Register, and click Server.

  2. In the General tab, give your connection a name.

  3. Move to the Connection tab and enter your Aiven details into the Host, Port, Maintenance Database defaultdb, Username, and Password fields.

  4. Move to the Parameters tab. Set the SSL mode dropdown to Require. Click the folder icon and upload your Aiven ca.pem file.

  5. Click Save. Your Aiven database will appear in the sidebar, ready for queries.

Hooking up Power BI to Aiven
Our database is managed and accessible; now it is time to bring the data to life for our end users.

What do you do?

  1. Open Power BI Desktop, go to the Home ribbon, click Get Data, and select PostgreSQL database.
  2. In the Server box, paste your Aiven Host string followed by a colon and the port (e.g., ://aivencloud.com). In the Database box, type defaultdb.

  3. Choose your Data Connectivity Mode:

    • Import: Copies a snapshot of the data into Power BI (faster for performance).
    • DirectQuery: Queries Aiven live every time someone clicks a visual.
  4. Click OK. A window will pop up asking for credentials. Select Database on the left menu, enter your avnadmin username and password, and click Connect.

  5. The Navigator window will open. Check the boxes next to the tables you want to visualize, click Load, and start dragging fields onto your canvas to build your dashboard!

Conclusion
By connecting Aiven, DBeaver, pgAdmin, and Power BI, you create a seamless pipeline. You can manage your backend structures universally in DBeaver, do deeper Postgres administration in pgAdmin, and serve fresh data to business decision-makers in Power BI with a single click of the refresh button.

Top comments (0)