GP »Event-Driven Architecture in an eCommerce Application« (WS23)
In this project, an eCommerce application is to be implemented using a microservice architecture. In order to achieve the highest possible resilience and decoupling, the services should communicate asynchronously with each other based on events. The goal is to explore the asynchronous pattern, overcome “mental model”, and look for good programming practices along the way.
- Keywords
- event-driven architecture, domain-driven design, microservice, eCommerce, software architecture
- Study Program and Module Description
-
Master Digital Sciences (specialization Software Architecture)
(see also module description in the study program web site)
- Begin/End and Scheduling
-
Beginning of October - End of Feb 2024. Organized as an agile project with sprints every 2 weeks. Workload depends on the type of project, will be clarified at kickoff.
- Location
-
-
Room 1:
ThoughtWorks Köln, Lichtstraße 43i, 50825 Köln (We meet at the ThoughtWorks campus in Cologne. Call me (+49 176 8072 2689) by mobile phone in case you should run late)
-
Room 2:
Innovation Hub (Building LC7, the building to the right of the passage to Gummersbach station. The Innovation Hub is not not open to the public. However, the main entrance door is open during office hours. Come up to the second floor and ring the bell there. Please call me (+49 176 8072 2689) or a fellow student by cell phone if no one answers), see also
detailed directions
-
Room 3:
1708 (Building LC4 (library building). Room 1708 is our lab office space, with enough room for small workshops. However, the room is only accessible with by transponder. Thereore, please be at the door left of the library entrance (where you see the label "Kriminalkommissariat", since the Gummersbach police criminal investigation unit is our office neighbour :-). I will fetch you there. Call me (+49 176 8072 2689) or a fellow student by mobile phone in case you should run late), see also
detailed directions
-
Video conference link:
https://th-koeln.zoom.us/j/4425088059?pwd=bxHOJB7D3pBHdTpruFHSdC1Y66e9Rr.1
(only in exceptional cases and if explicitly communicated in advance for the day)
- Discord Server for fast Communication
-
Discord has been proven as a very effective platform for information sharing, discussions, and consultations. Therefore, please join the ArchiLab Discord Server at
https://discord.gg/YYNYb5whU8.
Navigate to channel
#rollenzuweisung
and click on
gp
.
Then you automatically get access to the channel(s) relevant for this module.
Problem Description
When making decisions within a software architecture, there is no right or wrong,
there are only trade-offs. This also applies to the communication between microservices.
In a previous project in the Coding Excellence (CEX) module, an attempt was made to find
out what are the trade-offs between synchronous and asynchronous communication, based on
events, between services using the microservice architecture of an eCommerce store.
As it turns out, it’s noticeably difficult to switch from a synchronous to an event-based
architectural style. It seems that our “software education” is preparing us to think in
a synchronous request / reply pattern. When switching to an asynchronous implementation,
this mental model needs to be overcome, or else we’ll implement a synchronous communication
pattern using asynchronous technology - and therefore will not work truly event-based.
The story so far can be examined in a
paper written in the module CEX.
Project Definition
An eCommerce application is to be implemented using a microservice architecture.
In order to achieve the highest possible resilience and decoupling, the services should
communicate asynchronously with each other based on events. Beside the event-driven
service architecture, the project is focusing on
- architectural patterns for event-based systems
- asynchronous test concepts (Test driven design, TDD)
- hosting / dev-ops approach (CI / CD), and
- security aspects (https/encryption, authentication)
The goal is to explore the asynchronous pattern, overcome “mental model”, and
look for good programming practices along the way. There should be even more unit tests
that in a traditional test pyramid and even less integration tests. This is because
in async/events, there is a larger proportion of business logic expressed as pure functions,
thus unit-testable.
The “ops” part of the project is explicitly part of the implementation, trying for a true
“DevOps” approach where the development team also tackles ops architecture and implementation.
Project Outcomes
The following outcomes should be delivered by the project:
- MVP with robust, near-production-level code
- Tests
- A delivery pipeline able to deploy the MVP to a laboratory environment, from day one
- Documentation with an assessment / reflection of the architectural patterns used;
special attention need to be paid to the Aggregate Rules in Vaughn Vernon’s “Red Book”
- Architecture Decision Records (ADRs) for the most important architectural decisions,
esp. with hindsight to the architectural patterns used
If there is enough time, the following aspects would be an interesting extension:
- Minimal observability capacity for microservices participating to the product
- Minimal identity and access management for microservices participating to the product
- Operational experimental setup able to demonstrate the resilience of the product under several service disruption scenarios
- Operational experimental setup able to demonstrate the resilience of the product under heavy payloads
Learning Outcome
- Understanding what a event based communication truly is
- Knowledge about microservice architectures
- Tradeoff for asynchronous communication between microservices with event-based message brokers
- Testing in a asynchronous environment (e.g. unit tests, integration tests, end2end, …)
- Knowledge in the Dev-Ops approach
- Learning from practitioners (Michaël and Wolf from ThoughtWorks)
Requirements for participating
- Solid coding experience in Java, .NET Core, or any other language suitable to implemented a microservice
- Interest in architecture patterns and good practices in coding
- Frontend or backend experience
- Experience with an event broker (Kafka) helps, but is not a must
External Project Partner
ThoughtWorks, with Wolf Schlegel and Michaël Le Barbier both working for thoughtworks.com
Grading
The grading for this Guided Project will follow the
general grading scheme for Guided Projects outlined here.
Both the quality and the effort part of the grading will be based on
- general code quality (clean code rules, SOLID principles, clean implementation of DDD building blocks),
according to a code review, and
- the project outcomes listed above.
Workshops
Tue 17.10.2023, 09:30 - 17:00: Kickoff Workshop at ThoughtWorks
Introduction to the project, to the domain, to the technology, and to the team
Workshop Location
Room:
ThoughtWorks Köln, Lichtstraße 43i, 50825 Köln (We meet at the ThoughtWorks campus in Cologne. Call me (+49 176 8072 2689) by mobile phone in case you should run late).
Goal of the day
The project is set up and ready to start.
Agenda
-
09:30 - 10:00:
Arrival at ThoughtWorks
-
10:00 - 10:30:
Goal of the GP and introduction to Thoughtworks (Wolf Schlegel, Stefan Bente)
- Goal of the project
- Introduction to ThoughtWorks (what do we do, why is this project interesting to ThoughtWorks, who of us is involved)
-
10:30 - 11:30:
Introduction (everyone)
- 4+1 statements methods
- What it needs to satisfy your audience when introducing yourself – and if you want to impress them
-
11:30 - 12:15:
Grading and Team Structure (Stefan Bente, Eberhard Schenk)
- Grading in project part
- Grading in Team Supervision part
- Team structure
- Time schedule and collaboration with DDD Master course
-
12:15 - 13:00:
Lunch Break
-
13:00 - 13:30:
Team identity or who are we as a team (Eberhard Schenk, Stefan Bente)
- Team Charter concept
- What is the agile "Definition of Done", and how are both concepts related to each other?
-
13:30 - 14:30:
VIST Model, and possible application in Agile Retrospectives (Eberhard Schenk, Stefan Bente)
- VIST – monitoring motivation and satisfaction of team members as a team (not as a boss)
- There is an option instead of VIST, VIST then being a homework. This needs additional 10-15 min, prerequisite is a room with some free space to move. It is based on constellations of systemic structures in organisations; Identifying and developing the driving forces in the team and its individual team members (M. Varga von Kibed). We will decide this in the workshop.
- What benefit has the agile retrospective, and how can it be related to the Team Supervision part of this GP?
-
14:30 - 14:45:
Break
-
14:45 - 15:30:
Introduction to eCommerce Domain and Technology (Wolf Schlegel)
- We will pre-define the bounded contexts for the teams, in order to get a quicker start
- The boundaries can be revisited later, after the joint EventStorming with the DDD course
- Introduction to the technology stack
-
15:30 - 16:30:
Taking DDD, Aggregates, and Domain Events seriously (Stefan Bente)
- We will take the "red book" by Vaughn Vernon as a guiding beacon for the project, when it comes to implementation of aggregates, and modelling of domain events
- Introduction to the "aggregate rules" by Vaughn Vernon; see dedicated info page
- What are domain events, and how do they relate to aggregates?
- Discussion
-
16:30 - 17:00:
Next Steps (all)
Mon 27.11.2023, 10:00 - 17:00: EventStorming Workshop
Organized by the DDD Master course, this workshop will bring together all teams of the GP and the DDD course, to collaboratively model the domain of the eCommerce application. We will use the EventStorming technique for this.
Workshop Location
Room:
Innovation Hub (Building LC7, the building to the right of the passage to Gummersbach station. The Innovation Hub is not not open to the public. However, the main entrance door is open during office hours. Come up to the second floor and ring the bell there. Please call me (+49 176 8072 2689) or a fellow student by cell phone if no one answers), see also
detailed directions.
Goal of the day
Domain events have been identified, and possibly inconsistencies in the bounded contexts boundaries.
Tue 28.11.2023, 10:00 - 17:00: Hackathon
The day will be used for coding and discussing architectural issues.
Workshop Location
Room:
Innovation Hub (Building LC7, the building to the right of the passage to Gummersbach station. The Innovation Hub is not not open to the public. However, the main entrance door is open during office hours. Come up to the second floor and ring the bell there. Please call me (+49 176 8072 2689) or a fellow student by cell phone if no one answers), see also
detailed directions.
Goal of the day
Ready to tackle the next sprints.
Wed 03.01.2024, 10:00 - 17:00: Hackathon
The day will be used for coding and discussing architectural issues.
Workshop Location
Room:
Innovation Hub (Building LC7, the building to the right of the passage to Gummersbach station. The Innovation Hub is not not open to the public. However, the main entrance door is open during office hours. Come up to the second floor and ring the bell there. Please call me (+49 176 8072 2689) or a fellow student by cell phone if no one answers), see also
detailed directions.
Thu 04.01.2024, 10:00 - 17:00: Hackathon
The day will be used for coding and discussing architectural issues.
Workshop Location
Room:
Innovation Hub (Building LC7, the building to the right of the passage to Gummersbach station. The Innovation Hub is not not open to the public. However, the main entrance door is open during office hours. Come up to the second floor and ring the bell there. Please call me (+49 176 8072 2689) or a fellow student by cell phone if no one answers), see also
detailed directions.
Fri 05.01.2024, 10:00 - 17:00: Hackathon
The day will be used for coding and discussing architectural issues.
Workshop Location
Room:
Innovation Hub (Building LC7, the building to the right of the passage to Gummersbach station. The Innovation Hub is not not open to the public. However, the main entrance door is open during office hours. Come up to the second floor and ring the bell there. Please call me (+49 176 8072 2689) or a fellow student by cell phone if no one answers), see also
detailed directions.