News for hackers. Stuff that matters.
Re:Uber migrates microservices to multi-cloud platform runni... by davidw on Sunday October 22, 2023 @10:25AM (#37975652)
I wonder what setting up a local dev instance is like for anything involving more than one or two of those.
Re:Uber migrates microservices to multi-cloud platform runni... by threeseed on Sunday October 22, 2023 @10:29AM (#37975689)
I've worked on a couple of extremely large micro services projects.

And the thing is that nobody ever needs to run the entire stack other than end to end tests which get run in the cloud.

You just checkout the services you need and because they are designed to be isolated the dependencies will usually be automatically stubbed out. So it's just a matter of running them or chaining them together if you have a particular scenario to test.

Re:Uber migrates microservices to multi-cloud platform runni... by plonk on Sunday October 22, 2023 @10:46AM (#37975815)
Is there typically a “cold restart” plan to rebuild the whole infra from scratch? I’m thinking of things like circular dependencies when services boot.
Re:Uber migrates microservices to multi-cloud platform runni... by nurple on Sunday October 22, 2023 @12:06PM (#37976576)
I've found that the eventual consistency provided by orchestrators like k8s solve this problem rather well. If the services are written using the right paradigms to handle such a situation, they will also be much more resilient to platform disruptions.

I like to view k8s a lot like erlang's OTP, if something isn't right with the state of a service, I advocate calling 'exit()' and letting the restart with exponential backoff handle the transient.

Re:Uber migrates microservices to multi-cloud platform runni... by cma on Sunday October 22, 2023 @10:53AM (#37975874)
Nobody needs to if they can't possibly.
Re:Uber migrates microservices to multi-cloud platform runni... by x86x87 on Sunday October 22, 2023 @10:54AM (#37975878)
Question for you: how does performance measurement and optimization work in that environment? Is the key some sort of meta tooling that understands relationships between microservices? How would you express such relationships in the first place?

Q2: How do you ensure the stubbed deps behave like the real thing?

Q3: how do you handle logging and metrics in an unified way across the stack? And related to this: how do you ever get to upgrade services crosscutting concerns that ideally are not invented in every service?

Re:Uber migrates microservices to multi-cloud platform runni... by joshmanders on Sunday October 22, 2023 @11:19AM (#37976116)
Not OP, but I worked on a large microservices based system at a leading financial institute and when we needed to work on a single service, we had docker compose files that pulled the images needed for the dependency services of that service for us to develop what we needed. They all just ran in our local docker. If we wanted we could have a massive compose file with all services in it, but typically we only needed the iam service and a few other small ones depending on what services we were working on.
Re:Uber migrates microservices to multi-cloud platform runni... by eddtries on Sunday October 22, 2023 @12:21PM (#37976717)
Q2 - techniques like contract testing help here, beyond simple stubs. Also, mocked services maintained by the services original devs you can work against help
Re:Uber migrates microservices to multi-cloud platform runni... by oooyay on Sunday October 22, 2023 @12:45PM (#37976929)
> how does performance measurement and optimization work in that environment?

SRE here. Generally speaking, each API or each service will have a contract that it must adhere to depending on upstream and downstream relationships and their fail safes. Each service (or API) will then load test in isolation.

After that, if you want to be really sure about regressions (which would include fail safes) you load test the whole thing put together.

> Is the key some sort of meta tooling that understands relationships between microservices?

This is quite hard to do when you have a lot of transactions. I don't think there's commodity software that does this because you'd need to configure that software to map on keys, then map those keys to services. Generally, the easiest way is to get engineering teams to declare upstreams and downstreams.

> Q2: How do you ensure the stubbed deps behave like the real thing?

Generally, generation. Something like protobuf or Open API generation will do.

> Q3: how do you handle logging and metrics in an unified way across the stack?

You issue high level standards like, "We'll use JSON logging with UTC time formatting". At the end of the day logging is very contextual and in a service ownership model the service owners are usually the ones reading and alerting on their logs.

> And related to this: how do you ever get to upgrade services crosscutting concerns that ideally are not invented in every service?

Shared dependencies. I'm not actually sure what's a cross cutting concern; generally services that are this small should be designed to operate mostly independently. They're small, but "microservices" tend to have a lot of fail safes built in. If you're referring to how do we not write 4000 config loaders then there's usually a team that builds a very generic config loader and everyone or a majority use it.

Re:Uber migrates microservices to multi-cloud platform runni... by thakoppno on Monday October 23, 2023 @12:31AM (#37981656)
> JSON logging with UTC time formatting

perhaps simplest, biggest impact in my log life has been adhering these principles.

Re:Uber migrates microservices to multi-cloud platform runni... by gen220 on Sunday October 22, 2023 @08:46PM (#37980378)
I've worked at a place that architected 100s of microservices pretty well, in a similar way that Uber apparently does.

Q1: (perf) these tools exist, the buzzword phrase is "distributed tracing". The relationships are actually not explicitly defined for the tooling to work, but rather inferred. Visualize a network call as a call-stack, where each service is a level in the stack. Jaeger (a CNCF project addressing distributed tracing) was coincidentally started by Uber.

Q2 (stubs): In my experience, mocked responses get you a long, long way. Typically the API response type that you're mocking is generated from a protobuf (or thrift, OpenAPI, etc.) file. If your dependency changes that type in a way that breaks your test, the CI platform will let them know.

If it's a more subtle change (like, it used to deterministically return 18 and now it deterministically returns 20), it's really on the service owners to communicate changes and grep the code base before making the change.

Q3 (logging/metrics): Typically by using shared "logging" and "metrics" lib for each language. Every service will typically be a gRPC service and accordingly a standardized + generated-from-protobufs set of metrics to Prometheus, by default.

Q4 (how to upgrade common libraries): this is definitely a tricky one. The answer is, basically, really carefully. Typically, you'll want your infrastructure to be compatible with vX and vX+1, and give teams a deadline to cut over from logging X to X+1. The couple of weeks before that deadline usually involves a lot of cat-herding and handwringing.

Re:Uber migrates microservices to multi-cloud platform runni... by dboreham on Sunday October 22, 2023 @09:18PM (#37980550)
What you are imagining happens (it's not pretty).
Re:Uber migrates microservices to multi-cloud platform runni... by jameshart on Sunday October 22, 2023 @12:09PM (#37976613)
In general in a micro service environment, you try to build things so that 1) you don't need to run other things locally, and 2) if you did need to, the services are just containers so it's pretty easy to run one.

But you tend to try to write your service so that it treats everything else it depends on like a vendor-provided API. Like, if you were building a Slack bot, you wouldn't ask Slack to let you pull down and run a local copy of Slack's API to test against. You'd maybe set up a test account in Slack's production system, and run your local bot against that to test it before you deploy it with credentials to run against your real slack account.

In a microservice architecture, you integrate with other internal systems in the same way.

Re:Uber migrates microservices to multi-cloud platform runni... by magicalhippo on Sunday October 22, 2023 @12:45PM (#37976928)
We're not big on microservices, but we do integrate with a lot of other systems.

I find the opaqueness of other services to reduce development speed quite drastically. With local code I can view both sides of the fence and easily see if I'm using it wrong or if it's a bug in my colleagues code.

Seems that if you're constantly developing against opaque services you'd end up in the same quagmire quite quickly?

Re:Uber migrates microservices to multi-cloud platform runni... by scarface_74 on Sunday October 22, 2023 @05:34PM (#37979286)
You shouldn’t care about anything outside of published contracts for dependencies. You’re slwags dependent on underlying APIs
Re:Uber migrates microservices to multi-cloud platform runni... by magicalhippo on Sunday October 22, 2023 @06:14PM (#37979573)
Of course I shouldn't.

But when things don't work as I expect, it's far more efficient to be able to view the code on both sides, rather than only on my own side and try to guess what the other side is doing.

Besides the usual suspect of wrong understanding on my end leading to misuse, this can also be due to lacking or wrong documentation of the other system, or bugs in the other system due to unexpected inputs or similar.

Like just a few days ago we spent an unreasonable amount of time with an API of one of our customers, where we would get empty list back for some of our queries. Turned out something in their service crashed when handed national characters, despite accepting JSON and hence UTF-8 input and nothing in the documentation about English letters only. Rather than returning 400 or 500, the service returned 200 with an empty list, leading us to assume we did something wrong.

Re:Uber migrates microservices to multi-cloud platform runni... by scarface_74 on Sunday October 22, 2023 @06:35PM (#37979695)
> But when things don't work as I expect, it's far more efficient to be able to view the code on both sides, rather than only on my own side and try to guess what the other side is doing.

Are you able to view the source code of your platform vendor? Everyone is at some level dependent on Black box APIs.

If you can document where with certain input you don’t get the expected output, you reach out to the team that is responsible for it whether internally or externally and they either explain it or they fix it.

This is the API service I’ve been working with over the past five+ years - three actually working at AWS (Professional Services).

https://boto3.amazonaws.com/v1/documentation/api/latest/inde...

I found a bug in one relatively new API that a service team released, I reached out to the team with a documented scenario and they fixed it.

Other times they explained what I was doing wrong. That’s what any large organization does.

I’ve worked with other vendors and internal teams plenty of times over the years.

Re:Uber migrates microservices to multi-cloud platform runni... by gen220 on Sunday October 22, 2023 @08:50PM (#37980397)
This is exactly why the "microservices" pattern is usually adopted along with the "monorepo" pattern. IMO, it's a strong anti-pattern to have the former without the latter.
Re:Uber migrates microservices to multi-cloud platform runni... by fizx on Sunday October 22, 2023 @12:26PM (#37976764)
Something like https://tilt.dev/ where you spin up a subset of the service graph in a cloud environment that hot-reloads based on local edits.
Re:Uber migrates microservices to multi-cloud platform runni... by aeyes on Sunday October 22, 2023 @02:44PM (#37977945)
Looks like they are shifting away from local development: https://www.uber.com/en-CL/blog/devpod-improving-developer-p...
Re:Uber migrates microservices to multi-cloud platform runni... by maronato on Sunday October 22, 2023 @06:28PM (#37979655)
When you want to run a local version of a service, you start it locally as normal and configure either local stubs of dependencies and dependents, or you can hook up the actual “production” services to your local service process. If doing the latter, you can create special user accounts and events that change how the networking routing happens. Events from those fake users pass through regular production apps up until the service you’re testing, then they are instead routed to your local version, and you can continue the calls to other prod services.

Uber employees’ apps are special and allow us to log in as these fake users and create fake rides or deliveries, and then we can look at the traces and logs to debug and stuff.