Thoughts from Sam Newman's - Microservices Data Decomposition Talk
I was fortunate to attend a great talk by Sam Newman on the above subject, here is a brief summary of the content and my thoughts.
First off, I should say that I went in to the talk regarding myself as "experienced" on the subject of microservices. I anticipated learning about the more complex "data decomposition" aspects rather than the basics. However I have to admit that even the fundamental points on microservice were still a benefit for me to hear. This is likely due to Sam being such a good teacher. I found myself somewhat re-learning topics which I hadn't anticipated.
Microservices and Backwards Compatability
Tolerant Reader Pattern
Services shouldn't over expose
Shared Domain Model should be avoided
"My general rule of thumb: don’t violate DRY within a microservice, but be relaxed about violating DRY across all services. The evils of too much coupling between services are far worse than the problems caused by code duplication."
JSON isn't the best for microservices
- It's human readable (but maybe you don't care if this is machine to machine)
- I'd argue that even if your service is purely machine to machine - human readable is a massive benefit for debugging
- Not compact
- Apparently it's about the same size as an xml representation - this surprised me.
Management Information / Analytical Data
Static Reference Data - Where to put it?
- Separate service - perhaps this is overkill but it guarantees a single view of the data. Clients can cache the data to speed things up.
- Copy Paste / Bundle it in every service. This can be achieved cleanly with a shared library. This might be good enough if you know the impact of the data being inconsistent. But make sure you are not creating services which have to be released all together.
"You won't appreciate the true horror, pain and suffering of microservices until you're running them in production"
- Sam has written Building Microservices: Designing Fine-Grained Systems which he referenced a few times. Given his great talk, I'll probably buy this soon.
- I also came across this talk which is well worth a watch by Sam https://www.youtube.com/watch?v=64w1zbpHGTg