Live data from Hacker News

New View of Microservices

github.com

31–40 of 41 posts

Re: New View of Microservices

#31
post #9

Earlier quoted context omitted.

http://blog.plataformatec.com.br/2015/06/elixir-in-times-of-...

Question: on a scale of Go to Haskell, how long on average does it take for devs only familiar with a couple of imperative languages (e.g. two of Python, C, Java or Ruby) to learn Elixir to the point that they can be productive with it?

I would have to disagree with the other responses to this question. However, I cannot disagree completely. Learning Erlang/Elixir is a subject full of nuance.

Learning the procedural aspects of Erlang or Elixir is very easy. In that sense I agree with the previous responses. Erlang gets a lot of bad rap for the syntax. But, it is really no more difficult that any other language to learn. The syntax can easily be learned in a day. Elixir's syntax can be learned even more quickly because it looks a lot like Ruby or Python. Thus, you can certainly start write scripts in Erlang or Elixir relatively quickly. My guess is that the average, experienced developer could start writing basic scripts in an hour or two. However, those scripts would be entirely procedural in nature, unless they are already very familiar with functional programming and pattern matching.

The first hurdle in Erlang/Elixir is the functional aspects of the language and understanding the power of pattern matching. Both of these require rethinking how you build a program. But, both of these are also incredibly, incredibly worthwhile and powerful. Elixir in particular is a great medium for better understanding these concepts because it is a very approachable language. Getting over this hurdle did not happen over night for me. I rarely used recursion in Ruby or Javascript (there is no tail call optimization). On the other hand, in functional languages recursive functions are the norm. I learned to really love them with Erlang/Elixir and now it frustrates me when I can't use them elsewhere because it has become much easier for me to reason about recursive functions than loops. Overall, functional programming and pattern matching are amazing things to learn but really grokking them won't happen over night.

The next hurdle with Erlang/Elixir is understanding OTP. This is THE incredibly powerful aspect of the Erlang VM. However, it is also not an easy subject matter to approach unless you already have a strong background in distributed systems. I did not. Hence, it took me a while to compose programs that actually used the Erlang VM for what it was built for, OTP. Thus, this portion of the Erlang/Elixir learning curve felt long and slow. I was not used to spawning new processes on a whim and passing messages back and forth. Initially I would send messages only one way without realizing that the appropriate pattern is to view it in a standard server-client relationship where there should always be a request and a response. Eventually I started viewing all the little applications running inside my larger program as self-contained capsules/servers that communicated among each other. However, it took me weeks of really intense study to get comfortable with. But, once you get comfortable with OTP you have a lot of built-in power (people rarely mention Mnesia, DTS, ETS gen_server but they are awesome).

Overall, my experience with Erlang/Elixir has shown me one big thing: pick the best tool for the job and there are a lot of jobs that you don't need OTP for. When you need to build Whatsapp, you should pick Erlang/Elixir. When you want to build a simple web app that only has a couple of end points and much of the dynamism is handled on the front-end, use Go, Node, or my personal favorite Clojure. Erlang/Elixir shine in the context for which they were built. But, they are not built for everything. And, if you only want the procedural aspects of the languages, there is no reason to choose them over Go, Node, Clojure, or Scala...all of which have solid approaches to concurrency.

Re: New View of Microservices

#32
post #18

OT but can someone give me an example of some microservices in a normal application? I'm really stuck in the mindset of doing everything as a monolith and have a hard time imagining how I could split things up in microservices.

Not to self promote, but I provided some examples in a blog post for Codeship a month ago.

https://blog.codeship.com/exploring-microservices-architectu...

Re: New View of Microservices

#34
post #18

OT but can someone give me an example of some microservices in a normal application? I'm really stuck in the mindset of doing everything as a monolith and have a hard time imagining how I could split things up in microservices.

Not to self promote, but I provided some examples in a blog post for Codeship a month ago. https://blog.codeship.com/exploring-microservices-architectu...

Great blog post, thanks for sharing.

Re: New View of Microservices

#35
post #2

> The most critical thing is being able to use any services locally or remotely without knowing the difference or changing the code. I thought we all agreed CORBA style location transparency was a bad idea? https://en.wikipedia.org/wiki/Common_Object_Request_Broker_A...

And then we agreed that location transparency was bad in RMI, and then again in EJB. It's regular as the tides. In a couple years you'll hear everyone talking about how stupid the Cloud is and everyone will be buying their own servers. Then we'll decide that peer-peer is the way and the light.

Didn't Vonnegut have a line about how it affects you to see the same mistakes repeat over and over?

Re: New View of Microservices

#36
post #35
post #2

> The most critical thing is being able to use any services locally or remotely without knowing the difference or changing the code. I thought we all agreed CORBA style location transparency was a bad idea? https://en.wikipedia.org/wiki/Common_Object_Request_Broker_A...

And then we agreed that location transparency was bad in RMI, and then again in EJB. It's regular as the tides. In a couple years you'll hear everyone talking about how stupid the Cloud is and everyone will be buying their own servers. Then we'll decide that peer-peer is the way and the light. Didn't Vonnegut have a line about how it affects you to see the same mistakes repeat over and over?

Its more about bandwidth vs capacity vs dollars. The optimum changes as the technologies change.

Re: New View of Microservices

#37
post #10

Earlier quoted context omitted.

That was my 1st reaction too ... but hold on. If you design the 2 components to be non-chatty and have robust error handling, then it can be safe to make it location transparent. In other words, the problem in the past was, we designed it as if it would be used locally, then we naively made it remote. But now, we're talking about designing it for remote use, but then using it locally. Interesting.

It still has all the other disadvantages of remote services, like consistency problems (everybody always assumes that RPC calls are as reliable as 2 phase commit, and they're not), more and more complex code that's harder to change, less flexibility on all fronts except for the one, ... Things like distribution are a tradeoff, an optimization : you should never split a monolithic application into 2 communicating part…

The problem is that for a monolithic system to be divisible, your team has to have been applying a level of discipline that is not verifiable. It's all on the honor system, and (half jokingly) developers have no honor.

Seriously though, all of the problems breaking the system up will be blamed on people who already left the company, whether they deserve it or not, and the patterns that keep you in a monolith will continue on forever.

The only solution I've seen sort of work for this is to make a single binary, but create modules with extremely clear boundaries. Even so far as compiling them separately if the language is statically typed. But even that can go sideways the moment someone builds caching into the system.

I've come to appreciate why external caches are so popular, but for my money I prefer caching at the HTTP layer. You have to solve all the same problems, but you get one level of cache for free, it's easier for QA to understand, and it puts cache eviction in the hands of mature pieces of code that all implement the same spec (which might account for my previous point).

Re: New View of Microservices

#38
post #35

Earlier quoted context omitted.

And then we agreed that location transparency was bad in RMI, and then again in EJB. It's regular as the tides. In a couple years you'll hear everyone talking about how stupid the Cloud is and everyone will be buying their own servers. Then we'll decide that peer-peer is the way and the light. Didn't Vonnegut have a line about how it affects you to see the same mistakes repeat over and over?

Its more about bandwidth vs capacity vs dollars. The optimum changes as the technologies change.

Touché. Every time we hit a new balance in the inequalities we have to re-evaluate all our answers.

I guess what bugs me is not the mind changing (I do that all the time myself). It's that those without a history lesson behave as if this is a bloody revolution, and they have to pick sides. And the people who think switching solutions will magically fix all of our problems.

Re: New View of Microservices

#39
post #15

Earlier quoted context omitted.

That was my 1st reaction too ... but hold on. If you design the 2 components to be non-chatty and have robust error handling, then it can be safe to make it location transparent. In other words, the problem in the past was, we designed it as if it would be used locally, then we naively made it remote. But now, we're talking about designing it for remote use, but then using it locally. Interesting.

People could (and did) design robust CORBA and (D)COM objects, but the overhead was too high in some (many?) cases. Overhead in development time, but also run time. If I can pass a const pointer to a bunch of data (if I know the consumer will live in the same memory space), then that's way faster (in development and run speed) than having to marshal that data into a common byte-order and alignment etc., most likely r…

It's tough.

Pass by reference became de rigeur for high performance systems when we agreed that the message passing overhead represented the plurality of computation time.

But pass by reference is shared state, and as we started trying to build systems with threading and for multiple cores the ugly truth about memory coherence on modern processors came out. It was pretty bad. Java and later C had to come up with some pretty odd looking compromises to get safety without throwing away all of the speed advantages.

Re: New View of Microservices

#40
Great work - looks really cool, esp for ppl using the Node stack. Really excited by the progress in the space, with products like this, JAWS (https://github.com/jaws-stack/JAWS), hook.io and more.

At StackHut (www.stackhut.com) we're working on something similar, a micro-services based system that's provides a scalable, typed, JSON interface into JS/Python classes wrapped up in containers.

Can't wait to see where this microservices-based path ends up...

Post reply on HN