مقدمة في الخدمات المصغّرة (Microservices)
في هذه الصفحة 8 موضوعات
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
نظرة عامة
الموضوعات
- الفوائد
- التكاليف
- حدود الخدمات
- استقلالية النشر
تعلّم أولًا
2 ساعة تدريب (تقدير)
مخرجات التعلم
- State the benefits of microservices (independent deployment, scaling, ownership) and their costs (network, consistency, operations).
- Explain why a modular monolith is often the better first step.
- Apply concrete criteria to decide whether a module should become a service.
- Recognize a distributed monolith.
الدروس
المختبر والتمارين
Lab
MID-061-LAB1 · Split decision
Outcomes: 1–4 · Time: ~2 h
- Collect evidence for each Shop module: load, change frequency, team ownership, data coupling.
- Score each module against the extraction criteria.
- Decide which modules to extract, if any.
- Record the decision as an ADR: context, criteria, decision, consequences, review date.
Acceptance: ADR reviewed; "not extracting" is an acceptable outcome when justified.
Exercises (assessment: ADR review; five exercises)
| ID | Outcome | Task |
|---|---|---|
| MID-061-EX01 | 1 | Make a two-column table of microservice benefits and the conditions under which each really appears. |
| MID-061-EX02 | 1 | Take one in-process call in Shop and list everything that must be added when it becomes a network call. |
| MID-061-EX03 | 2 | Write a short argument for starting with a modular monolith for a 6-person team. |
| MID-061-EX04 | 3 | A colleague proposes "one service per entity" for Shop. Evaluate it with the criteria. |
| MID-061-EX05 | 4 | Review a description of 5 services that share a database and release together; name the problem and two fixes. |
أظهر الحلول
- EX01 For example: independent deployment needs independent code and data; scaling needs load evidence; ownership needs several teams.
- EX02 Timeout, retry with backoff, idempotency, error mapping, authentication, tracing, versioned contract, and a partial-failure path.
- EX03 Fewer moving parts, one deployment, local transactions, refactoring is cheap, boundaries still enforced by tooling; extract later when drivers appear.
- EX04 Boundaries by entity ignore bounded contexts and create chatty calls and lockstep changes; apply criteria per capability, not per table.
- EX05 It is a distributed monolith. Fixes: give each service its own data and API; merge back into a modular monolith where boundaries are unclear.
الاختبار
Outcomes: O1 benefits and costs · O2 modular monolith first · O3 extraction criteria · O4 distributed monolith.
اختبار ذاتي لك: لا توجد درجات، ولا يُحفظ أو يُرسل أي شيء. اختر إجابة ثم تحقق منها، ويمكنك المحاولة مرة أخرى كما تشاء.
الجزء العملي
Five exercises MID-061-EX01 to EX05 plus the lab. Pass: at least four exercises correct and an ADR whose decision follows explicit criteria.
أخطاء شائعة
A service per entity; splitting to "scale" without load data.
التقييم
ADR review.
الصلة بالمسار الوظيفي
Decomposition decisions (SRC-008) and migrations (SRB-008).