Live data from Hacker News

Building Microservices: Free Ebook from O’Reilly and NGINX

nginx.com

21–30 of 36 posts

Re: Building Microservices: Free Ebook from O’Reilly and NGINX

#21
post #18
post #14

One of the main problems with breaking up a system into many independent (micro?)systems is that you can't easily combine two or more systems into a logical transaction. Or, in other words, it becomes increasingly more difficult to do things atomically to the complete system. Is this problem covered?

As far as I understand microservices, these kind of issues must be solved by your architecture. Either the service is atomical, or the orchestration of your services must be in "flow", where no race conditions should occur.

It sounds like this is a difficult path to take. Especially considering the fact that, usually, system requirements may change over time.

Re: Building Microservices: Free Ebook from O’Reilly and NGINX

#22
post #21
post #18

Earlier quoted context omitted.

As far as I understand microservices, these kind of issues must be solved by your architecture. Either the service is atomical, or the orchestration of your services must be in "flow", where no race conditions should occur.

It sounds like this is a difficult path to take. Especially considering the fact that, usually, system requirements may change over time.

It absolutely is. It's for exactly these reasons why only highly organised and qualified teams tend to have substantial microservice deployments today.

It's also why I think[1] we need to start building a framework[2] to provide standardised solutions (or at least patterns) to some of these problems.

[1]: https://vimeo.com/118895501 [2]: http://wym.io/

Re: Building Microservices: Free Ebook from O’Reilly and NGINX

#23
post #14

One of the main problems with breaking up a system into many independent (micro?)systems is that you can't easily combine two or more systems into a logical transaction. Or, in other words, it becomes increasingly more difficult to do things atomically to the complete system. Is this problem covered?

The problem is covered in Chapter 5. There's isn't really a silver bullet, depends a bit on your use case. He outlines a couple of approaches:

* Try Again Later: queue failed parts of the transaction for retry, moving towards eventual consistency

* Abort the Entire Operation: On failure issue a compensating transaction to roll back the previous successes

* Distributed Transaction: have some overall governing transaction manager process that orchestrates consistency (e.g. duplicate the transaction process of your monlithic data store up in the application layer). You could do a two-phase commit where each participant in the distributed transaction tells the transaction manager whether it thinks its local transaction can go ahead. "A single no vote is enough for the transaction manager to send out a rollback to all parties."

For each of these approaches there are issues, obviously, and to his credit he's pretty even-handed about them. He also says:

"If you do encounter state that really, really wants to be kept consistent, do everything you can to avoid splitting it up in the first place. Try really hard. If you really need to go ahead with the split, think about moving from a purely technical view of the process (e.g., a database transaction) and actually create a concrete concept to represent the transaction itself."

He gives an example of a domain model for a retail company of an order-in-process: instead of attempting to capture a user's order as a single database transaction, model the concept of an order flow of through fulfillment, shipping, marketing, accounting, etc.

Re: Building Microservices: Free Ebook from O’Reilly and NGINX

#24
post #14

One of the main problems with breaking up a system into many independent (micro?)systems is that you can't easily combine two or more systems into a logical transaction. Or, in other words, it becomes increasingly more difficult to do things atomically to the complete system. Is this problem covered?

A concrete example we've faced. A certain operation requires writing data to N flaky services. You successfully write to N-1 of them, but the Nth fails. Now what do you do? If these N things were just database writes to the same DB, transactions would save you, as you could just rollback. Without that, the answer has to be handled in code -- do you reverse the previous changes (if possible) by sending delete events,…

On my phone so boo cite. Look up Amazon apologetic computing. They also have a presentation describing their general distributed approach. The main thing is that you have a bunch of components that you expect to fail. If they don't get confirmation, they send another message to the next component. Then, there's a stateless, unambiguous way to determine which message "wins" in case of conflict. For instance, an order submits two shipping requests for the same order. They use, for instance, the highest message ID (a GUID) to avoid duplicate processing.

It's all very neat, though I'm doing a bad job explaining. Search for Amazon architectural presentations and hopefully you can find it. It may have been on James Hamilton's blog, maybe.

Re: Building Microservices: Free Ebook from O’Reilly and NGINX

#26

Related: I'm recording myself code up a new microservices hobby application. I'm doing the whole thing, from selecting a domain name to services orchestration (much later, of course). The technology stack is F#, Mono, .NET, ubuntu, AWS, BASH, Apache. We're talking about architecture, design, user stories, TDD, philosophical differences between traditional OO coding and FP coding and more. It's all free. If you're int…

I'm looking forward to this. We're about to embark on a (probably) .Net-based microservices project, although we'll probably use C# rather than F#. One thing I've found is that infrastructure stuff abounds for Java-based projects, doing much work for the message bus, metrics, and logging. But I find much less available for .Net, particularly for the latter two. Maybe you'll find some stuff that'll help me.

What are your reasons for using C# over F#?

Re: Building Microservices: Free Ebook from O’Reilly and NGINX

#27

Earlier quoted context omitted.

Being old and cantankerous, my feeling is that we've tooled up about 400 times more than we need for microservices and the cloud -- a good programmer could/should be able to construct and maintain most small-to-medium-sized projects without a lot of third-party tools. As an Agile coach, what I find interesting is conveying the philosophy of the work . I am nowhere near being a code ninja any more, but the way you thi…

I suspect that getting our developers to embrace not only this new architecture, but also the new paradigm of functional programming is a bridge too far. Regarding the "full-bore bus" question, I see it being that way for two reasons: 1. Distributed architecture. I think that the way to foster simple deployment of updates services is making them distinct deployable units, and the most obvious way to do that is to put…

What I should do, once I finish up the basic functionality (which could take a month or two working part-time), is copy this over to an empty box(es) and pound the hell out of it; see how much volume it can handle.

My gut tells me the Ubuntu O/S can take quite a bruising. It'd be interesting to find out. Also there'd be some good lessons in there :)

Remember, the goal of microservices is to completely decouple processing so that you can completely configure the cloud graph any way you'd like. A microservices OO construct by definition would have to do a lot of honking around with the CPU before we got to the "work" part.

Of course what works for one team wouldn't work for another. Fun stuff to play around with, though.

Re: Building Microservices: Free Ebook from O’Reilly and NGINX

#28
post #7

For what it's worth, this is the first three chapters, not the full e-book. It's in the fine print.

I know it's narrow minded, but I was bummed that I had paid full price for the epub. Making a couple of chapters available for free is a great way to promote a good book, let the material talk for itself!

Re: Building Microservices: Free Ebook from O’Reilly and NGINX

#29
post #7

For what it's worth, this is the first three chapters, not the full e-book. It's in the fine print.

It would be good if the mods (or submitter) could change the title to reflect this, I think that a few people might be upvoting before they actually try to download the book and realise that it's not the full version.
Post reply on HN