❔ How to properly design microservice architecture in ASP Net Core?
Hello everyone. It's going to be my first try to follow microservice architecture pattern. I have read lots of articles on the web but still have a few doubts and questions about this topic. I'm wondering how should I design the project in ASP Net Core. Especially:
1. should I create multiple services under one solution?
2. should I create a new solution for each service?
3. should I create API Gateway as an app in seperate solution or under existing solution (e.g. along with one of the services)?
4. should I always containerize microservices or not?
5. is it possible to deploy microservices apps without containerization?
6. I have one server with one database where all data is stored. I read that each service should have its own database. Can I use one database for each service (but each service will be using different tables , not share the same tables)?
7. does it make sense to create seperate service where all required data from database/s is stored (e.g. data from a few servers)? And then other services (e.g. Payments, Products, Clients etc.) would communicate with this data service to make CRUD operations? Normally, each service should have its own database but what about this approach?
Thank you for your answers
14 Replies
solution is just for grouping projects. separate solution for each service is nonsense imo
you might want to put it into a separate folder, but like you still may need to work on both that and one of the other services at the same time. ideally, generate your solution files for scoping purposes
if you mean like a separate git repo, this depends on the scope of the system
I'd say no, but if you've got a separate team working on that service then ut might be worth it
the last point I think is called a broker
I'm gonna try to add to what Anton has already written, and my takes on it:
I'm not an expert on this, but these are my two cents after working with microservices for the last 4-5 years based on my own experiences.
@AtomicLiquid thank you a lot for your guidelines. If you have 4-5 years of experience in microservices then you must be expierienced 🙂 Getting back to 1st question and your answer - should I click on a solution > Add New Solution Folder > and add there web api which is going to be my service? I ask because you said i need to have parent solution and other child solutions containing microservices. So the project tree should look like the one I attached below? I just created 'solution folders', can't add anything else.
As for 3rd question - I need to create simple API Gateway, just a point to route requests between services. I will run all solutions on one server (most likely IIS)
child solutions?
huh
is that a new feature?
Child solutions was meant to be child projects😅
But not really sure if that would make sense either haha
I'm coming from the java world, so it's somewhat different than .NET
Ok, so you mean I should create seperate services directly under solution, sth like that below? And they are new WebAPI projects at the same time
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Ok, thank you. So if microservices ought to be used for such gigantic projects then there's no too much sense using microservices to medium size apps. I just wanted to introduce new approach of creating apps in my company. Instead of creating MVC app I decided to do it using different approach. I started creating 2 seperate apps: UI (Vue.js - frontend) and Net Core API (for the whole logic and db - backend). Then to connect them via API. I just wanted to replace Net Core API app to smaller services as to avoid the situation where one back-end app is packed with too much logic. So I made up my mind to follow microservice architecture which seems better approach. I would create a few seperate services reponsible for given business logic (Products, Payments etc.). Hope it makes sense, if no maybe there's some other solution.
Yeah I want to say;put the compiler down and no one needs to get hurt; plan out your scheme for independence first; are you really just building a distributed monolith?
I smell destructive decomposition
I'm wondering if microservices are reasonable approach in my case. I write an app on my own, I don't have a team. My app seems to be complex in terms of funcionalities, analysis etc. But only for 20-30 users. What about approach called modular monolith? Is it possible to create a few seperate apps in such scenario (like seperate fron in Vue and seperate back in C#, where botj communitace through API?) ?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.