A Dev’s Journey: Microservices, DDD, Messaging Protocols (Part 1)

Jay Loo
bigjloo
Published in
3 min readOct 15, 2021
My journey on becoming a better developer

The project overview can be found here. ** insert link **

Goal 🔥

Learn core concepts of Domain-Driven Design, Microservices, and Messaging protocols.

Pre-project Questions 🙋

  • What are the benefits of using Microservices over other architecture designs and for what type of projects would it best suit?
  • When to use different APIs (RESTful/SOAP/gRPC/GraphQL)?

It's always exciting to start a new project.

But my past experience has taught me that what I have now in my mind will very unlikely be the end product. Below illustrates the emotions during a project.

Emotions over the course of a project

Right now at T = 0,☺️ will be at a high point.

Alright, let's get serious.

For DDD, I started off with Domain-Driven Design by Vaughn Vernon.

The book provides a high-level overview of what DDD is about but does not get boggled with implementation details. Towards the end of the book, the author gives a five-step process on modeling with DDD, which I found to be useful for the planning phase of my project.

Next book: Architecture Patterns in Python by Harry Percival, Bob Gregory.

Iteration #1:

Yeah, still a lot of work to be done for identifying the correct context and segregating them (just using front-end/back-end temporarily).

One thing that I learned from my past projects is that it is most definitely better to spend more hours at the start planning and getting things right than to have to make changes later on mid-way through the project.

Changes mid-way == No fun 🥺

* Note: I realized that I should be aiming to build software that can be easily modified, but unfortunately, these design patterns still don’t come as naturally as I wish.

Process:

  1. Model all the events that happen in a timely manner from left -> right. Have them named with a noun + verb in the past tense. (orange)
  2. Model commands that create those events. (blue)
  3. Model the aggregate/entities that handles the commands to create those events. (yellow)
  4. Identify context boundaries (TODO)
  5. identify views and other components (TODO)

The key part of the model would be the betting pool engine and the contract, which I will have to put more thought into before making further iterations.

To be continued…

I am always open to criticism and feedback. Please do contact me at junzhongloo@gmail.com if you would like to connect. Peace ✌️

--

--