41 points · by ciguy · 8y ago · 11 comments
We are considering moving to Kubernetes, as ECS has a lot of limitations in the deployment/resiliency area that come more or less standard with Kube. As part of this move we are looking at using a service mesh to enable easier cross region routing on AWS and more dynamic load on various clusters.
We were looking into Linkerd as a possible solution, but just noticed that Consul latest release has a service mesh feature now. So for those who've run a service mesh before, what sort of things should I be considering as we evaluate our options? Pros/Cons of specific tools, or service mesh in general are welcome.
However, there are a ton of techniques you should consider before you go to a service mesh:
* canary deployments / rolling updates / etc. * monitoring via APM, distributed tracing, etc. * health checking / auto scaling via Kubernetes or equivalent
(I actually wrote an article about this recently that will be published in InfoQ, but it's under embargo. If you ping me, I can send you a not-for-public-yet version.)
I'd love to see the article, will email you.
Say you have a service that updates two others within the same call. A write "fan out". What happens if one of the writes succeeds and the other fails? Since they don't share the same transaction boundary you need to implement rollbacks yourself. One for every single call you fan-out to. For writes to two services you need to write two rollback mechanisms to handle cases where either call fails.
But it gets even worse. What if the service doing the fan-out dies when its only made one of the two calls, and that first call succeeds? Well now you have no way to rollback, so the next step is to persist "fanout status" to durable storage as each call succeeds.
But it gets worse still... What if you get a service loop? So you write to one service which writes to another and that third service asks your service something all within the same call. WTF is the global view of data consistency when this happens? There isn't one, its undefined behavior.
If you go down this rabbit hole far enough you end up writing your own global database to synchronize everything. The proper way to do "microservices" is to share a datastore so it can handle the transactions and rollback for you. But once you share a datastore, why not just build a monolith that can horizontally scale easily?
I get that some companies are writing services with their own datastores, I've worked on several of these projects myself. They have all been a data consistency nightmare. Write your services like Google does, "monoliths" running hundreds or thousands of instances all connected to the same database that scales in the same way.
What was the driving factor in choosing a service mesh?
I know there are other ways to do this, but they all seemed clunky in comparison. Care to share any pros/cons of mesh solutions you've used?
https://landscape.cncf.io/selected=kubernetes https://landscape.cncf.io/selected=linkerd