Note
|
TODO, chapter under construction |
OK, but how do I get there from here?
-
Option 1: carve out microservices one by one
-
Option 2: refactoring inside your monolith
In either case, you’ll need to figure out what the correct Bounded Context is.
-
fork the repo and delete stuff that’s not in your bounded context
-
strangler pattern. can start with just an HTTP proxy
-
what are peloton doing?
What’s the problem with a monolith? there’s no domain model because everything is trying to be all things to all people
-→ you need to carve out bounded contexts and probably microservices
Is it that all the logic is hard to find because it’s mixed between all the layers?
-
introducing a Service Layer first
-
define use cases
-
messagebus can come later
-
push all the logic down into the models
-
-
once we have rich django models
-
migrate them one by one to POPO classes
-
add repository to translate
-
⇒ now we can refactor the model (semi/more) independently from the DB
-
-
and we can keep going and add UoW and a messagebus
-
now we have the event-driven / command handler pattern
-
almost any business requirement can be decomposed sensibly
-
-
get your system to produce events
-
consume them in your new service. we now have a separate db and bounded context
-
the new system produces
-
either the same events the old one did (and we can switch those old parts off)
-
or new ones, and we switch over the downstream things progressively
-
This is a part 2 thing really, but basically, don’t sally forth and implement your own event-driven microservices architecture without reading lots, lots more on the subject.
https://martinfowler.com/books/eip.hgirl rubytml[Enterprise Integration Patterns] by (as always) Martin Fowler is a pretty good start.