🏛️ शाळेच्या पद्धतीने software architecture शिका

codebases च्या आत आणि त्यांच्या दरम्यानची रचना, शाळेच्या इमारतीचा नकाशा म्हणून शिकवलेली: modules म्हणजे खोल्या, imports म्हणजे मार्गिका आणि दारे, layers म्हणजे मजले, आणि bounded contexts म्हणजे विभाग. प्रत्येक धडा ही शाळेची एक गोष्ट आहे — काढलेल्या आकृतीसह आणि एका lab सह — आणि इमारत repo मध्येच आहे: एक छोटे sample school app आणि pure Python मधील एक analyzer (arch/analyze.py, शून्य dependencies) जो ast ने त्याचे imports वाचतो आणि coupling, cycles, layer व ring नियम, विभाग आणि fitness functions मोजतो.

🏛️ निर्णय🧱 coupling · instability🏢 layers⬡ ports & adapters🗂️ bounded contexts🏘️ modular monolith📌 events · CQRS🗄️ data ownership🔍 fitness functions🗺️ C4📓 ADRs · ATAM-lite🌳 strangler fig

🧱 भाग 1 — रचना (1–4)

  • जिना, रंग नव्हे 🏛️
  • कमी मार्गिका असलेल्या खोल्या 🧱
  • जिने एकाच दिशेने जातात 🏢
  • बाहेर उघडणारी दारे ⬡

🗂️ भाग 2 — सीमा आणि शैली (5–8)

  • स्वतःचे शब्द असलेले विभाग 🗂️
  • एक इमारत की कॅम्पस 🏘️
  • सूचना फलक 📌
  • कपाट कोणाच्या मालकीचे 🗄️

🔍 भाग 3 — निरोगी ठेवणे (9–12)

  • प्रत्येक push वर एक निरीक्षक 🔍
  • इमारतीवरून काढलेला नकाशा 🗺️
  • "का" ची नोंदवही 📓
  • वाढा, सडू नका 🌳
# the 60-second wow — the floor plan, inspected:
git clone https://github.com/BaluRaut/learn-software-architecture-school.git && cd learn-software-architecture-school
python3 arch/demo.py               # 12 lessons: blast radius, layers, the hexagon, fitness functions, C4
python3 arch/analyze.py check      # the architecture tests — exit code 1 on the planted problems
python3 arch/test_arch.py          # 12 checks across the lessons

तुम्हाला काय दिसायला हवे (छाटलेले — यश असे दिसते):

═══ decisions ═══
── the building: arch/sample/schoolapp has 13 rooms (modules) and 24 corridors (imports), 187 lines
   blast radius = the rooms a change can ripple into (every room that reaches it through corridors):
   domain.admissions   8 of 12 rooms
   domain.ports        8 of 12 rooms
   domain.grades       4 of 12 rooms
   domain.timetable    0 of 12 rooms
   main                0 of 12 rooms
   repainting a room (a local variable) touches 1 room · moving a load-bearing wall (a port) touches 8 — THAT is architecture
── Katrina's three driving characteristics (the -ilities), each with a scenario and a price:
   modifiability  'a new department (the library) goes live within a term' · price: costs up-front structure
   testability    'the marks rules run in a test without a database' · price: needs ports and adapters (more types)
   availability   'report cards open on results day' · price: spare capacity, and fewer moving parts
   every characteristic you add costs another; pick the few that decide success

═══ modularity ═══
── per floor (component): N rooms, R corridors inside, H = (R+1)/N, Ca in, Ce out, I = Ce/(Ca+Ce), A abstract, D = |A+I-1|
   app     N=3 R=0 H=0.33 · Ca=2 Ce=3 I=0.60 · A=0.00 D=0.40
   domain  N=5 R=2 H=0.60 · Ca=5 Ce=2 I=0.29 · A=0.33 D=0.38
   infra   N=2 R=0 H=0.50 · Ca=3 Ce=2 I=0.40 · A=0.00 D=0.60
   main    N=1 R=0 H=1.00 · Ca=0 Ce=1 I=1.00 · A=0.00 D=0.00
   web     N=2 R=1 H=1.00 · Ca=2 Ce=1 I=0.33 · A=0.00 D=0.67
   domain is stable (I=0.29): 5 rooms outside lean on it · main is fully unstable (I=1.00): nobody imports it — both are fine
   app has H=0.33: its 3 rooms never talk to each other — a floor, not a department
   web has D=0.67: fairly stable but fully concrete — hard to change, nothing abstract to extend

═══ layers ═══
── floors, top to bottom: web → app → domain → infra · a room may import its own floor or any floor BELOW
   relaxed layering: 4 violations
     domain.timetable → web.format (upward)
     infra.db → domain.grades (upward)
     infra.db → domain.ports (upward)
     infra.email → domain.ports (upward)
   strict layering (only the floor directly below): 5 violations — adds app.enrol → infra.email (skips a floor)
   3 of the 4 are adapters importing the ports they implement — the classic stack calls that wrong; lesson 04 flips it

═══ hexagonal ═══
── rings: domain (core) ← app ← web + infra (adapters) · dependencies point INWARD only
   outward: app.enrol → infra.email
   outward: domain.grades → infra.db
   outward: domain.timetable → web.format
   the domain imports outside itself 2 times · outside libraries per room: domain.ports ['abc', 'typing'], infra.db ['sqlite3'], infra.email ['smtplib']
   to test domain.grades you must load 3 other rooms ['domain.admissions', 'domain.ports', 'infra.db']
   remove the 3 outward corridors (use the ports) → 1 ['domain.admissions'] · outward left: 0
   classic layers flagged infra → domain; the hexagon allows it and flags domain → infra instead

═══ ddd ═══
── departments (bounded contexts): admissions · grades · fees · timetable — each with its own meaning of 'student'
   in admissions a student is a form number, a name and a status
   in grades     a student is a roll number with marks in subjects
   in fees       a student is an account that owes money
── the context map, read from the code: 2 cross-department corridors
   fees → admissions: domain.fees imports Student from domain.admissions
   grades → admissions: domain.grades imports Student from domain.admissions
   grades → admissions: conformist today → an anti-corruption layer translates at the door
   fees → admissions: customer–supplier · both would break if admissions renamed Student.name

═══ styles ═══
── the same 4 departments in three styles (teaching assumptions: 1 ms and 1-in-1000 failure per network hop)
   monolith         1 deployable unit(s) · own deploys: no  · boundaries enforced by nothing (any room may import any room)
                    report card 0 hop(s) +0 ms 100.0% · pay fees 0 hop(s) +0 ms 100.0% · enrol 0 hop(s) +0 ms 100.0% · enrol needs one database transaction
   modular monolith 1 deployable unit(s) · own deploys: no  · boundaries enforced by a build-time check (lesson 09)
                    report card 0 hop(s) +0 ms 100.0% · pay fees 0 hop(s) +0 ms 100.0% · enrol 0 hop(s) +0 ms 100.0% · enrol needs one database transaction
   microservices    4 deployable unit(s) · own deploys: yes · boundaries enforced by the network (separate processes)
                    report card 2 hop(s) +2 ms 99.8% · pay fees 1 hop(s) +1 ms 99.9% · enrol 3 hop(s) +3 ms 99.7% · enrol needs a saga across services
   microservices buy independent deploys with hops, partial failure and sagas — the modular monolith keeps the boundaries without the network

═══ events ═══
── admissions publishes StudentAdmitted(Dipika, 5A) on the notice board → grades opens a mark sheet · fees opens an account · timetable assigns a class
   direct calls: admissions imports 3 departments · events: it imports 0 of them (only the event's shape) — a 4th listener needs no change to admissions
── CQRS: 3 marks written (72, 85, 90); the read model has applied 2 → average 78.5
   after catch-up it has applied 3 → average 82.33 · reads are fast, and eventually consistent

═══ data ═══
── fees needs a student's name 20 times; at tick 5 admissions renames name → full_name; ticks 10–12 admissions is down
   shared database  failed reads 15 · stale reads 0 · other teams' code broken by the rename 2
   API              failed reads  3 · stale reads 0 · other teams' code broken by the rename 0
   events           failed reads  0 · stale reads 2 · other teams' code broken by the rename 0
   shared DB: no call to admissions at run time, but total schema coupling · API: contract, but runtime coupling · events: own copy, but stale

═══ fitness ═══
── the fitness functions run on every push (python3 arch/analyze.py check)
   FAIL  no import cycles                         1 cycle(s): domain.grades ↔ infra.db
   FAIL  dependencies point inward                3 outward import(s)
   FAIL  the domain imports only the domain       2 leak(s)
   FAIL  departments do not import each other     2 cross-context import(s)
   PASS  fan-out ≤ 5 per room (main excluded)     max 4 (web.views)
   PASS  domain instability ≤ 0.5                 I = 0.29
   after removing the 5 planted corridors: 6/6 pass · CI exit code 0

═══ c4 ═══
── a C4 model as text (Structurizr DSL), 31 lines — the component arrows come from the code:
   app -> domain "imports (6)"
   app -> infra "imports (1)"
   domain -> infra "imports (1)"
   domain -> web "imports (1)"
   infra -> domain "imports (3)"
   web -> app "imports (3)"
   the wiki drawing is out of date: 3 arrows in the code are not on it: app → infra, domain → infra, domain → web
   after the fixes: 0 drift · generate the drawing from the code, or check it in CI

═══ adr ═══
── ATAM-lite: 5 scenarios, weight 1–3, each option scored 1–5 by the team
   modifiability  w=3 'add the library department within a term'
   operability    w=3 'run it with a team of 3'
   performance    w=2 'a report card in < 300 ms on results day'
   deployability  w=1 'release grades without redeploying fees'
   scalability    w=1 'survive 20× traffic on results day'
   modular monolith [4, 5, 5, 2, 3] → 42
   monolith         [2, 5, 5, 1, 3] → 35
   microservices    [4, 2, 3, 5, 5] → 34
   weights matter: microservices would win if deployability weighed 4 (not 1), or scalability 6 (not 1)
── the decision, written down as ADR-0007 (14 lines):
   # ADR-0007: A modular monolith for the school app
   Status: Accepted
   - one database transaction per request
   - no independent deploys yet
   - revisit if deployability weight reaches 4

═══ evolve ═══
── the building over four terms: rooms · corridors · cycles (largest) · propagation cost · outward imports · floors tangled
   term 1 · the first plan          13 · 19 · 0 (0) · 24.3% · 0 · floors tangled 0
   term 2 · as shipped              13 · 24 · 1 (2) · 31.4% · 3 · floors tangled 4
   term 3 · exam rush               13 · 29 · 4 (3) · 49.7% · 3 · floors tangled 4
   term 4 · checks + a library wing 15 · 24 · 0 (0) · 22.2% · 0 · floors tangled 0
── the strangler fig: a facade sends each route to the old building or the new wing, one route at a time
   step 1: /admin         → 1/6 routes,   2% of traffic on the new wing
   step 2: /timetable     → 2/6 routes,  27% of traffic on the new wing
   step 3: /fees          → 3/6 routes,  42% of traffic on the new wing
   step 4: /enrol         → 4/6 routes,  47% of traffic on the new wing
   step 5: /marks/upload  → 5/6 routes,  55% of traffic on the new wing
   step 6: /report-card   → 6/6 routes, 100% of traffic on the new wing
── the whole picture: decide what is costly → rooms with few corridors → floors point one way → the core in the middle → departments with their own words → pick a style → notices, not calls → own your data → inspect every push → draw from the code → write the why → grow, don't rot

✅ done — the floor plan holds
🎒 धडा 01 आधी: तुम्हाला फक्त Python 3 हवे — दुसरे काहीही नाही. Analyzer फक्त sample codebase (arch/sample/schoolapp) ast ने वाचतो; style, event, data आणि trade-off models हे सांगितलेल्या गृहीतकांसह शिकवण्याचे models आहेत. खरी tools प्रत्येक धड्यात येतात: import-linter, ArchUnit, dependency-cruiser, Structurizr, adr-tools. ही शाळा कुठे बसते: System Design शाळा distributed systems (caches, queues, sharding) design करते; ही शाळा codebases च्या आतील आणि त्यांच्या दरम्यानच्या रचनेबद्दल आहे.

🗺️ संपूर्ण चित्र — एक आकृती, पूर्ण कोर्स

संपूर्ण कोर्स एका कॅनव्हासवर. 4K आवृत्तीसाठी क्लिक करा.

The big picture: structure (what architecture is, modularity, layers, ports and adapters), boundaries and styles (DDD, monolith vs modular monolith vs microservices, events and CQRS, data ownership) and keeping it healthy (fitness functions, C4, ADRs, evolution)

🧱 भाग 1 — रचना (धडे 1–4)

एक git branch = एक कल्पना; branch 04 मध्ये धडे 01–04 आहेत. arch/analyze.py sample चे imports वाचतो — प्रत्येक run तेच आकडे छापतो.

1

🏛️ Architecture म्हणजे काय

जिना, रंग नव्हे — बदलायला महाग असलेले निर्णय, त्यांनी मिळणाऱ्या -ilities, आणि त्यांची किंमत.lesson-01-what-is-architectureधडा वाचा →आकृती पहा ↗
2

🧱 Modularity

कमी मार्गिका असलेल्या खोल्या, मोजून — cohesion, coupling, Ca, Ce, instability, abstractness आणि distance.lesson-02-modularityधडा वाचा →आकृती पहा ↗
3

🏢 Layers

मजले, आणि जिने कोणत्या दिशेने जातात — layer नियम, strict विरुद्ध relaxed, आणि उल्लंघने शोधणे.lesson-03-layersधडा वाचा →आकृती पहा ↗
4

⬡ Ports & adapters

मध्यभागी नियमपुस्तिका, बाहेर उघडणारी दारे — domain कोणतेही infrastructure import करत नाही.lesson-04-hexagonalधडा वाचा →आकृती पहा ↗

🗂️ भाग 2 — सीमा आणि शैली (धडे 5–8)

भागांमधील रेषा कुठे काढायच्या, किती deployable units ठेवायची, आणि विभाग events व data कसे वाटून घेतात.

5

🗂️ Domain-driven design

स्वतःचे शब्द असलेले विभाग — bounded contexts, ubiquitous language आणि code मधून वाचलेला context map.lesson-05-dddधडा वाचा →आकृती पहा ↗
6

🏘️ Monolith, modular monolith, microservices

एक इमारत, भिंती असलेली एक इमारत, की कॅम्पस — आणि प्रत्येक शैलीची किंमत काय.lesson-06-stylesधडा वाचा →आकृती पहा ↗
7

📌 Events & CQRS

सूचना फलक आणि display फलक — एकदाच publish करा, थोडे मागे असलेले model वाचा.lesson-07-events-cqrsधडा वाचा →आकृती पहा ↗
8

🗄️ Data ownership

सामायिक कपाट, एक खिडकी, की नोटिशीची प्रत — shared DB विरुद्ध API विरुद्ध events.lesson-08-data-ownershipधडा वाचा →आकृती पहा ↗

🔍 भाग 3 — निरोगी ठेवणे (धडे 9–12)

खरी राहणारी architecture: ती लागू करणाऱ्या tests, तिच्यापासून तयार होणारी आकृती, लिहून ठेवलेले निर्णय, आणि big-bang rewrite शिवाय बदल.

9

🔍 Fitness functions

कधीही सुट्टी न घेणारा निरीक्षक — build fail करणाऱ्या architecture tests.lesson-09-fitness-functionsधडा वाचा →आकृती पहा ↗
10

🗺️ C4 model

कॅम्पसचा नकाशा, इमारतीचा आराखडा, मजल्याचा नकाशा — code मधून तयार होणारे text C4 model, आणि drift.lesson-10-c4धडा वाचा →आकृती पहा ↗
11

📓 ADRs & trade-offs

मुख्याध्यापिकेची नोंदवही — decision records आणि weight check सह ATAM-lite गुणांकन.lesson-11-adrsधडा वाचा →आकृती पहा ↗
12

🌳 बदलत जाणारी architecture आणि संपूर्ण चित्र

वाढा, सडू नका — काळानुसार cycles आणि propagation cost, strangler fig, आणि संपूर्ण नकाशा.lesson-12-evolutionधडा वाचा →आकृती पहा ↗
🗣️ मोठ्याने समजावून सांगा — धडा 12 नंतर: (1) कोणते निर्णय architecture आहेत, आणि त्यांना बदलण्याची किंमत तुम्ही कशी मोजाल? (2) instability I = Ce / (Ca + Ce) तुम्हाला काय सांगते, आणि स्थिर भाग abstract का असावेत? (3) पारंपरिक layer check adapters ना उल्लंघन म्हणून का दाखवतो? (4) "domain मध्ये infrastructure चे कोणतेही imports नाहीत" यातून तुम्हाला काय मिळते? (5) "student" चे तीन अर्थ का असू शकतात — आणि ते ठीक का आहे? (6) modular monolith ला नसलेली कोणती किंमत microservice ला मोजावी लागते? (7) event कोणते coupling काढून टाकतो, आणि कोणते वाढवतो? (8) Shared database, API की events — कोण कसे अपयशी होते? (9) नियमाने build fail करणे का गरजेचे आहे? (10) C4 चे चार स्तर कोणते? (11) ADR मध्ये काय असते, आणि त्याचा पुनर्विचार कधी करावा?
🎓 याच शाळेतून: System Design · Distributed Systems · API · CI/CD — तेच उपमा-विश्व, तीच branch-दर-branch पद्धत.

📐 धड्यांच्या आकृत्या — क्रमांक अनुसरा

प्रत्येक धडा एका क्रमांकित बॉक्स-आणि-बाण आकृतीत — स्वतंत्र पानावरही.

1 🏛️ Architecture म्हणजे काय

जिना, रंग नव्हे — बदलायला महाग असलेले निर्णय, त्यांनी मिळणाऱ्या -ilities, आणि त्यांची किंमत.

🧒 सोप्या शब्दांत

कतरिना नव्या शाळेच्या इमारतीचा आराखडा बनवते. रंग नंतर सहज बदलता येतो. जिना नाही. तो हलवायचा म्हणजे अर्धी शाळा बंद. Sample app मध्ये ports नावाची एक room इतर 12 पैकी 8 rooms ना आधार देते. असा निर्णय म्हणजे architecture. कतरिना सर्वात महत्त्वाचे थोडे गुण निवडते, आणि त्यांची किंमत स्वीकारते.

📖 नवे शब्दarchitecture — नंतर बदलायला महाग असलेले निर्णय, जसे जिना कुठे असावाmodule — code ची एक file; या शाळेत ती एक room आहेblast radius — एखादा बदल ज्या सगळ्या rooms पर्यंत पोहोचू शकतो, जसे ports साठी 12 पैकी 8-ility — इमारतीत हवा असलेला गुण, जसे testability, आणि त्याला नेहमी किंमत असते
1🏫 भार वाहणारी भिंत हलवा: domain.ports — 12 पैकी 8 खोल्यांना जाणवतेस्वागतकक्ष · webकार्यालय · appनियमपुस्तिका · domainसाठवण खोली · infraप्रवेशद्वारviewsformatenrolfees_servicereport_cardadmissionsfeesgradesportsवेळापत्रकdbemailmainblast radius मध्ये 12 पैकी 8 खोल्याmain सुरुवातीला इतर सर्व 6 जोडतो2💥 प्रत्येक खोलीचा blast radius (इतर 12 पैकी)domain.admissions8domain.ports8domain.grades4infra.db4domain.fees3infra.email3web.format3app.enrol2app.fees_service2app.report_card2web.views1domain.timetable0main0मार्गिकांमधून तिथे पोहोचणारी प्रत्येक खोली3🖌️ रंग विरुद्ध 🪜 जिनाखोलीला पुन्हा रंग देणे(एक local variable)1 खोलीला स्पर्शभार वाहणारी भिंत हलवणे(एक port)8 खोल्यांना स्पर्शarchitecture = असे निर्णय जेनंतर बदलायला महाग असतात13 खोल्या · 24 मार्गिका · 187 ओळी4⚖️ कतरिना 3 मुख्य वैशिष्ट्ये निवडते — प्रत्येकाची एक किंमत आहे📚modifiabilityनवा विभाग (ग्रंथालय)एका सत्रात सुरू होतोकिंमत:आधीच केलेली रचनाtestabilityगुणांचे नियम test मध्ये चालतातdatabase शिवायकिंमत:ports + adapters (अधिक types)availabilityप्रगतिपुस्तके उघडतातनिकालाच्या दिवशीकिंमत:जादा क्षमता, कमी भागतुम्ही जोडलेले प्रत्येक वैशिष्ट्य दुसऱ्याची किंमत मोजते — यश ठरवणारी थोडीच निवडा
⏪ आधी

टीम प्रत्येक निर्णय सारखाच मानत असे: variable चे नाव आणि सगळ्यांचा port सारख्याच काळजीने, किंवा बेफिकिरीने बदलले जात.

💡 काय

Architecture म्हणजे जिना, रंग नव्हे: जे निर्णय नंतर बदलणे महाग असते, जसे sample मधील domain.ports.

⚙️ कसे

Analyzer 13 rooms आणि 24 corridors वाचतो: domain.ports मधला बदल 12 पैकी 8 rooms पर्यंत पोहोचतो, timetable चा 0.

🎯 का

कतरिना 3 driving characteristics निवडते, प्रत्येकासोबत scenario आणि किंमत, कारण प्रत्येक गुण दुसऱ्या कशाची तरी किंमत घेतो.

🚀 पुढे

पुढचा धडा rooms मोजतो: प्रत्येक मजल्याला किती corridors आहेत, आणि त्याचा बदलावर काय परिणाम होतो.

🧪 इथे करून पाहा — एक खोली निवडा — तिच्यातील बदल कोणत्या खोल्यांपर्यंत पसरू शकतो?

पूर्ण धडा 01 वाचा →

2 🧱 Modularity

कमी मार्गिका असलेल्या खोल्या, मोजून — cohesion, coupling, Ca, Ce, instability, abstractness आणि distance.

🧒 सोप्या शब्दांत

चांगल्या room चे एकच काम असते. Test tubes विज्ञान प्रयोगशाळेत असतात, library मध्ये नाही. चांगल्या room ला कमी दारे असतात. दीपिका प्रत्येक मजल्याची दारे मोजते. Rule book च्या मजल्याला आत येणारी 5 दारे आणि बाहेर जाणारी 2 आहेत. अनेक जण त्यावर अवलंबून आहेत, म्हणून तो हळूहळू बदलायला हवा. त्याची instability 0.29 आहे.

📖 नवे शब्दcohesion — एकत्र वापरल्या जाणाऱ्या गोष्टी एकाच room मध्ये राहतातcoupling — एका room ला इतर rooms कडे किती corridors लागतात; कमी असतील तर बदल सोपाinstability — बाहेर जाणारी दारे भागिले सगळी दारे, जसे 7 पैकी 2 = 0.29abstract — कोण करणार हे न सांगता काय हवे आहे याचा आराखडा, जसे port
1🚪 दीपिका प्रत्येक मजल्याची दारे मोजतेस्वागतकक्ष · webकार्यालय · appनियमपुस्तिका · domainसाठवण खोली · infraप्रवेशद्वारviewsformatenrolfees_servicereport_cardadmissionsfeesgradesportsवेळापत्रकdbemailmainCa 2 आत · Ce 1 बाहेरCa 2 आत · Ce 3 बाहेरCa 5 आत · Ce 2 बाहेरCa 3 आत · Ce 2 बाहेरजांभळ्या = मजल्याच्या आतील मार्गिका (R) · राखाडी = मजल्यांमधील मार्गिका2📈 abstract A विरुद्ध unstable I — distance Dवेदनेचा झोननिरुपयोगीपणाचा झोनmain sequence (D = 0)000.50.511I = Ce / (Ca + Ce) → unstableA → abstractweb D=0.67infra D=0.60app D=0.40main D=0.00domain D=0.383🧮 प्रत्येक मजल्यासाठी: N खोल्या · R आत · H = (R+1)/N · Ca · Ce · I · A · DfloorNRHCaCeIADapp300.33230.600.000.40domain520.60520.290.330.38infra200.50320.400.000.60main101.00011.000.000.00web211.00210.330.000.670.291.000.330.67domain स्थिर आहे (I=0.29): बाहेरच्या 5खोल्या त्यावर अवलंबून आहेतmain पूर्णपणे unstable आहे(I=1.00): कोणीही ते import करत नाही —दोन्ही ठीक आहेतapp चा H=0.33: त्याच्या 3 खोल्याएकमेकींशी कधीच बोलत नाहीतweb चा D=0.67: बऱ्यापैकी स्थिरपण पूर्णपणे concreteMartin, classes ऐवजी modules घेऊन · A = abstract classes / classes (फक्त domain.ports मध्येच आहेत)
⏪ आधी

Code अंदाजाने तपासला जाई: 'हे module गोंधळलेले दिसते'. एखादा भाग किती coupled आहे, आणि ते वाईट आहे का, कोणी सांगू शकत नसे.

💡 काय

Cohesion आणि coupling आकड्यांत: Ca आत येणारी दारे, Ce बाहेर जाणारी, instability I = Ce/(Ca+Ce), आणि distance D = |A+I-1|.

⚙️ कसे

दीपिका प्रत्येक मजला मोजते: domain चे Ca=5, Ce=2, म्हणून I=0.29; main चे I=1.00; web चे D=0.67 आणि app चे H=0.33.

🎯 का

ज्यांच्यावर अनेक जण अवलंबून आहेत ते स्थिर भाग abstract असावेत; web स्थिर पण पूर्ण concrete आहे, म्हणून बदलायला अवघड.

🚀 पुढे

पुढचा धडा rooms मजल्यांवर रचतो आणि विचारतो जिना कोणत्या दिशेने जावा: फक्त खाली, कधीच वर नाही.

🧪 इथे करून पाहा — एखादी मार्गिका जोडा किंवा काढा — Ca, Ce, I, A आणि D कसे बदलतात ते पाहा

पूर्ण धडा 02 वाचा →

3 🏢 Layers

मजले, आणि जिने कोणत्या दिशेने जातात — layer नियम, strict विरुद्ध relaxed, आणि उल्लंघने शोधणे.

🧒 सोप्या शब्दांत

शाळेला चार मजले आहेत. वर reception, मग office, मग rule book, आणि खाली store room. नियम सोपा: जिन्याने खाली जा, कधीच वर नाही. कतरिना प्रत्येक corridor तपासते. तिला वर जाणारे 4 सापडतात. पण त्यातले 3 म्हणजे store room चे कर्मचारी rule book वाचत आहेत, जे खरे तर चूक नाही.

📖 नवे शब्दlayer — इमारतीचा एक मजला, जसे web, app, domain किंवा infraviolation — नियम मोडणारा corridor, जसे जिन्याने वर जाणाराstrict layering — फक्त लगेच खालच्या मजल्यावर जाता येते, ज्यात 5 violations सापडले
1🏢 चार मजले — जिन्याने वर जाणाऱ्या मार्गिकास्वागतकक्ष · webकार्यालय · appनियमपुस्तिका · domainसाठवण खोली · infraप्रवेशद्वारviewsformatenrolfees_servicereport_cardadmissionsfeesgradesportsवेळापत्रकdbemailmainलाल = एक मजला वर जाते (relaxed + strict) · नारिंगी तुटक = एक मजला ओलांडते (फक्त strict) · राखाडी = परवानगी आहे2🪜 नियम: जिन्याने खाली, कधीच वर नाहीखाली ✓वर ✗relaxed layering4उल्लंघनेस्वतःचा मजला किंवा खालचाकोणताही मजलाstrict layering5उल्लंघनेफक्त अगदी खालचामजलाstrict मध्ये app.enrol → infra.email ची भर(ती कार्यालयातून थेटभांडारखोलीत उडी मारते)3🎫 4 relaxed उल्लंघने — आणि त्यांपैकी 3 खरोखर चुका का नाहीतवेळापत्रकformatdomain मजलाweb मजलाcore ची घंटास्वागतकक्षाला वाजवते:खरी चूकdbgradesinfra मजलाdomain मजलाएक adapterते साठवत असलेलाMark import करतेdbportsinfra मजलाdomain मजलाएक adapterते साठवत असलेलाते जो portimplement करतेemailportsinfra मजलाdomain मजलाएक adapterते साठवत असलेलाते जो portimplement करतेधडा 04 नियम उलटा करतो
⏪ आधी

Screens, rules आणि SQL एकाच files मध्ये होते, म्हणून database बदलला की business rules लाही हात लावावा लागे.

💡 काय

Layers म्हणजे मजले: web, app, domain, infra. एखादी room स्वतःच्या किंवा खालच्या मजल्याला import करू शकते, वरच्याला कधीच नाही.

⚙️ कसे

Check ला relaxed mode मध्ये 4 वर जाणारे corridors सापडतात, आणि strict मध्ये 5, कारण enrol थेट infra.email ला जातो.

🎯 का

मजल्यांचा नियम जिना एकाच दिशेने ठेवतो; पण 4 पैकी 3 violations हे adapters आहेत, जे स्वतः implement करत असलेले ports import करतात.

🚀 पुढे

पुढचा धडा चित्र उलटवतो: rule book मध्यभागी जाते आणि प्रत्येक दार बाहेरच्या दिशेने उघडते.

🧪 इथे करून पाहा — मजल्यांचा क्रम आणि नियम निवडा — तो मोडणाऱ्या मार्गिका मोजा

पूर्ण धडा 03 वाचा →

4 ⬡ Ports & adapters

मध्यभागी नियमपुस्तिका, बाहेर उघडणारी दारे — domain कोणतेही infrastructure import करत नाही.

🧒 सोप्या शब्दांत

आता rule book मधल्या staff room मध्ये आहे. प्रत्येक दारावर पाटी आहे: 'मला marks आणणारे कोणीतरी हवे.' आज store room चा कर्मचारी येतो. Test मध्ये दीपिका कागद घेऊन येते. दोघेही त्या दाराला बसतात. तीन दारे चुकीने बाहेर उघडत होती. ती दुरुस्त केल्यावर grades च्या test ला फक्त 1 दुसरी room लागते.

📖 नवे शब्दport — core च्या दारावरची पाटी, काय हवे ते सांगते, कोण देणार ते नाहीadapter — बाहेरचा मदतनीस जो दाराला बसतो, जसे SQL store किंवा email पाठवणाराdependency rule — प्रत्येक corridor आतल्या दिशेने, rule book कडे जातोfake — tests मध्ये वापरला जाणारा खोटा मदतनीस, जसे database ऐवजी कागद
1⬡ नियमपुस्तिका मध्यभागी, दारे बाहेरच्या दिशेनेcore · domainapp वलयadaptersweb + infraadmissionsवेळापत्रकfeesgradesportsfees_serviceenrolreport_cardviewsformatdbemail📦 sqlite3📦 smtplibabc, typing (standard, abstract)हिरवा = आतल्या दिशेने ✓ · लाल = बाहेरच्या दिशेने ✗ (3) · main बाहेरून adapters जोडते2🧪 domain.grades ची test करायला तुम्हाला load करावे लागते…आजgradestest होत असलेलेadmissionsportsdbइतर 3 खोली/खोल्या · sqlite3 सुद्धाबाहेर जाणाऱ्या 3 मार्गिका काढल्यानंतर (ports वापरा)gradestest होत असलेलेadmissionsइतर 1 खोली/खोल्या · database नाही3🔄 प्रत्येक नियम काय पकडतोwebappdomaininfraपारंपरिक layersinfra → domain पकडतोdomaininfraports and adaptersdomain → infra पकडतो
⏪ आधी

Domain database वर बसलेले होते, म्हणून marks चा नियम test करायला SQLite सुरू करून store room load करावी लागे.

💡 काय

Ports and adapters: core ports ठरवतो (GradeStore, Mailer, Ledger) आणि बाहेरचे adapters त्यांना जोडले जातात.

⚙️ कसे

Ring check ला 3 बाहेर जाणारे corridors सापडतात; ते काढल्यावर domain.grades च्या test ला load कराव्या लागणाऱ्या rooms 3 वरून 1 होतात.

🎯 का

आतल्या दिशेने जाणाऱ्या dependencies मुळे मौल्यवान नियम SQL आणि SMTP पासून मुक्त राहतात, आणि fakes सोबत काही ms मध्ये test होतात.

🚀 पुढे

पुढचा धडा core ला विभागांमध्ये वाटतो, प्रत्येकाचा 'student' या शब्दाचा स्वतःचा अर्थ असतो.

🧪 इथे करून पाहा — बाहेर जाणाऱ्या 3 मार्गिका ठेवा किंवा काढा — domain.grades च्या test ला काय load करावे लागते?

पूर्ण धडा 04 वाचा →

5 🗂️ Domain-driven design

स्वतःचे शब्द असलेले विभाग — bounded contexts, ubiquitous language आणि code मधून वाचलेला context map.

🧒 सोप्या शब्दांत

तीन offices ना विचारा student म्हणजे काय. Admissions म्हणते form number आणि नाव. Exam cell म्हणते marks सह roll number. Accounts म्हणते fees देणे असलेले खाते. तिघीही आपल्या office मध्ये बरोबर आहेत. पण grades आणि fees admissions ची कल्पना उसनी घेतात. Admissions ने नावाचा रकाना बदलला, तर 2 offices बिघडतात.

📖 नवे शब्दbounded context — असा विभाग जिथे एक model आणि एकच शब्दसंच सुसंगत राहतातubiquitous language — विभाग बोलण्यात आणि code मध्ये सारखेच वापरतो ते शब्दcontext map — कोणता विभाग कोणावर अवलंबून आहे याचा नकाशा, जसे grades → admissionsanti-corruption layer — दारावरचा अनुवादक जो दुसऱ्या office चे शब्द आपल्या शब्दांत बदलतो
1🗂️ इमारतीच्या नकाशावर चार विभाग — प्रत्येकाचा स्वतःचा "विद्यार्थी"प्रवेश कार्यालयdomain.admissionsapp.enrolशुल्क कार्यालयdomain.feesapp.fees_serviceगुण कार्यालयdomain.gradesapp.report_cardinfra.dbवेळापत्रक कार्यालयdomain.timetableप्रवेश विभागातला विद्यार्थीएक अर्ज क्रमांक,एक नाव आणिएक स्थितीशुल्क विभागातला विद्यार्थीएक खाते ज्यावरपैसे थकले आहेतगुण विभागातला विद्यार्थीएक हजेरी क्रमांकज्याला गुण मिळालेsubjectsवेळापत्रक विभागातला विद्यार्थी(इथे विद्यार्थी नाही:वर्ग आणितासिका)domain.fees Student import करतोdomain.grades Student import करतो2 आंतर-विभागीय मार्गिका, code मधून वाचलेल्या — दोघीही प्रवेश विभागाचा Student उसना घेतात2🗺️ context mapadmissionsgradesfeesवेळापत्रकACLआज conformist → एक anti-corruptionlayer दारावरच भाषांतर करतोcustomer – supplierमार्गिका नाही3✏️ प्रवेश विभाग Student.name चे नाव बदलतोclass Student: form_no name statusclass Student: form_no full_name statusgrades मोडतोfees मोडतो2 विभाग मोडतात — आणि दोघांनीही काहीच बदलले नव्हते
⏪ आधी

एकच मोठा Student class प्रत्येक office वापरत असे, म्हणून admissions साठी नवे field आले की report cards गुपचूप बिघडू शकत.

💡 काय

Bounded contexts म्हणजे विभाग: admissions, grades, fees, timetable, प्रत्येकाचे एक model आणि स्वतःचे शब्द.

⚙️ कसे

Code मधून वाचलेला context map 2 विभाग-ओलांडणारे corridors दाखवतो: grades आणि fees दोघेही admissions चा Student import करतात.

🎯 का

Admissions ने Student.name बदलले तर काहीही न बदलता 2 विभाग बिघडतात; ACL तो बदल दारातच थांबवतो.

🚀 पुढे

पुढचा धडा विचारतो विभाग कुठे ठेवायचे: एक मोठा हॉल, भिंती असलेली एक इमारत, की campus.

🧪 इथे करून पाहा — विभाग Student उसना घेतात — anti-corruption layer जोडा, मग Student.name चे नाव बदला

पूर्ण धडा 05 वाचा →

6 🏘️ Monolith, modular monolith, microservices

एक इमारत, भिंती असलेली एक इमारत, की कॅम्पस — आणि प्रत्येक शैलीची किंमत काय.

🧒 सोप्या शब्दांत

कतरिना चार विभाग तीन प्रकारे ठेवू शकते. एक मोठा हॉल सोपा, पण कागद मिसळतात. भिंती असलेली एक इमारत प्रत्येक office चे कागद वेगळे ठेवते. वेगळ्या इमारती प्रत्येक office ला आपल्या दिवशी बदल करू देतात. पण प्रत्येक प्रश्न म्हणजे campus ओलांडून फेरी. विद्यार्थिनीच्या प्रवेशासाठी 3 फेऱ्या लागतात, आणि काही निरोप पोहोचतच नाहीत.

📖 नवे शब्दmonolith — एकच unit म्हणून deploy होणारा एक program, जसा एक मोठा हॉलmodular monolith — विभागांमध्ये भिंती असलेला एक program, build च्या वेळी तपासलेलाmicroservices — प्रत्येक विभाग स्वतंत्र program, network वरून बोलणाराhop — एका service कडून दुसऱ्याकडे एक call, जसे enrol चे 3 hops
1monolith — एक मोठे सभागृहसगळीकडे कागद — कोणाचे कोणते?deployable units1स्वतंत्र deploysनाहीenrol ला लागतोएक database transactionसीमा कशानेच लागू होत नाहीत (कोणतीही खोलीकोणतीही खोली import करू शकते)2modular monolith — भिंती आणि दारेadmissionsgradesfeesवेळापत्रकफक्त कार्यालयाच्या खिडकीतून बोलाdeployable units1स्वतंत्र deploysनाहीenrol ला लागतोएक database transactionसीमा build-time check ने लागू होतात(धडा 09)3microservices — एक परिसरadmissionsgradesfeesवेळापत्रकप्रत्येक प्रश्न म्हणजे परिसरभर एक फेरीdeployable units4स्वतंत्र deploysहोenrol ला लागतोservices मधून जाणारी sagaसीमा network ने लागू होतात (वेगवेगळ्याprocesses)4🚶‍♀️ microservices म्हणून, प्रत्येक request इमारतींमधून चालत जाते (प्रत्येक hop ला 1 ms · 1000 पैकी 1 अपयश)प्रगतिपुस्तकgradesadmissionsवेळापत्रक2 hop · +2 ms · 99.8% यशस्वीmonolith / modular monolith: 0 hops · 100.0%शुल्क भराfeesadmissions1 hop · +1 ms · 99.9% यशस्वीmonolith / modular monolith: 0 hops · 100.0%enroladmissionsfeesवेळापत्रकgrades3 hop · +3 ms · 99.7% यशस्वीmonolith / modular monolith: 0 hops · 100.0%microservices स्वतंत्र deploys मिळवतात, पण त्याची किंमत hops, अंशतः अपयश आणि sagas ने मोजतात — modular monolith network शिवाय भिंती टिकवून ठेवतो
⏪ आधी

टीम गोंधळलेल्या monolith मधून थेट microservices कडे गेल्या, आणि गुंतलेल्या imports ऐवजी गुंतलेले network calls आले.

💡 काय

तीन शैली: monolith, build-time check असलेल्या भिंतींचा modular monolith, आणि network वरचे microservices.

⚙️ कसे

Microservices मध्ये enrol 3 hops चालतो: +3 ms आणि 99.7% यशस्वी; report card 2 hops, 99.8%; दोन्ही monoliths 100.0% वर.

🎯 का

Microservices 4 स्वतंत्र deploys देतात, पण hops, partial failure आणि sagas घेऊन; modular monolith भिंती फुकट ठेवतो.

🚀 पुढे

पुढचा धडा offices मधल्या फेऱ्यांऐवजी board वर एक सूचना लावतो: events, आणि थोडे मागे राहणारे read model.

🧪 इथे करून पाहा — एक request, तीन शैली — एका hop ची किंमत बदला
114

पूर्ण धडा 06 वाचा →

7 📌 Events & CQRS

सूचना फलक आणि display फलक — एकदाच publish करा, थोडे मागे असलेले model वाचा.

🧒 सोप्या शब्दांत

पूर्वी admissions नव्या विद्यार्थिनीबद्दल सांगायला तीन offices मध्ये जात असे. आता ती board वर एक सूचना लावते: 'दीपिका 5A मध्ये आली.' प्रत्येक office board वाचते आणि आपले काम करते. Library सुरू झाली की तीही board वाचते. हॉलमधील marks board थोड्या वेळाने अद्ययावत होतो, म्हणून तो 82.33 आधी 78.5 दाखवू शकतो.

📖 नवे शब्दevent — काहीतरी घडल्याची सूचना, जसे StudentAdmittedlistener — board वाचून सूचनेवर कृती करणारे officeCQRS — एका ठिकाणी लिहिणे आणि दुसऱ्या, तयार ठिकाणाहून वाचणेeventually consistent — थोडा वेळ मागे असलेली, आणि मग बरोबरीला येणारी copy
1🚶‍♀️ आधी: प्रवेश विभाग 3 कार्यालयांपर्यंत चालत जातोadmissionsgradesfeesवेळापत्रकप्रवेश विभाग 3 विभाग import करतोनवीन ग्रंथालय = चौथी फेरी, आणि प्रवेश विभाग बदलतो2📌 नंतर: फलकावर एक सूचनाStudentAdmittedदीपिका · वर्ग 5Aप्रवेश विभाग ती लावतो · 0 विभाग import करतोgradesगुणपत्रकउघडतोfeesखाते उघडतोवेळापत्रकवर्ग नेमून देतोlibraryचौथा listenerग्रंथालय फक्त वाचायला सुरुवात करते — प्रवेश विभाग बदलत नाही3📝 CQRS: नोंदवहीत लिहा, सूचनाफलक वाचा — जो थोडा मागे असतोकतरिनाचे गुण — write sideगुण 172गुण 285गुण 3903 गुण लिहिलेMarkRecorded 72लागू झालेMarkRecorded 85लागू झालेMarkRecorded 90प्रतीक्षेतसूचनाफलक · आत्ताकतरिनाची सरासरी78.53 पैकी 2 लागूजुने — शेवटी बरोबरसूचना फलक · catch-up नंतरकतरिनाची सरासरी82.333 पैकी 3 लागूबरोबरीला आले(72 + 85) / 2 = 78.5 → (72 + 85 + 90) / 3 = 82.33 · reads जलद आहेत, आणि eventually consistent
⏪ आधी

नवीन विद्यार्थिनी आली की admissions प्रत्येक office मध्ये जाऊन सांगत असे, आणि नवी library म्हणजे admissions मध्ये पुन्हा बदल.

💡 काय

सूचना फलकावर events, आणि CQRS: लिखाण नोंदवहीत जाते, वाचन display board वरून होते जो नंतर अद्ययावत होतो.

⚙️ कसे

StudentAdmitted(Dipika, 5A) 3 listeners पर्यंत पोहोचते; marks 72, 85, 90 लिहिले, 2 applied → 78.5, नंतर 82.33.

🎯 का

Events मुळे admissions 0 विभाग import करते आणि 4था listener काहीही न बदलता जोडला जातो; किंमत म्हणजे मागे राहणारे read model.

🚀 पुढे

पुढचा धडा विचारतो data कोणाच्या मालकीचा: सामायिक कपाट, खिडकी, की copy केलेली सूचना.

🧪 इथे करून पाहा — थेट calls विरुद्ध सूचना फलक — मग read model ला बरोबरीला येऊ द्या
2

पूर्ण धडा 07 वाचा →

8 🗄️ Data ची मालकी

सामायिक कपाट, एक खिडकी, की नोटिशीची प्रत — shared DB विरुद्ध API विरुद्ध events.

🧒 सोप्या शब्दांत

Fee पावत्यांसाठी accounts ला प्रत्येक विद्यार्थिनीचे नाव हवे. ती थेट admissions चे कपाट वाचू शकते, पण column चे नाव बदलल्याने 15 वेळा अडचण येते. ती admissions च्या खिडकीवर विचारू शकते, पण office बंद असताना 3 वेळा उत्तर मिळत नाही. किंवा प्रत्येक सूचना आपल्या वहीत copy करू शकते, जी 2 वेळा थोडी मागे असते.

📖 नवे शब्दdata ownership — आपले tables कसे दिसतील हे एकच विभाग ठरवतोshared database — अनेक टीम तेच tables वाचतात, सामायिक कपाटासारखेAPI — मालकाला खिडकीवर विचारणे; मालक उघडा असेपर्यंतच चालतेstale — अजून नव्या बदलापर्यंत न पोहोचलेली copy
1shared database — सामायिक कपाटadmissionsfees15अयशस्वी reads0जुने reads2बिघडलेल्या teams2API — काउंटरवर विचाराकाउंटरfees3अयशस्वी reads0जुने reads0बिघडलेल्या teams3events — सूचनेची प्रत घ्याnameबदललेfees ची स्वतःचीप्रत0अयशस्वी reads2जुने reads0बिघडलेल्या teams4⏱️ fees विद्यार्थिनीचे नाव 20 वेळा वाचते — tick 5 ला rename, ticks 10–12 ला admissions बंदनाव बदलले: name → full_nameadmissions बंद012345678910111213141516171819shared database✓✓✓✓✓✗✗✗✗✗✗✗✗✗✗✗✗✗✗✗API✓✓✓✓✓✓✓✓✓✓✗✗✗✓✓✓✓✓✓✓events✓✓✓✓✓oldold✓✓✓✓✓✓✓✓✓✓✓✓✓shared DB: fees चे SQL अजूनही `name` म्हणते → 15 अयशस्वी · API: admissions चालू असणे आवश्यक → 3 अयशस्वी · events: स्वतःची प्रत, 2 जुनेrun time ला call नाही पण पूर्ण schema coupling · करार आहे पण runtime coupling · स्वातंत्र्य पण जुनेपणा
⏪ आधी

प्रत्येक application त्याच tables वाचत आणि लिहित असे, म्हणून column चे नाव बदलायची कोणाची हिंमत होत नसे.

💡 काय

Data ownership: प्रत्येक table ची मालकी एका विभागाकडे; इतरांना तो shared database, API किंवा events मधून मिळतो.

⚙️ कसे

20 वाचनांत, tick 5 ला rename आणि 10–12 ला बंद: shared DB 15 वेळा अपयशी, API 3 वेळा, events 2 वेळा जुने.

🎯 का

Shared DB ने 2 इतर टीमचा code देखील मोडला; API runtime ला जोडते, आणि events ताजेपणाच्या बदल्यात स्वातंत्र्य देतात.

🚀 पुढे

पुढचा धडा एक inspector नेमतो जी प्रत्येक push वर आराखडा तपासते, कोणतेही नवे दार राहण्याआधी.

🧪 इथे करून पाहा — shared DB विरुद्ध API विरुद्ध events — rename, बंद पडणे आणि lag हलवा
510322

पूर्ण धडा 08 वाचा →

9 🔍 Fitness functions

कधीही सुट्टी न घेणारा निरीक्षक — build fail करणाऱ्या architecture tests.

🧒 सोप्या शब्दांत

कतरिनाने सुंदर आराखडा काढला. मग घाईत असलेल्या एका बांधकाम कामगाराने भिंतीत दार पाडले. म्हणून ऐश्वर्या इमारत निरीक्षक बनते. ती प्रत्येक push वर 6 नियम तपासते. आज 4 fail होतात, आणि नवे दार स्वीकारले जात नाही. 5 चुकीची दारे बंद केल्यावर सगळे 6 pass होतात आणि build हिरवा होतो.

📖 नवे शब्दfitness function — architecture चा नियम तपासणारी आपोआप चालणारी testCI — प्रत्येक push वर प्रत्येक check चालवणारी pipelinecycle — एकमेकांना import करणाऱ्या दोन rooms, जसे grades आणि dbexit code — check परत देणारा आकडा: 0 म्हणजे pass, 1 म्हणजे fail
1📋 ऐश्वर्याची checklist — प्रत्येक push वर चालते$ python3 arch/analyze.py checkimport cycles नाहीत1 cycle(s): domain.grades ↔ infra.dbdependencies आतल्या दिशेने जातात3 बाहेरच्या दिशेचे import(s)domain फक्त domain लाच import करते2 गळतीविभाग एकमेकांना import करत नाहीत2 cross-context import(s)प्रत्येक खोलीला fan-out ≤ 5 (main वगळून)कमाल 4 (web.views)domain instability ≤ 0.5I = 0.294 FAIL · exit code 12🔁 cycle: grades ↔ dbgradesdbimports connectimports Markदुसरीशिवाय कोणतीच खोली बदलू, test करू किंवा ship करू शकत नाही3🧱 पेरलेल्या 5 मार्गिका विटांनी बंद कराdomain.grades → infra.dbdomain.timetable → web.formatapp.enrol → infra.emaildomain.grades → domain.admissionsdomain.fees → domain.admissionsउपाय: ports, स्वतःचे models, किंवा helper हलवणे4🚦 build, आधी आणि नंतरआज — ship केलेला नमुनाgit pushunit testsarchitecture checkdeploy2/6 pass · exit code 1 — pull request अडवली जाते5 मार्गिका काढल्यानंतरgit pushunit testsarchitecture checkdeploy6/6 pass · exit code 0
⏪ आधी

Architecture चे नियम wiki page वर आणि एका senior engineer च्या डोक्यात होते, आणि इमारत आराखड्यापासून दूर जात राहिली.

💡 काय

Fitness functions म्हणजे CI मधील architecture tests: cycles नाहीत, आतल्या दिशेची dependencies, leaks नाहीत, विभाग-ओलांडणारे imports नाहीत.

⚙️ कसे

ऐश्वर्याचा check sample वर 6 पैकी 4 नियमांत fail होतो, exit code 1; 5 planted corridors काढल्यावर: 6/6, exit 0.

🎯 का

Build fail करणारा नियम drift त्याच दिवशी पकडतो, जसे grades ↔ db cycle, सहा महिन्यांनी नाही.

🚀 पुढे

पुढचा धडा इमारत चार zoom levels वर काढतो, आणि drawing code मधूनच बनवतो म्हणजे ते खोटे बोलू शकत नाही.

🧪 इथे करून पाहा — मार्गिका पेरा किंवा विटांनी बंद करा — 6 fitness functions CI सारख्या पुन्हा चालतात
550

पूर्ण धडा 09 वाचा →

10 🗺️ C4 model

कॅम्पसचा नकाशा, इमारतीचा आराखडा, मजल्याचा नकाशा — code मधून तयार होणारे text C4 model, आणि drift.

🧒 सोप्या शब्दांत

ऐश्वर्या ही नवी शिक्षिका शाळेत येते. कतरिना आधी तिला campus चा नकाशा दाखवते. मग इमारतीचा आराखडा, मग एका मजल्याचा आराखडा. तिने विचारले तरच, एका room मधली बाके. पण भिंतीवरचा आराखडा जुना आहे: त्यात बांधकामात नंतर आलेले 3 corridors नाहीत. म्हणून कतरिना इमारतीवरूनच नवा आराखडा छापते.

📖 नवे शब्दC4 model — चार zoom levels: context, containers, components आणि codecontainer — चालणारी किंवा data साठवणारी गोष्ट, जसे web app किंवा databasediagram as code — text म्हणून लिहिलेले चित्र, जसे 31 ओळींची DSL filedrift — चित्र आणि इमारत आता जुळत नाहीत, जसे 3 गहाळ arrows
11 · context — परिसराचा नकाशा22 · containers — इमारतीचा आराखडा33 · components — इमारतीचा नकाशा44 · code — एका खोलीतील बाकेपालककार्यालयीन कर्मचारीSchool appsoftware systemEmail serviceSchool appWeb appPythonDatabasewebappdomaininfraबाण imports मधून वाचलेलेdomain.portsGradeStore«abstract»Mailer«abstract»Ledger«abstract»5🧭 wiki वरील चित्र विरुद्ध code — driftwiki वरwebappdomaininfracode मध्येwebappdomaininfracode मधील 3 बाण wiki वर नाहीत: app → infra, domain → infra, domain → webउपायांनंतर: 0 drift — चित्र code मधून generate करा, किंवा CI मध्ये तपासा6📄 Structurizr DSL, 31 ओळी, generatedworkspace.dslworkspace "School app" { model { ... webapp = container "Web app" { app = component "app" ...app -> domain "imports (6)"app -> infra "imports (1)"domain -> infra "imports (1)"domain -> web "imports (1)"infra -> domain "imports (3)"web -> app "imports (3)" } views { ... }}
⏪ आधी

Wiki वरचा हाताने काढलेला box diagram दोन वर्षांपूर्वीचा आराखडा दाखवत होता, आणि नवीन लोक त्यावर विश्वास ठेवत.

💡 काय

C4 model: context, containers, components आणि code, Structurizr DSL text file म्हणून लिहिलेले.

⚙️ कसे

Analyzer 31 ओळींचा DSL लिहितो, ज्याचे component arrows imports मधून येतात, जसे app -> domain (6).

🎯 का

Wiki drawing मध्ये code मधले 3 arrows नाहीत: app → infra, domain → infra, domain → web; fixes नंतर 0 drift.

🚀 पुढे

पुढचा धडा निर्णय का घेतला ते लिहून ठेवतो, आणि पर्यायांना गुण देतो म्हणजे trade-off दिसतो.

🧪 इथे करून पाहा — code मधून generate केलेला component view — आणि wiki पासूनचा त्याचा drift

पूर्ण धडा 10 वाचा →

11 📓 ADRs आणि trade-offs

मुख्याध्यापिकेची नोंदवही — decision records आणि weight check सह ATAM-lite गुणांकन.

🧒 सोप्या शब्दांत

कतरिना मुख्याध्यापिकेच्या office मध्ये एक नोंदवही सुरू करते. प्रत्येक मोठ्या निर्णयासाठी ती परिस्थिती, निवड आणि त्याची किंमत लिहिते. टीम तीन पर्यायांना गुण देते: भिंती असलेल्या इमारतीला 42, एका हॉलला 35, campus ला 34. पुन्हा कधी विचार करायचा तेही ती लिहिते: वेगळे releases खूप महत्त्वाचे झाले तर.

📖 नवे शब्दADR — एका निर्णयाची छोटी नोंद: संदर्भ, निर्णय आणि परिणामtrade-off — एक गुण मिळवण्यासाठी दुसऱ्याचा काही भाग सोडणेweight — एखादा गुण किती महत्त्वाचा आहे, धड्यात 1 ते 3superseded — नव्या निर्णय-नोंदीने बदललेले, कधीच edit न केलेले
1⚖️ ATAM-lite: weight × score, एकावर एकmodifiability ×3operability ×3performance ×2deployability ×1scalability ×1modular monolith3×43×52×542monolith3×23×52×535microservices3×43×22×31×51×534scores 1–5 हा team चा निर्णय आहे; weights 1–3 scenarios मधून येतात2🎚️ deployability weight हलवा30405060mod. monolithmonolithmicroservices1234564 वर उलटतेdeployability weight (धडा: 1)3📓 मुख्याध्यापिकेची नोंदवही: ADR-0007 (14 ओळी)# ADR-0007: school app साठी modular monolithस्थिती: स्वीकृत## संदर्भ4 विभाग, 3 जणींची team, निकालाच्या दिवशी गर्दी.## निर्णयएकच deployable, विभाग म्हणजे modules, CI मध्ये तपासलेले (धडा 09).## परिणाम- प्रत्येक request ला एक database transaction- अजून स्वतंत्र deploys नाहीत- deployability weight 4 झाल्यास पुन्हा विचार करास्वीकारलेKatrinaस्वीकारलेला ADR कधीच बदलला जात नाहीचुकीचा ADR नव्या ADR ने SUPERSEDED होतो"revisit if" ओळ ते weight सांगतेजे निर्णय उलटवेल (4)
⏪ आधी

मोठे निर्णय meeting मध्ये घेतले जात आणि विसरले जात; एका वर्षाने एकच इमारत का आहे हे कोणालाच माहीत नसे.

💡 काय

ADR संदर्भ, निर्णय आणि परिणाम नोंदवतो; ATAM-lite पर्यायांना weighted quality scenarios नुसार गुण देते.

⚙️ कसे

5 scenarios, weights 1–3: modular monolith ला 42, monolith ला 35, microservices ला 34; ADR-0007 14 ओळींचा आहे.

🎯 का

Weights महत्त्वाचे: deployability चे weight 4 झाले तर microservices जिंकतील, म्हणून ADR नेमके तिथेच पुन्हा पाहायला सांगतो.

🚀 पुढे

पुढचा धडा चार terms मध्ये इमारत पाहतो: ती कशी बिघडते, कशी सुधारते, आणि route by route कशी बदलायची.

🧪 इथे करून पाहा — weights हलवा — दुसरा पर्याय कधी जिंकतो?
33211

पूर्ण धडा 11 वाचा →

12 🌳 विकसित होणारे architecture आणि संपूर्ण चित्र

वाढा, सडू नका — काळानुसार cycles आणि propagation cost, strangler fig, आणि संपूर्ण नकाशा.

🧒 सोप्या शब्दांत

Exam च्या गडबडीत बांधकाम करणारे shortcuts टाकतात. इमारत गुंतते: corridors चे 4 फेरे तयार होतात. पुढच्या term ला निरीक्षिकेचे checks ते सगळे काढतात. मग शाळा नवीन wing बांधते. ती जुनी इमारत बंद करत नाही. द्वारपाल एका वेळी एका प्रकारच्या पाहुण्यांना नवीन wing कडे पाठवतो, सगळे तिथे जाईपर्यंत.

📖 नवे शब्दarchitecture erosion — shortcuts मुळे इमारत हळूहळू आराखड्यापासून दूर जाणेpropagation cost — एखादा बदल इमारतीचा किती भाग गाठू शकतो, जसे exam rush मध्ये 49.7%strangler fig — पुढच्या दारामागे एका वेळी एक route असे जुने system बदलणेfacade — request जुन्या की नव्या भागाकडे जाईल हे ठरवणारा द्वारपाल
1📉 चार सत्रांतील इमारत — झीज, मग दुरुस्तीpropagationखर्च0%25%50%24.3%term 1पहिला आराखडा19 मार्गिका0 cycle(s)0 बाहेरच्या दिशेने13 खोल्या31.4%term 2ship केल्याप्रमाणे24 मार्गिका1 cycle(s)3 बाहेरच्या दिशेने13 खोल्या49.7%term 3परीक्षेची गर्दी29 मार्गिका4 cycle(s)3 बाहेरच्या दिशेने13 खोल्या22.2%सत्र 4checks + ग्रंथालयाची शाखा24 मार्गिका0 cycle(s)0 बाहेरच्या दिशेने15 खोल्यासत्र 4: तपासण्या (धडा 09) + ग्रंथालयाची नवी बाजू (2 नव्या खोल्या)2🌳 strangler fig: एक facade एका वेळी एकच route नव्या बाजूकडे वळवतेजुनी इमारतनवी बाजूstep 1/admin2%1/6step 2/timetable27%2/6step 3/fees42%3/6step 4/enrol47%4/6step 5/marks/upload55%5/6step 6/report-card100%6/6नव्या बाजूवरची traffic — लहान, मागे घेता येणारी पावले; जुनी इमारत अगदी शेवटीच काढली जाते3🧭 संपूर्ण चित्र1काय महाग आहे2कमी मार्गिका3एकदिशा मजले4core मध्यभागी5स्वतःचे शब्द6एक style निवडा7सूचना, calls नव्हे8आपला data आपल्याकडे9push तपासा10code मधून रेखाटा11"का" ते लिहा12वाढवा, सडू देऊ नका
⏪ आधी

जुन्या systems गोठवून एकाच big bang मध्ये पुन्हा लिहिल्या जात, महिनोनमहिने features शिवाय आणि धोकादायक weekend cutover सह.

💡 काय

Evolutionary architecture: प्रत्येक term ला झीज मोजा, आणि strangler fig ने जुने भाग एका वेळी एक route बदला.

⚙️ कसे

Propagation cost 24.3% → 31.4% → exam rush मध्ये 49.7%, नंतर checks सह 22.2%; routes 2% → 100% हलतात.

🎯 का

Checks झीज थांबवतात, 4 cycles पुन्हा 0 होतात, आणि लहान उलटवता येणाऱ्या पायऱ्यांमुळे शाळा चालू असताना नवीन wing वाढते.

🚀 पुढे

पुढे, scan() तुमच्या ओळखीच्या खऱ्या codebase वर चालवा: मजले मोजा, cycles शोधा आणि पहिला ADR लिहा.

🧪 इथे करून पाहा — झिजेची सत्रे, आणि strangler-fig route क्रम

पूर्ण धडा 12 वाचा →

धडा 01 सुरू करा → 🗓️ अभ्यास योजना (4 आठवडे) 📐 सर्व 12 धड्यांच्या आकृत्या 🧪 प्रश्नमंजुषा (16 प्रश्न) ⏮️ आधी काय होते & फायदे-तोटे