_CORE
AI & Agentic Systems Core Information Systems Cloud & Platform Engineering Data Platform & Integration Security & Compliance QA, Testing & Observability IoT, Automation & Robotics Mobile & Digital Banking & Finance Insurance Public Administration Defense & Security Healthcare Energy & Utilities Telco & Media Manufacturing Logistics & E-commerce Retail & Loyalty
References Technologies Blog Know-how Tools
About Collaboration Careers
CS EN
Let's talk

Database per Service

24. 05. 2020 1 min read intermediate

Architecture Intermediate

Database per Service

DatabaseMicroservicesData 3 min read

Proč by měla mít každá mikroservisa vlastní databázi a jak řešit dotazy napříč službami.

Principle

Jedna služba = jedna databáze. Žádné sdílení schématu. Datová izolace je klíčová.

Advantages

  • Nezávislý vývoj — změna schématu neovlivní ostatní
  • Technologická svoboda — PostgreSQL, MongoDB, Redis
  • Nezávislé škálování
  • Fault isolation

Cross-service dotazy

// API Composition
async function getOrderWithCustomer(orderId) {
    const order = await orderService.getOrder(orderId);
    const customer = await customerService.getCustomer(order.customerId);
    return { ...order, customer };
}

Summary

Database per Service komplikuje dotazy, ale umožňuje skutečnou nezávislost. Řešte čtení přes API Composition nebo CQRS.

Need Help with Implementation?

Our team has experience designing and implementing modern architectures. We’re happy to help.

Free Consultation

Share:

CORE SYSTEMS tým

Stavíme core systémy a AI agenty, které drží provoz. 15 let zkušeností s enterprise IT.