News for hackers. Stuff that matters.
Re:The End of Microservices by DanielBMarkham on Thursday July 21, 2016 @04:02AM (#12135436)
It is a pure function call. There are no side effects, just a clear and simple input stream and a clear and simple output stream.

I agree with your characterization. All except maybe the "I'd probably write a quick JS viewer that can collapse stack traces" part.

Here's the thing: I'm so minimalist that I'm only going to add frameworks and libraries as a last result, if you stuck a gun to my head. I'm going to resist as much as I possibly can.

I love writing code. And every line of code I write has to be compiled, deployed, is prone to bugs, has version dependencies, and so on. Many times it adds unnecessary complexity to the solution. I love using cool frameworks and libraries. Same goes for them.

The magic here is that the vast majority of whatever you're doing? It's already been done. Use O/S code that's ran successfully for ten, twenty years. Write your own code only as a last result. Micrososervices shouldn't have more than 100 lines of code.

Yes, it's a function. Maybe 3 or 4 closely-related functions. If it gets past that level of complexity, refactor.

(The only thing I'd add here is that you'll end up factoring out common code as you go along. That code needs to be put into a shared corporate library, which also should be small, along with shared types)

When done well, you end up with the realization that you've been doing it wrong all along. When done poorly, you just make an even bigger mess than you did doing it the old way.

Here's one small example. I was writing a production project for some folks a few years ago. We needed some way of showing system status.

The old way could have used all sorts of things: logging systems, server metric systems, and so on. I would have probably done some research, downloaded a library or framework, set it up along the happy path, and made some really awesome html dashboards.

Then the library would change, or the metrics would be different, or the configuration would need tweaking, etc.

I figured out what we really needed to see was time/date stamps on certain files. So I pipe ls to a web file and chron it. Five minutes later it's working. It'll be working ten years from now. If we need something more complicated? We'll add it. One tiny little bit at a time.

I'm okay with calling that a microservice, since it's infrastructure code that needs to be deployed and maintained as part of the app. But it's really only a line of BASH.

Some people would say that what I did was completely trivial. These are people who do not understand what the hell is going on. That was a win. If I could have 5 or 10 microservices like that which provide business value? I'm freaking way ahead of the value curve as opposed to a similar team who's still slogging through 7,000 lines of mostly boilerplate code that does basically the same thing.

Re:The End of Microservices by nostrademons on Thursday July 21, 2016 @05:15AM (#12135681)
I'd agree philosophically that this is the right way to do it, but that's not what most people are speaking about when they say "microservices". They usually mean small independent servers communicating via RPC, each of which only does one thing. I'd say that this is pretty much the opposite of what you describe, since now each task needs the overhead of serialization, deserialization, marshalling, error-checking, process monitoring, etc.
Re:The End of Microservices by DanielBMarkham on Thursday July 21, 2016 @05:24AM (#12135712)
There's quite a bit of variability in what people mean when they say "microservice" I've read quite a few articles over the last few years that describe things as I just did.

However, you are correct. Most people are unable to get the cruft out of their head, so when they talk about microservices, they mean something like "exactly the way we used to do things, only with a few differences"

I was talking to a team last year that wanted to do microservices. They had a framework, a lot of tools, and were busy doing research, most of which consisted of reading fanboy posts and walking through happy-path tutorials.

When I started listening to what they were talking about in terms of an architecture? Wow! Too much to go into here, but one of the things was a "microservice" that at the beginning of the pipeline cleaned all the data.

Think about that. One "service" which was responsible for knowing every data type, performing all safety checks, and ensuring that all of the other services could run correctly. All in one place. You screw that one up? The whole thing is broken. You couldn't ask for tighter coupling.

And this, they thought, was better than a monolithic app.

I'm a big fan, but micoservices are going to make a huge mess in the industry that it will take decades to clean up. That's because most people doing them will think of them just as you suggested.

(Having said that, the ones who don't are going to run over everybody else in terms of productivity. Good for them and the orgs they work for)

Re:The End of Microservices by danmaz74 on Thursday July 21, 2016 @05:10AM (#12135662)
> I'm okay with calling that a microservice, since it's infrastructure code that needs to be deployed and maintained as part of the app. But it's really only a line of BASH.

I'm under the impression that most people wouldn't call that a microsevice. Moreover, isn't that solution completely dependent on the implementation of the code that is writing those certain files, without making this dependence explicit - and pretty difficult to test automatically?

Re:The End of Microservices by DanielBMarkham on Thursday July 21, 2016 @06:03AM (#12135831)
Actually no. No more than CSV dependency prevents spreadsheets from working with one another.

I think the key thing here is your word "explicit". There are lots of ways to make things explicit. The concerns of coupling and cohesion don't go anywhere. There are other ways to address them.

Testing is actually significantly easier, not more difficult.

Re:The End of Microservices by danmaz74 on Thursday July 21, 2016 @07:37AM (#12136150)
I'll take your words about testability and maintainability, but still, I'm not convinced this would be be considered a microservice by most proponents of the term:

> Like in SOA, services in a microservice architecture[1] are processes that communicate with each other over the network in order to fulfill a goal. Also, like in SOA, these services use technology agnostic protocols.[2]

https://en.wikipedia.org/wiki/Microservices

Re:The End of Microservices by 3minus1 on Thursday July 21, 2016 @12:56PM (#12138200)
> Micrososervices shouldn't have more than 100 lines of code.

I'd really like to see a non-trivial example of this because it's sounds ludicrous on its face