7

So I was talking microservices architecture with some lead techs.
And I started asking how did they combine/connect their microservices.

And despite having a lot, they use HTTP as the main transporter.
So the put some API-Gateway, all inside traffic has to go through it, to connect to the final client.

And I said that I do meshing microservices, and we use Nats as man transporter, so our messages go through UDP and not TCP.

And they freaked out. Saying UDP is too low level and not useful...

My question: if you do microservices oriented architecture, and not SOA, do you use HTTP? Did you use it simply because "it works"?

Comments
  • 1
    You mean they send http requests to eachother? Or through a broker? The former sounds like a no-no
  • 2
    @alexbrooklyn my question is how you do if done n HTTP. And if you do it in http, you'll a reverse proxy
  • 2
  • 2
  • 1
    . As well
  • 1
    @alexbrooklyn why the former should be a nono? Just asking...
  • 3
    @dmonkey (from what I've learned at school) if the microservices start sending eachother http requests then they must know of eachother's existence and have to handle sending requests to dead or malfunctioning services

    With a message broker, all the services just scream events into it and then forget about it. Meaning that messages do get spread around services but the services themselves are largely independent and don't need eachother

    Compare it to an office, every time something happens at your desk you scream it into the hallway. You don't know if someone's listening, and you don't care. You also listen for messages that you might need, if you're HR you're probably interested in messages concerning employees. If any of cour co-workers is down, you can still do your work since the hallway is the only thing you talk to.

    If anyone thinks what I'm saying is incorrect please notify me, this is how I got taught microservices and its how I implement it most of the time.
  • 1
    @alexbrooklyn oh yeah, I see... In my personal project every microservice is a docker service (deployed on the same host) so I didn't think about it.
  • 0
    @dmonkey ours was too! How do your communicate? With a broker?
  • 1
    ... http requests lol

    But it's a small personal project meant for personal use. I'll upgrade it in the future
  • 2
    Udp is not too low level, if you can handle it.

    You should try not to let services communicate to each other directly anway.

    I recommend looking into an event sourcing or message broker approach.

    All have ups and downs, there is no holy grail. Do what works best!
  • 1
    @KDSBest this, exactly :D
  • 2
    you can try with a websocket communication, the microservices only suscribe to a channel, and there is a full duplex connection.
  • 1
Add Comment