Planning a micro-service arch project with NestJS and elixir!

Hey everyone. This is going be the first post ever here by me. Coming to the point that i am planning to build a very simple but powerful architecture based application which is going to be a real time chat application.

I am going to use Micro-service arch for this. For creation / update / deletion of users / rooms i am planning to use NestJS service and for handling real time messaging i am going to use elixir backend as a service.

I am planning to use Kafka as a message broker which will help me to perform inter service communication between nestjs service and elixir service.
when i will add authentication to this app which will be a tricky part of course because there are two separate choices one is to add centralized auth system after an API gateway or add a separate auth service in both the services. So that i will be thinking later.

for now i just want to welcome suggestions / hints / notes / help for this project. I am going to broadcast this whole project on my youtube channel and My biggest supporter in this project will be a AI bot called chatgpt. Because he helps me a lot.

One thing i want to tell everyone that i decided to build this project being a fresher to elixir. i have experience with nestjs as i use it at my work every day. But for elixir it is going to be my first time and today itself i wrote “Hello world” in this language.

I love real time system so i chose elixir to learn now onwards.

I would be more than happy if you can help me in this journey.
Thank you everyone in advance.

Don’t know, sounds like overengineering to me. Just go with Elixir, you won’t regret it and it’s a superior technology, especially for the use case. But most probably it doesn’t matter because you probably won’t get to a scale where it would. No offence.

If you go with your proposed architecture, just deploy the two services to the same server and use UNIX sockets for communication.

1 Like

@krasenyp Hey. Thanks for the reply.
My motive to learn micro-service arch by building a chat-app. Then i found elixir and i liked it so much because of it’s real time capabilities.

My way can become clear if you could explain those point to me which you think are being overengineered here. May be i might get new insights and can learn even more.

I would love to hear back from you. Waiting.


Hello and welcome,

You might have a look at…

It is not about microservice, but chat application.

For CQRS/ES You might get some inspiration from…

GitHub - commanded/commanded: Use Commanded to build Elixir CQRS/ES applications.

BTW It’s possible to use microservice architecture, because the BEAM use message passing between lightweight processes. At a macro level, it’s possible to distribute between nodes.

You can go very far with Elixir only. But switching mental model is complicate,

I watched this video already without even knowing elixir at all so i think that shows how obsessed i am with real time system :smile:
But the reason of using micro-services using nestjs and elixir with kafka i just an experiment and a project to learn new things with some constant motivation for me.

may i can explain better with this line →
“Modifying your ford fiesta like an Ferrari will not change it’s speed but will change the look and sound and people will still look at it many times. and of course we all know that it will not change the speed but still we all do this”

because of motivation sometimes. With this project at least i will be able to make two services to communicate with each other and it will make my resume attractive for my next interview i guess. haha
Any ways thanks for your reply and time.

Yes it is nice to experiment…

I did translate some ideas from this book

to Elixir in this repo GitHub - kokolegorille/microservices_umbrella: practical microservices in Elixir

The code is not maintained, and old :slight_smile:

You might consider adding grpc to the mix

Since your interest is mainly to learn I recommend just jumping into writing code without worrying too much if you are making all the right decisions for designing the elixir piece. You will learn a lot from making wrong decisions and if you get stuck on something specific along the way you should find it easy to get answers here. In general the more specific the question the quicker and better the answer :wink:


Totally agree, the best practice to truly understand something is to make it the wrong way, then slowly improve while understanding the tradeoffs.

1 Like