Infrastructure
When you host your database with Kinsta, your projects run on Google Cloud Platform’s top-tier infrastructure. In this guide, we’ll dive a little into the details of our Database Hosting infrastructure. For more information about how this works with Kinsta’s Application Hosting, refer to Application Hosting Infrastructure.
MyKinsta add catabase
In MyKinsta, when you add a database, the database image is pushed to the Kubernetes cluster.
Kubernetes cluster
This is a virtual machine (VM) where multiple containers can run. The clusters are tuned to ensure the request from the artifact registry finds the right container, the containers are running, and they have the right resources.
Our Kubernetes infrastructure supports a multi-tenant setup, where each database runs in its own containerized environment. Network isolation and multi-layer virtualization ensure security and prevent unauthorized access between databases. This design provides you with a reliable and secure hosting platform, enabling you to focus on your core business while we handle the underlying infrastructure. We deploy at least one cluster per region, with the potential for additional clusters based on the number of databases in each region. This system ensures optimal resource allocation and scalability to meet the growing needs of our clients.
Requests
If you’re using an internal connection from an application hosted on Kinsta to a database hosted on Kinsta, when a visitor accesses the website for an application, it first accesses Cloudflare, which knows which cluster hosts the website. It then sends the access request to the correct cluster.
Currently, for Application and Database Hosting, Cloudflare includes the default firewall rules, DDoS protection, and other defaults.
Each cluster has a load balancer that receives the access request from Cloudflare and randomly pushes a VM worker node.
The VM worker node receives the request on the Ingress system, which knows which container is responsible for the hostname being requested. The Ingress system sends the request to the correct container, and if the container has a database attached, it communicates with the database and sends a response on the same route.
A virtual machine (VM) can hold multiple containers and multiple databases.
Each container can have multiple copies on the VM. In this case, the Ingress system knows this and randomly sends through one of the copies of the same container.
External connection
You can connect to your database via the command line (CLI) or with a database tool. An external connection makes an internet round-trip, so it is much slower than internal communication. We recommend external connections if you are hosting only your database with us but not your front end.