Reputation: 145
Is it possible to build a project using different languages via microservice? Like, I want to build a hotel management system, can I use both asp.net core and nodejs for different modules. Suppose I want to get my data using nodejs and post data using .net core. TIA
Upvotes: 2
Views: 4442
Reputation: 318
Well I think Docker is what you're looking for, where you can create a container for each microservice that is totally independent of others and they can communicate to each other through the network and/or files and finally, you can build all of them in the desired system with one command using Docker Compose.
Upvotes: 2
Reputation: 3079
Yes it is possible to use different languages for different micro-services. For example you can write micro-service-A in C#(.NET Core), micro-service-B in Java, micro-service-C in NodeJS and so on(you can chose from lot of languages here). But usually this is not recommended. At least not if you do not have good reasons for it.
Benefit of Micro-Service Architecture
Indeed this is one of the benefits of micro-services to be able to use different languages, technologies, libraries, databases and other components for each micro-service. But you should be careful to not overdo it and to do it only when needed. In the reality companies and their development teams stick to 1 or 2 tech stacks and develop all of their services with it.
Reasoning for picking different languages and technologies
Here are a couple of things you should consider before doing that:
Conclusion
My advice would be to pick one tech stack/language and develop all or almost all you micro-service in that language. Similar goes for database, cache and FE framework/library. Only chose a different technology/language if you have a strong reason to do and you main language/stack is not performing or fitting well. Like I explained with the Elastic Search example above. The decision which language depends on a lot of different factors.
Upvotes: 4
Reputation: 462
Yes, you can choose different set of languages/tools/technologies for different set of Microservices. But better option is to choose one language with which team is fully comfortable. If you choose another language then you should have specific reason. For e.g., in one of my project, most of the services were written in Node JS. We wrote one service in Go Language as we need performance.
Upvotes: 7
Reputation: 11
Yes. You need then some form of interprocess communication (IPC). Each language lives in its own process, regardless of what the operating system flavor is, or what language you have used. Often processes practically communicate via APIs. There are also other ways to arrange IPC, via database, memory (RAM), signals, or even plain files (which are on some shared medium).
Upvotes: 0