CodelyTV / php-ddd-example

🐘🎯 Hexagonal Architecture + DDD + CQRS in PHP using Symfony 6

Home Page:https://pro.codely.tv/library/ddd-en-php

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why two table for the same model?

videni opened this issue · comments

commented

Hi, thanks for creating this repo which is what I want badly😃. after check all source codes of this repo, I have a few questions in my head.

this repo has three apps, so I assume each one is a micro service

  1. How do micro services interact with each other, via HTTP or grpc? how to use the Saga pattern for distributed transaction? are these subjects in the scope of this repo? there are so many things to talk about if this DDD example goes into micro service .

  2. The Backoffice and the Mooc subdomains use a different db table for the same cource model, how do we keep data in sync, is it neccesaary to create two models for the same data, why not use the same one?

CREATE TABLE `courses` (
  `id` CHAR(36) NOT NULL,
  `name` VARCHAR(255) NOT NULL,
  `duration` VARCHAR(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE `backoffice_courses` (
    `id` CHAR(36) NOT NULL,
    `name` VARCHAR(255) NOT NULL,
    `duration` VARCHAR(255) NOT NULL,
    PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;