Skip to main content

Self-hosted DBtune

Background

DBtune offers a self-hosted deployment option for enterprise customers. Self-hosting is particularly valuable in two scenarios:⁠

  • For organizations requiring an air-gapped environment due to regulatory compliance and information security requirements. If you are not sure if you need an air-gapped environment, you don’t need an air-gapped environment.
  • For cases needing specific customizations or integrations that are only possible in a self-managed environment. For example, if you are a software provider you may want to integrate your service more tightly with the DBtune optimizer. This is common for partners who adopt a value added reseller (VAR) or original equipment manufacturer (OEM) commercial model. ⁠

The self-hosted deployment delivers the complete feature set of the DBtune SaaS while giving you the added benefits of enhanced security, customization options, and infrastructure control. However, your team will be responsible for maintenance, updates, and infrastructure management.

How to host

There are two parts: 1) the self-hosted DBtune optimizer container, and 2) the DBtune agent.

Self-hosted DBtune container (part 1)

The self-hosted DBtune optimizer product is shipped in one container image called dbtune-hosted, which can be deployed in a Kubernetes cluster, a simple Docker compose environment, or in any runtime that support container images out-of-the-box, such as Heroku. This DBtune optimizer container is akin to the DBtune optimizer as a service (OaaS) product. These two products are equivalent in functionality and they deliver the same expected performance improvement. The only real difference is that the self-hosted optimizer is operated in an air-gapped environment while the OaaS is based on SaaS.

services:
# This will expose the **DBtune API** that the agent is going to send data to
# and the user interface
platform:
image: dbtune-hosted:latest
entrypoint: /usr/local/bin/entrypoint.sh
restart: unless-stopped
ports:
- "8000:8000"
environment:
- PORT=8000
- WORKERS=4
env_file:
- ../env-files/.env.dev
healthcheck:
test: ["CMD-SHELL", "curl --fail localhost:8000/api/ping || exit 1"]
interval: 10s
timeout: 60s
retries: 5
depends_on:
db:
condition: service_healthy

worker:
image: dbtune-hosted:latest
entrypoint: /usr/local/bin/worker-entrypoint.sh
restart: unless-stopped
env_file:
- ../env-files/.env.dev
depends_on:
- web
- redis
healthcheck:
test:
[
"CMD-SHELL",
"poetry run celery -A cloud inspect ping || exit 1",
]
interval: 10s
timeout: 10s
retries: 5
# Optional containers
# Cache layer, can be provided as a URL to the webserver
redis:
restart: unless-stopped
image: redis:7.0.15-alpine
expose:
- 6379
# Persistence layer, can be provided as a URL to the webserver
db:
ports:
- "5432:5432"
image: postgres:16
environment:
POSTGRES_DB: ***
POSTGRES_USER: ***
POSTGRES_PASSWORD: ***
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ***"]
interval: 2s
timeout: 5s
retries: 20

The DBtune API and user interface will be exposed on the assigned IP to the dbtune-hosted container.

This is a flowchart that explains how the container operates.

Image Alt Text

DBtune agent (part 2)

The DBtune agent requires to be installed and connected to your database. The agent will then communicate with the hosted DBtune container using the internal IP address you assigned to the DBtune container. Please note that this agent is the same as the agent in the SaaS solution — More information can be found in the DBtune documentation. The agent is open-source and written in Python.

Downloading the container image

The DBtune team provides access to the Container Registry credentials that are needed to authenticate and download the artifacts.

If your infrastructure is in AWS, the DBtune team will give you the possibility of whitelisting your AWS Account ID. This allows you to fetch the container images without needing any specific additional authentication.

Programmatic access

The DBune REST API enables you to programmatically retrieve database information and recommendations. The API uses resource-oriented URLs, returns request responses in JSON format, and uses standard HTTP status codes.

Security

The self-hosted deployment of DBtune works in an air-gapped environment, requiring no internet access. This makes it ideal for Enterprise offline deployments.