0

I want to transition my currently monolithic application to a a microservices model. I'm currently stuck on figuring out the best way for independent microservices to communicate with each other. Each independent microservice could theoretically be written in a different language, so the communication protocol has to be language independent. Additionally, files don't work since the services may run a separate machines, or even on separate continents. Here are my current ideas and issues with them:

  1. Use a DB/message broker like Redis: this relies on a central DB, so if it goes down the entire application goes down. Not ideal.
  2. Use websockets: the overhead? How do I handle authentication?
  3. Expose a HTTP(S) API: same downsides as websockets
  4. Some other protocol that's designed for end users like RSS: This seems like a bad idea.

Any additional thoughts on the 4 methods I stated? Which one is the best? If possible, could I also be given some examples on how to best implement them? Java is the language that the first microservices will be written in. However, remember that it has to work on most other languages, NOT ONLY Java! If there's a better way to achieve my goals, please state it and elaborate on how it works.

A. Owl
  • 51
  • 1
  • 6
  • short answer , look at eureka , thats the heartbeat where all services are registered and communicate and zuul service too. search on this too and it should get you started – mbn217 Aug 19 '20 at 19:52
  • 2
    [Message brokers](https://www.ibm.com/cloud/learn/message-brokers)? – vulpxn Aug 19 '20 at 19:58
  • 2
    you should look into message brokers like RabbitMQ or Kafka – Clashsoft Aug 19 '20 at 20:00
  • I don't think that you will be able to get an answer without specifying your requirements. As you've already noticed, there isn't a single architectural pattern that you can pick. In complex scenarios you are likely to use more than just one channel for communication. e.g. broker for small messages/events and rest for larger messages such as files or big datasets. If availability is a concern, use high availability deployment. And remember to select products based on your infra and operational requirements. e.g. If you have just 2 data centers, redis/rabbit etc will not provide HA for you – Sami Korhonen Aug 19 '20 at 21:50
  • Sami - I believe I have specified my requirements: multi language compatible and no single point of failure. I’m mainly asking for the best of the four I stated for use in micro services. – A. Owl Aug 20 '20 at 02:15

0 Answers0