by vaidhy · 4y ago · 0 comments
The challenge most of the people outside of Amazon do not realize is that micro-service architecture imposes a heavy penalty on team co-ordination, esp. as the software matures. A large part of core services have been built over several years (and decades) and they have been architected to optimize for some operations at the cost of other operations. You can think of this as how you would design a DB schema. It is a trade-off between write speed, query speed and availability. Now, think about it happening at massive scale. As an engineer, you would spend a lot of time working/waiting on partner teams to prioritize your changes while under pressure to deliver. A lot of teams ended up building the pieces on their own into their own services leading to a larger maintenance and operational load.
From the outside, you are very likely to think that the team is bloated and slow-moving because you are assuming green field development. Internally, Amazon is a 25-year old legacy platform with almost no single vision across teams, tons of semi-duplicate functionality and heavy operational load. Keeping the lights on (KTLO) was a big ticket item on every annual plan I created when I was there.
This is, by far, the hardest scaling problem in SaaS: How do we divide responsibilities amongst our (code|services|teams) efficiently?
You can only grow each so much before they become unwieldy to manage.
Divide scope too much and communication becomes complex.
Divide along the wrong abstraction and you get duplication, overlap, and confusion about what's responsible for what.
And as time passes, decisions of the past constrain and complicate your options to redesign/rearchitect/reorg today.
There is no magical model for this, no buzzword, no single practice, because different businesses and use cases need to be adapted to it. But there's 70+ years of study into methods to do this, and I believe they're taught by all the business schools. It's just nobody wants to do the work.
....On the other hand, nobody teaches MBAs how drastically different tech is than other industries, and thus how you run your "factory floor" has to be different. But the basic principles above should still be applied; they just have to be adapted to the industry and work. What one should not do is just accept things however that industry does it, because they probably aren't doing the above principles either.
...which is a fairly obvious observation. "Bad <x> imposes a heavy penalty on team co-ordination" is generalizable.
I recommend you find a way to spend time with someone who knows how to design a quality microservices architecture. It will completely change your opinion about how microservices interact and the supposed "pain" therein.
That being said, Google for comparison does have good code re-use for certain core resources, like spanner, cloud, tensorflow, borg, etc. If you're talking about bedrock infrastructure like that, it's quite a different picture.
I think I am regurgitating mythical man-month here and will shut up.
Maybe I'm doing it wrong but I often find that doing a new greenfield project sounds easier but by the time you deal with all of the non-functional stuff (connectivity, resilience, logging, build tools, documentation etc) you might have been quicker holding your nose and bodging it in somewhere vaguely appropriate in an existing system.
In front end development people NEED the world's largest application frameworks (sometimes plural) because they cannot figure out state management. State management is stupid simple and a solved problem, but whatever. It will still, at the job, take you all day (maybe a week) to make that 30 second change.
If you try to bring up that the days work could be solved in less than hour if only we didn’t make all the wrong decisions and fear the platform they will look at you like you’re retarded. I have heard this mentality expressed perfectly in the movie Edge of Tomorrow: Don’t tell anybody. Are we clear? Best case scenario you’re gonna end up in a psych ward. Worse case you’ll get dissected for study
Here is the summary:
* You need a storage location
* You need a defined data structure to store your state data. I recommend storing everything in a single logical storage object, because 1 is simple and simple is good.
* You will need to update and save your storage object at the needs of your application. I do it on each user interaction, because this is cheap.
* On page load you will need to access your storage object and apply it to the user facing event handlers that create your state artifacts that otherwise normally execute in response to user interactions.
That’s it. Consider the problem from the goal and work backwards to the solution.