Reputation: 1
I'm newbie in "microservice world", and i have some questions.
As i understand, microservices are groups of small independents parts with different data layers that created one logical whole(example - shops have order, warehouse etc).
My tool is .NET.
Question:
Thank you!
Upvotes: 0
Views: 860
Reputation: 940
To answer your question; It doesn't really matter from a microservices architecture point of view. What is more important is managing the your project and development team.
At some point your microservices, no matter how loosely coupled will have to share something, a versioned message contract is a typical example. We define our message contracts in separate projects. In a single solution, projects that need the contracts can reference them. We also create local nuget packages for the contract projects to import into other solutions.
However you organize your project make sure you keep your services loosely coupled. This is often the single biggest mistake in a new microservices project. The services are not properly decoupled and the project ends up adding complexity without gaining benefit (or worse). If you are unsure how to do that make sure you have properly researched what it means to loosely couple.
Finally, REST is more about how you choose to expose your microservices, less about a microservice architecture. REST is not necessarily the best approach for exposing your microservices and you might look into other ways of doing so including message patterns and message brokers.
Upvotes: 0
Reputation: 418
Why you want to use service and api both at the same time? Here is the key difference between service and API.
1) Web service is used for REST, SOAP and XML-RPC for communication while API is used for any style of communication.
2) Web service supports only HTTP protocol whereas API supports HTTP/HTTPS protocol.
3) Web service supports XML while API supports XML and JSON so API are light weight in compare of web service.
As per microservice architecture, You can use any technology for each of your service. Only thing is, Services should be able to communicate with each other be it in JSON or XML. All services should be loosely coupled and independently deployable.
Upvotes: 1