How to connect Matomo with own custom database

Hello All

First, thank you for the wonderful tool. It is really amazing and useful tool. I am using the on-premise version and have a question for which I couldn’t able to find relevant answers anywhere.
Question: Is it possible to connect Matomo with our own custom database and fetch information from that database and show data on the dashboard. I want to retrieve information from my own custom MySQL database and want to show data in a graph and also want to generate reports from that data in Matomo. Please help me to implement this functionality. I am not sure how to implement this in Matomo’s on-premise version. Looking forward to your prompt response.

Thank you.

From my understanding, it is like using Matomo with a third party tool.
Well, technically the answer is yes, as it is what the is doing, no?
Unfortunately I have no idea how it works behind the engine.