WESTERN GOVERNORS UNIVERSITY / COURSE D780
Software
Architecture
& Design
Task 2: Retail System Monolith-to-
Microservices Refactoring
Full Written Technical Exemplar
Architecture analysis, Flask APIs, refactored Python services, unit tests and GitLab
evidence guidance
2026/2027 Research Edition
Assessment verification notice
Independent original worked example. WGU's official Task 2 rubric, supplied Retail
System source files, and Test Cases document have not been obtained. No evaluator
approval or full alignment is claimed.
Accompanying source code is also available in the companion ZIP archive.
, RESEARCH EDITION 2026/2027
READER GUIDE
Purpose and verification status
This publication brings together the D780 Task 2 architectural report and complete original Python
source files in one searchable PDF. It follows a fictional Northstar Retail system from a single-process
monolith to four independently runnable Flask applications and a service-oriented checkout workflow.
4 Flask applications 9 Python source/test files
Catalog, inventory, order and orchestration All included in the appendices
domain tests API suite pending
Executed and passed on the present system Flask dependency not installed here; run in your own
configured environment
Evidence boundary: The official WGU Task 2 scenario, source code, Test Cases and exact grading
criteria were unavailable. File names, API routes, fictional SKU data, section labels, architecture choices
and test cases in this exemplar are illustrative. The Flask-dependent tests have not been executed
here.
Contents
1. Detailed written architecture report - analysis, options, microservice decision, patterns, risks and
rationale
2. Full implementation source - original monolith, validation and all four Flask service modules
3. Python unit and API tests - framework-independent tests and Flask client tests
4. Live checkout smoke test and dependencies - executable verification script and requirements
5. README and execution guidance - launch four local services, run test suites and review limitations
System overview
Retail client / POST /checkout
↓
Order orchestrator - Flask on port 5104
↓ HTTP / JSON API requests
Catalog Inventory Orders
Port 5101 Port 5102 Port 5103
Each domain service privately owns its in-memory example state. Not production persistence.
Original independent technical exemplar | Not official WGU rubric 2
, W G U D 7 8 0 / TA S K 2 E X E M P L A R RESEARCH EDITION 2026/2027
PART I / TECHNICAL REPORT
Architecture Analysis and Refactoring
Scope and evidence. WGU's public catalog describes D780's architecture and design-pattern
competencies. WGU MSSWE student accounts from July 2025, January 2026, April 2026, and June
2026 discuss a retail-system monolith-to-microservices refactor, API endpoints in a supplied Test
Cases document, GitLab branches, and a recorded code walkthrough. The full official Task 2 rubric,
WGU's Retail System source, and WGU's Test Cases document were not recovered. Therefore, all
scenarios, routes, data values, implementations, test cases, and section titles in this project are
original examples. This is not a ready-to-submit university task or evidence that an evaluator passed
it.
A. Analysis of the existing architecture (original
illustrative scenario)
Northstar Retail is a fictional retail operation. The initial application provides product lookup, stock
accounting, and order placement as methods and dictionaries on a single object. The source file
monolith_before.py illustrates that design. These are not WGU's original components.
The monolith runs in one process, and the RetailMonolith.checkout method performs several distinct
operations: it validates SKU and quantity, reads the product catalog, checks and decrements
inventory, calculates the payable amount, and creates the order record. This direct access to all three
dictionaries illustrates shared-state coupling. Although a single process has advantages—including
simple transactions if implemented with an actual database—it means pricing, stock, and order
responsibilities are not isolated behind application boundaries.
A requirement to change inventory reservation policy would affect the checkout module. A higher
frequency of product reads cannot readily be scaled independently from order writes. Shared in-
memory state would also be lost when the process terminates. These weaknesses make this fictional
application a useful instructional refactoring example. They do not mean that all real monoliths
should be decomposed.
B. Architecture selection and rationale
Selected architectural style: Business-capability-based microservices using synchronous HTTP
JSON APIs. The exemplar decomposes the original application into:
1. Catalog service: Product identification, display names, and price snapshots.
2. Inventory service: Available quantities, stock reservations, and release operations.
3. Order service: Creation and retrieval of order records.
4. Orchestrator facade: Coordinates the checkout operation and returns a single client-facing
result.
The four services can each run as distinct Flask processes. Each of the three domain services
privately owns its in-memory state, demonstrating the boundary even though real production
persistence is deliberately omitted. The orchestrator holds no authoritative domain store.
Original independent technical exemplar | Not official WGU rubric 3
Software
Architecture
& Design
Task 2: Retail System Monolith-to-
Microservices Refactoring
Full Written Technical Exemplar
Architecture analysis, Flask APIs, refactored Python services, unit tests and GitLab
evidence guidance
2026/2027 Research Edition
Assessment verification notice
Independent original worked example. WGU's official Task 2 rubric, supplied Retail
System source files, and Test Cases document have not been obtained. No evaluator
approval or full alignment is claimed.
Accompanying source code is also available in the companion ZIP archive.
, RESEARCH EDITION 2026/2027
READER GUIDE
Purpose and verification status
This publication brings together the D780 Task 2 architectural report and complete original Python
source files in one searchable PDF. It follows a fictional Northstar Retail system from a single-process
monolith to four independently runnable Flask applications and a service-oriented checkout workflow.
4 Flask applications 9 Python source/test files
Catalog, inventory, order and orchestration All included in the appendices
domain tests API suite pending
Executed and passed on the present system Flask dependency not installed here; run in your own
configured environment
Evidence boundary: The official WGU Task 2 scenario, source code, Test Cases and exact grading
criteria were unavailable. File names, API routes, fictional SKU data, section labels, architecture choices
and test cases in this exemplar are illustrative. The Flask-dependent tests have not been executed
here.
Contents
1. Detailed written architecture report - analysis, options, microservice decision, patterns, risks and
rationale
2. Full implementation source - original monolith, validation and all four Flask service modules
3. Python unit and API tests - framework-independent tests and Flask client tests
4. Live checkout smoke test and dependencies - executable verification script and requirements
5. README and execution guidance - launch four local services, run test suites and review limitations
System overview
Retail client / POST /checkout
↓
Order orchestrator - Flask on port 5104
↓ HTTP / JSON API requests
Catalog Inventory Orders
Port 5101 Port 5102 Port 5103
Each domain service privately owns its in-memory example state. Not production persistence.
Original independent technical exemplar | Not official WGU rubric 2
, W G U D 7 8 0 / TA S K 2 E X E M P L A R RESEARCH EDITION 2026/2027
PART I / TECHNICAL REPORT
Architecture Analysis and Refactoring
Scope and evidence. WGU's public catalog describes D780's architecture and design-pattern
competencies. WGU MSSWE student accounts from July 2025, January 2026, April 2026, and June
2026 discuss a retail-system monolith-to-microservices refactor, API endpoints in a supplied Test
Cases document, GitLab branches, and a recorded code walkthrough. The full official Task 2 rubric,
WGU's Retail System source, and WGU's Test Cases document were not recovered. Therefore, all
scenarios, routes, data values, implementations, test cases, and section titles in this project are
original examples. This is not a ready-to-submit university task or evidence that an evaluator passed
it.
A. Analysis of the existing architecture (original
illustrative scenario)
Northstar Retail is a fictional retail operation. The initial application provides product lookup, stock
accounting, and order placement as methods and dictionaries on a single object. The source file
monolith_before.py illustrates that design. These are not WGU's original components.
The monolith runs in one process, and the RetailMonolith.checkout method performs several distinct
operations: it validates SKU and quantity, reads the product catalog, checks and decrements
inventory, calculates the payable amount, and creates the order record. This direct access to all three
dictionaries illustrates shared-state coupling. Although a single process has advantages—including
simple transactions if implemented with an actual database—it means pricing, stock, and order
responsibilities are not isolated behind application boundaries.
A requirement to change inventory reservation policy would affect the checkout module. A higher
frequency of product reads cannot readily be scaled independently from order writes. Shared in-
memory state would also be lost when the process terminates. These weaknesses make this fictional
application a useful instructional refactoring example. They do not mean that all real monoliths
should be decomposed.
B. Architecture selection and rationale
Selected architectural style: Business-capability-based microservices using synchronous HTTP
JSON APIs. The exemplar decomposes the original application into:
1. Catalog service: Product identification, display names, and price snapshots.
2. Inventory service: Available quantities, stock reservations, and release operations.
3. Order service: Creation and retrieval of order records.
4. Orchestrator facade: Coordinates the checkout operation and returns a single client-facing
result.
The four services can each run as distinct Flask processes. Each of the three domain services
privately owns its in-memory state, demonstrating the boundary even though real production
persistence is deliberately omitted. The orchestrator holds no authoritative domain store.
Original independent technical exemplar | Not official WGU rubric 3