icom/ framework

ວາງພື້ນຖານສຳລັບລະບົບໃຫຍ່.

ເລີ່ມດ້ວຍ application ທີ່ແບ່ງ module ຊັດເຈນ ແລ້ວຂະຫຍາຍຕາມຂໍ້ມູນການໃຊ້ງານຈິງ.

ແບ່ງຕາມທຸລະກິດ

ໃຫ້ Catalog ເປັນເຈົ້າຂອງສິນຄ້າ, Sales ຂອງຄຳສັ່ງຊື້ ແລະ Billing ຂອງໃບແຈ້ງໜີ້. ແຕ່ລະ module ມີທີມຮັບຜິດຊອບ, public Contracts, tests ແລະ README. ຮັກສາ dependencies ໃຫ້ບໍ່ເປັນວົງຈອນ; ເມື່ອ API ປ່ຽນ ໃຫ້ຮັກສາ contract ເກົ່າຊົ່ວຄາວ ຫຼືອັບເດດ consumer ໃນ release ດຽວ.

ຕົວຢ່າງທີ່ລອງໄດ້

Source ມີ Catalog/Sales example ທີ່ໃຊ້ interface ຂ້າມ module, ກວດ tenant membership ໃນ service ແລະແບ່ງໜ້າສິນຄ້າ. CLI demo ໃຊ້ SQLite ໃນ memory; ບໍ່ສ້າງບັນຊີຈິງ. ຜົນຄວນເປັນ Catalog → Sales, ໜ້າທຳອິດ Coffee/Tea ແລະໜ້າຕໍ່ໄປ Rice. ອ່ານ README ຂອງ example ກ່ອນດັດແປງ; ມັນບໍ່ໄດ້ລົງທະບຽນໃນເວັບຈິງ.

example
php examples/modular-shop/demo.php

ການຂຽນຂໍ້ມູນ ແລະ background work

ໃຊ້ transaction ດຽວສຳລັບ business data ແລະ Outbox::record ເທິງ scoped PDO connection ດຽວ. ໃຫ້ queue handler ຮອງຮັບການເຮັດຊ້ຳໄດ້; ການສົ່ງ email/payment ພາຍນອກຕ້ອງມີ idempotency ຂອງມັນເອງ. ຢ່າປະສົມ Doctrine connection ອີກຕົວແລ້ວຄິດວ່າ rollback ຮ່ວມກັນ. ໃຫ້ຜູ້ປະສານງານຄົນດຽວໃຊ້ migration; module boot ບໍ່ຄວນຂຽນ schema ຫຼືສົ່ງ network request.

Transactional outbox ↗

Queues and leases ↗

ຂະຫຍາຍຫຼາຍ instance

ກ່ອນເພີ່ມ application replicas ໃຫ້ຍ້າຍ business/auth/queue state ໄປຫາ shared SQL ທີ່ຜ່ານການທົດສອບ; ໃຊ້ Redis ສຳລັບ cache/rate limits ແລະຕັ້ງ namespace ແຍກ application. ການເພີ່ມ Redis ຢ່າງດຽວບໍ່ໄດ້ຍ້າຍ SQLite ໄປເປັນ shared database. ແຍກ web, maintenance ແລະ queue workers ຕາມ workload; ກຳນົດ timeout, retry, connection budget ແລະ graceful shutdown.

ໃຊ້ worker runtime ຢ່າງຮອບຄອບ

PHP-FPM ແມ່ນ runtime ຂອງເວັບຈິງ. FrankenPHP/Swoole adapters ມີຜົນທົດສອບປະຫວັດໃນ source; ການປ່ຽນ application/PHP/runtime ຕ້ອງທົດສອບ scope isolation, recycling, ການຂາດ DB/Redis ແລະ memory ໃນໄລຍະຍາວອີກ. ບໍ່ເກັບ identity ໃນ static/singleton ແລະບໍ່ນຳ native extensions ຂ້າມ PHP ABI ໂດຍບໍ່ rebuild.

ວັດກ່ອນຂະຫຍາຍ

ກຳນົດ workload ຈິງ: request ຕໍ່ວິນາທີ, p95/p99 latency, error rate, SQL queries, lock wait, queue age, CPU/RSS ແລະຂະໜາດຂໍ້ມູນ. ທົດສອບ backup/restore, migration ແລະ rollback ໃນ staging. ຜົນກວດ graph 500 modules ຫຼື request scopes ຊ້ຳໆ ແມ່ນ regression evidence; ບໍ່ແມ່ນການຮັບປະກັນຈຳນວນຜູ້ໃຊ້ ຫຼື production capacity.

ອາການ ແລະວິທີກວດ

example
Missing module dependency  → Register the dependency with its exact name.
Module dependency cycle   → Move a shared contract or reverse the dependency.
Service is already bound  → Review ownership; use bind only for an intentional override.
private-module-reference  → Depend on a public Contracts interface.
Scoped service at root    → Resolve inside a request/job scope, not provider boot.
404 after generation      → Register the provider; composer dump-autoload; inspect routes.
403 on tenant products    → Check active account, current membership and role permission.
Cursor pagination error   → Use a unique non-null key; remove earlier orderBy/limit.

Developer preview — benchmark claims require reproducible evidence.

Explore the architecture