Live data from Hacker News

Service-Disoriented Architecture

bravenewgeek.com

41–46 of 46 posts

Re: Service-Disoriented Architecture

#41
If you read original Service Oriented Architecture papers from IBM or the original Microservices bliki that Martin Fowler and his team wrote, you'll see a lot of really smart ideas that sound really groundbreaking and feasible.

If I recall correctly, the original SOA vision focused a lot on creating a services catalog and ecosystem, with service location transparency, and loose-coupling between services, yellow pages for advertising and discovering services, and the calling interface formed a contract between caller and provider.

It seemed like a new combination of ideas that could change how software was delivered, but the vision was really tough to realize ... like, how do you bind to a service when its location can change? There was a lot of blind alleys to run down trying to solve that, and ultimately the vendors trundled out their Enterprise Service Bus products. These provided mediation, transparent failover, and quality of service. ESB servers were a new single point of failure, and deploying to ESB's was incredibly painful since you couldn't commit the configurations to source control easily, but you could get that transparency as originally advertised.

And it seemed like everything else in SOA was like that. A lot of solutions begging for problems, or incredible complication that inevitably required massive vendor products to implement - which also led to atrocious runtime performance/instability due to shovelware vendor code.

The Microservices bliki read to me like a reboot of SOA - but a really good reboot. Gone were the service catalogs. And in was discussions of how to organize teams around code/features. There was the whole novel versioning scheme, where multiple versions of a microservice could be deployed simultaneously. And deployed code was immutable - you would never redeploy or modify the code of a version, you'd just deprecate and release another version.

All this stuff screamed "PRODUCTIVE" to me, and was more a return to patterns and not leaving gaping voids in the description for vendors to fill with more shovelware.

It just turns out that software components are tougher to work with and maintain the further away they are from each other.

You can have two components A and B, where A depends on B. A and B are in the same code repository, just kept in separate folders. Doing this is handy because you can do refactorings against A and B and it's easy to keep them in sync. Perhaps A and B are built separately with different build scripts, but they get deployed together and they are versioned together.

Now let's move A and B into their own code repos. Now refactoring is a bit more difficult because now you have to make sure to keep A and B in sync. Why did we put A and B into their own repos? Because the boss is convinced that this separation was critical because he worked at Oracle awhile back (huh?) So, versioning is now an issue too, A has to refer to a version/range of B that it wants. Needless busy work, but alright!

Now that we have our sea legs, we can go ahead and build and deploy A and B as independent microservices: A expects particular versions of B to be deployed, and A calls B via HTTP RESTful service calls. Refactoring is now officially painful, it requires a lot of negotiating between teams. B is required for A to function, the A team has to produce a client library for calling B that issues proper maintenance alerts when B is unavailable. Does B really need to be a microservice and are HTTP calls to it justified? PAIN PAIN PAIN! Hey, couldn't B just be a library that gets called by A and not get its own microservice? (NO! Because Oracle!) That is where the whole "Monolith" discussion starts.

I fault Fowler for painting a rosy SOA'esque picture initially, but I can't fault him too much. The original Microservices discussion he helped launch was really refreshing. It felt doable, it felt scalable, and it felt patterny instead of tooly.

Maintaining service contracts and encouraging intra-team friction is going to hurt agility, and it's a miss that he didn't call that out originally. So, I'm calling you out Martin Fowler: your good idea wasn't a panacea!

Re: Service-Disoriented Architecture

#42
post #14

I will be the guy bringing Erlang (or more precisely BEAM -the Erlang VM- and the various languages that run on top of it) into this thread... But it's amazing how much Erlang got right so long ago. Erlang applications are effectively fine-grained, Service Oriented, with a very low overhead. There is, of course, one drawback: you loose the low overhead advantage as soon as you step outside of the Erlang world. That's…

Let me take your point even further: it is some principles of functional programming that make these languages a great fit for "refactoring" and "breaking apart the monolith".

Myself I'm more into Haskell. I see similar benefits in both Haskell and Erlang. A nice thing of Erlang is that you have to structure you application as a bunch of services from the start.

Re: Service-Disoriented Architecture

#43

Earlier quoted context omitted.

I've seen a couple of codebases now that have coded themselves into corners and made it nearly impossible to go microservices without a major rewrite. - avoid code sharing wherever possible. It creates an implicit dependency. (If you have a common library or util file, you've done it wrong. try again.) - don't merge your trees: (ie: each component in the code should have it's own readme and tests folder.) - write far…

> avoid code sharing wherever possible Err, wut? It sounds like you are saying that pretty much the one reliable guideline in the history of software has become a bad idea. (I have come across places in my career where code sharing was not worthwhile, but they have been rare. And I frequently regretted the decision later.)

if you are going to try and separate them out into services later, you need to have the code as compartmentalized as possible.

Otherwise when you eventually split them out, you will end up being in a situation where each service needs copies of all the files it required before.

This then is a situation where you will have to extract into a library, and make general enough to be used and versioned that way.

Re: Service-Disoriented Architecture

#44

Earlier quoted context omitted.

> avoid code sharing wherever possible Err, wut? It sounds like you are saying that pretty much the one reliable guideline in the history of software has become a bad idea. (I have come across places in my career where code sharing was not worthwhile, but they have been rare. And I frequently regretted the decision later.)

if you are going to try and separate them out into services later, you need to have the code as compartmentalized as possible. Otherwise when you eventually split them out, you will end up being in a situation where each service needs copies of all the files it required before. This then is a situation where you will have to extract into a library, and make general enough to be used and versioned that way.

People have been building multiple applications from a single codebase for a very long time. Put all the targets on a continuous build, add tests, and you're set.

The only sense in which versioning matters at all is that if the protocol the applications talk to each other over has to be versioned, and an application must understand the oldest version of the protocol they could potentially be spoken to over.

But things like Thrift and Protocol Buffers have this feature built in. You shouldn't need to version the actual code...

Re: Service-Disoriented Architecture

#45

Earlier quoted context omitted.

if you are going to try and separate them out into services later, you need to have the code as compartmentalized as possible. Otherwise when you eventually split them out, you will end up being in a situation where each service needs copies of all the files it required before. This then is a situation where you will have to extract into a library, and make general enough to be used and versioned that way.

People have been building multiple applications from a single codebase for a very long time. Put all the targets on a continuous build, add tests, and you're set. The only sense in which versioning matters at all is that if the protocol the applications talk to each other over has to be versioned, and an application must understand the oldest version of the protocol they could potentially be spoken to over. But thing…

the question is about building an application that is easier to split into microservices later.

it all comes down to this - http://www.infoq.com/news/2015/01/microservices-sharing-code

If you have multiple components that are depending on the same code, if you try to split them into multiple services that are being independently deployed, you need to keep the code they are depending on in sync.

So making a change to the code shared by multiple services, means you have to deploy multiple services for a single change.

I completely agree with you about the protobuf/thrift angle though. If you're in that situation, you are already doing it right.

Re: Service-Disoriented Architecture

#46

Earlier quoted context omitted.

I've seen a couple of codebases now that have coded themselves into corners and made it nearly impossible to go microservices without a major rewrite. - avoid code sharing wherever possible. It creates an implicit dependency. (If you have a common library or util file, you've done it wrong. try again.) - don't merge your trees: (ie: each component in the code should have it's own readme and tests folder.) - write far…

How do you deal with business logic getting updated correctly across all modules that write to the database without some shared file or library?

once again, the question is about how to write a system that can be more easily split into microservices later.

I would separate business logic into a single service and have all other modules call that using a standard protocol like REST or thrift or something.

The issue is that if that logic is being executed all over the system already, it's going to be difficult to break it into a separate service that doesn't do that

Post reply on HN