Well, why is the business logic in a monolith? Because of feed. Because fundamentally, you cannot separate the concerns of the Facebook application, the app that you opened. Because you're in a feed, and you see a story about Nick attending this event, and you see a photo that I posted. And you see the fact that Danielle checked in someplace. And all of these sort of things that could presumably be independent services, they do inherently. You cannot separate those concerns. And I exactly sort of shared in a second, which is, if you've got 10 microservices, and they all have the same API, and everyone goes, of course these have the same APIs. Well, how did you actually separate those concerns there? If those 10 things fundamentally need to relate, if the interaction between those 10 services can't be decoupled, they can't be decoupled, and yet we chose to decouple them. And on the other hand, if you can decouple them, it's like, these two graphs are independent, I actually have no idea what value you would get by putting them into the same GraphQL API. That feels sort of like a false dependency.
There is a little more... I think sometimes reality ends up being a little... It's a little harder to say upfront, are we going to be dependent on each other, or are we never going to talk to each other? It's hard to say, right? What we've seen from people is where we've seen separate kind of LOBs, right, or lines of business adopt that, adopt kind of GraphQL, get very productive with it. But then suddenly this team realizes, oh man, there is some data that that team has, which if I had, it'd be amazing. And now suddenly they're like, oh my goodness, what do we do, right? How do we set this up together? We have to build some things. I wish we didn't have to build this, right? So there's a little bit of the natural dirtiness of life that gets in where things are not clear and people don't know how to do things that make it a little bit harder to think about what should be what upfront, right? Especially in teams, which, especially in teams where the organizational structure, promoted autonomy rather than collaboration, right? If you think about with microservices, what's happening is you're having organizations that promote autonomy. With Monoliths, quote unquote you have organizations that are promoting collaboration, right? It's two sides of the, it's the same thing, but a little bit different, right? So, so I think, I think that kind of complicates that it makes it a little bit harder for people to choose upfront, right? So there's some interesting things there. To Nick's point, though, one thing I'd like to add is I like our crazy idea or hypothesis is that there are some kinds of business logic that you can actually absorb into that GraphQL layer that is repetitive that maybe you don't have to repeat again and again, right? And, and for us, our gut feeling is that authorization, when related to data and caching, are two infrastructural, almost concerns, but still concerns that every single developer has to deal with, that could be brought into a common layer, right? So that's kind of the lens that we're taking. Whether it's not necessarily a GraphQL lens, but it's kind of a lens of, like, this is repeat work that we're doing across a bunch of people that maybe we can bring somewhere, right? Which is a type of business logic that can be made common across a large number of people, right? So it would be interesting to kind of see how that evolves, of course. I'd like to hear Danielle's thoughts on this, because I feel like, as a Apollo employee, you're dealing with the kind of aggregating microservices problem a lot.
Yeah, I think where the microservice and federation model shines is like close to what Tanmay said when you have different teams or lines of business that want to have autonomy yet have things that relate to each other and still want to be able to bring those things together. So, I mean, even inside Apollo, we build a big SaaS tool, we use federation, and we have this debate all the time, like, we have some microservices, but we don't have, you know, four teams working on them. We have two and we're like, why do, why did we split these things up? In some ways, we're creating more overhead for ourselves than is beneficial. But in other cases, you know, when you have another team that's entirely independent of you, that's running services that don't relate to you, you're not on call for them, you don't want to be responsible for them. Yet you still, in abstract, think that it's a good idea for those two services to go into the same graph. Then that's where something like federation, I think, shines and kind of enables you to contribute to the same overall thing, while letting teams remain autonomous and keep their own life cycles. So yeah, I mean, it's all like, it depends, right. It depends on what you're trying to do, what's right for you, how your organization is structured. Yeah, it's the messiness in humans. Awesome, that's fantastic.
Comments