Files
platform-docs/catalog/component/default/demo-db

title, generated_by, generated_at, human_edited, source_entity, source_repo
title generated_by generated_at human_edited source_entity source_repo
demo-db documentor-agent 2026-06-08T16:23:01+00:00 false Component/default/demo-db https://gitea.kyndemo.live/validate/petclinic

Overview

The demo-db service is a critical component of the Spring PetClinic application, providing database functionality for the broader system. It supports both in-memory (H2) and persistent database configurations (MySQL and PostgreSQL), enabling flexibility for development and production environments. The service is part of the petclinic system and integrates with other platform tools such as OpenTelemetry for observability, K6 for load testing, and Chaos Mesh for chaos engineering.

This service plays a key role in ensuring data persistence and retrieval for the application, supporting features like user management, veterinary records, and appointment scheduling. It is deployed and managed via ArgoCD in the demo-apps namespace, with observability and testing capabilities integrated into the deployment pipeline.

Repository

Field Value
Source Repo https://gitea.kyndemo.live/validate/petclinic
Branch main
ArgoCD App petclinic
Namespace demo-apps

Architecture

The demo-db service is designed to support multiple database configurations, including H2 (in-memory), MySQL, and PostgreSQL. It uses Spring Boot profiles to switch between database types, ensuring flexibility for different deployment scenarios. The service integrates with the following platform tools:

  • OpenTelemetry: Provides instrumentation for tracing, metrics, and logs, enabling detailed observability.
  • K6: Facilitates load testing to ensure the service can handle high traffic scenarios.
  • Chaos Mesh: Enables chaos engineering experiments to test the resilience of the service.

Data flows from the application layer to the database, with Spring Boot managing the connection and configuration. Persistent databases are supported via Docker containers or local installations, with profiles enabling seamless switching.

Configuration

Configuration Option Description
spring.profiles.active Specifies the active profile (mysql, postgres, or default for H2).
MYSQL_USER MySQL username for the database.
MYSQL_PASSWORD MySQL password for the database.
POSTGRES_USER PostgreSQL username for the database.
POSTGRES_PASSWORD PostgreSQL password for the database.
POSTGRES_DB PostgreSQL database name.

Operations

Running Locally

  1. Clone the repository:
    git clone https://gitea.kyndemo.live/validate/petclinic.git
    cd petclinic
    
  2. Start the application:
    • Using Maven:
      ./mvnw spring-boot:run
      
    • Using Gradle:
      ./gradlew bootRun
      
  3. Access the application at http://localhost:8080.

Persistent Database Setup

  • MySQL:
    docker run -e MYSQL_USER=petclinic -e MYSQL_PASSWORD=petclinic -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=petclinic -p 3306:3306 mysql:9.6
    
  • PostgreSQL:
    docker run -e POSTGRES_USER=petclinic -e POSTGRES_PASSWORD=petclinic -e POSTGRES_DB=petclinic -p 5432:5432 postgres:18.3
    

Rollback

  1. Open the ArgoCD UI.
  2. Click History and Rollback.
  3. Select the desired revision and click Rollback.

Alternatively, revert the commit in Git and push — ArgoCD will auto-sync the rollback.

Observability

This service is configured with OpenTelemetry instrumentation. Observability data is exported to the OTel Collector and visualized in Grafana.

  • Grafana Dashboard: View Dashboard
  • Alerting: Alerts are configured via Grafana with the label selector app=demo-db.

Dependencies

  • component:default/argocd-service
  • resource:default/k6-operator
  • resource:default/otel-collector
  • resource:default/veterinary-platform