php-ddd-example
php-ddd-example copied to clipboard
Why two table for the same model?
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
-
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 .
-
The Backoffice and the Mooc subdomains use a different db table for the same
courcemodel, 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;