Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Nelsoncg98/InnovaTech/llms.txt

Use this file to discover all available pages before exploring further.

InnovaTech SOA deliberately employs two different database engines rather than a single shared schema. PostgreSQL handles structured, transactional data where relational integrity and ACID guarantees matter, while MongoDB stores the flexible, document-oriented product catalogue that benefits from schema-less design. Each microservice owns its data store exclusively — no service queries another service’s database directly.

Database-per-Service Pattern

The Database-per-Service pattern is a foundational SOA/microservices principle implemented throughout InnovaTech. Its key rules are:
  • No shared schemas. Each service is the sole owner and writer of its database. Other services that need the data must call the owning service’s API.
  • No cross-service joins. Data aggregation happens at the orchestration layer (e.g. servicio-ventapos), not at the database level.
  • Eventual consistency via events. When a transaction spans multiple services, each service commits locally and propagates state changes through service calls or future event streams, implementing the SAGA pattern where needed.
  • Independent schema evolution. A service can migrate its schema without coordinating with unrelated services.

PostgreSQL

Used by servicio-inventario (and planned for servicio-clientes and servicio-ventapos) for transactional, relational data such as Kardex stock movements and customer records.

MongoDB

Used exclusively by servicio-catalogo to store product and pricing documents. The flexible document model accommodates variable product attributes without schema migrations.

PostgreSQL

PostgreSQL 15 (Alpine) is the relational engine for services that require ACID transactions and structured relationships. Services using PostgreSQL: servicio-inventario · servicio-clientes (planned) · servicio-ventapos (planned)
PropertyValue
Docker imagepostgres:15-alpine
Host port5433
JDBC URLjdbc:postgresql://localhost:5433/innovatech_db
Usernameinnovatech
Passwordsecretpassword
Database nameinnovatech_db
Hibernate DDL modeupdate (auto-creates and migrates tables on startup)
JDBC driverorg.postgresql.Driver
Hibernate dialectorg.hibernate.dialect.PostgreSQLDialect
The ddl-auto: update setting means Hibernate inspects the entity model on every startup and applies any schema changes automatically. This is convenient for development but should be replaced with a migration tool such as Flyway or Liquibase before production deployment. The datasource configuration as it appears in servicio-inventario/src/main/resources/application.yml:
spring:
  application:
    name: servicio-inventario
  datasource:
    url: jdbc:postgresql://localhost:5433/innovatech_db
    username: innovatech
    password: secretpassword
    driver-class-name: org.postgresql.Driver
  jpa:
    hibernate:
      ddl-auto: update
    show-sql: true
    database-platform: org.hibernate.dialect.PostgreSQLDialect

MongoDB

MongoDB 6.0 is the document store for the product catalogue. Its schema-less documents make it straightforward to represent products with varying attribute sets without requiring table alterations. Services using MongoDB: servicio-catalogo
PropertyValue
Docker imagemongo:6.0
Host port27017
Connection URImongodb://admin:secretpassword@localhost:27017/innovatech_catalogo?authSource=admin
Database nameinnovatech_catalogo
Root usernameadmin
Root passwordsecretpassword
Auth sourceadmin (the root authentication database)
The MongoDB configuration as it appears in servicio-catalogo/src/main/resources/application.yml:
spring:
  application:
    name: servicio-catalogo
  data:
    mongodb:
      uri: mongodb://admin:secretpassword@localhost:27017/innovatech_catalogo?authSource=admin

Connecting with a Database Client

You can connect to either database directly for inspection, debugging, or manual data entry while the Docker Compose stack is running. PostgreSQL — psql CLI:
psql -h localhost -p 5433 -U innovatech -d innovatech_db
When prompted, enter the password secretpassword. Once connected you can run standard SQL queries against the innovatech_db database. MongoDB — mongosh CLI:
mongosh "mongodb://admin:secretpassword@localhost:27017/innovatech_catalogo?authSource=admin"
This opens a shell scoped to the innovatech_catalogo database where you can run collection queries and aggregation pipelines.
If you prefer a graphical interface, both databases are supported by popular GUI clients. TablePlus and DBeaver work well with PostgreSQL (connect on localhost:5433). MongoDB Compass or the MongoDB tab in TablePlus can connect to MongoDB using the URI above. Docker Desktop also shows live container logs and resource stats for each running database container.
The credentials shown throughout this page (innovatech / secretpassword, admin / secretpassword) are committed in plaintext for local development convenience only. Do not use these credentials in staging or production environments. Before deploying outside your local machine, rotate all passwords and inject them via environment variables, a secrets manager, or Spring Cloud Config — never commit production credentials to source control.

Build docs developers (and LLMs) love