Search code examples
ormado.netmicroservices

Microservices for Relation database


What is the best approach to design MicroServices ?

I have a single Database with around 300 Tables of data and a Data Access Layer which queries the db using ADO.Net . I plan to use each table as a service (controller) to control data of that table .

Is this a good approach ?


Solution

  • At first glance I would say that this does not sounds like an good idea, but based on the information that you gave us here it is hard to tell. To tell you more precise I would need to know what kind of domain or application use case you are talking about.

    I can hardly imagine that each of your tables should be considered as separate Domain which you need to separate to a dedicated micro-service. Again this all depends on your Domain.

    I plan to use each table as a service (controller) to control data of that table

    If your criteria for splitting your application or solution to micro-services is based on database table to micro-service(or every db table should be one micro-service) than I would strongly advise you not to do this. This would be an overkill from prospective of development effort and maintenance effort. Remember that developing a micro-service based architecture solution is quite an effort but maintaining it(making sure that everything runs correctly) is challenging as well.

    Question

    Question which you should ask yourself is more like: How or based on what should I split my solution to micro-services?

    There are a couple of approaches but the most common is based on DDD(Domain Driven Design) Bounded Context. There are a lot of very good questions/answers on DDD on Stackoverflow. You can also have a look at this answer here to get some information about how to approach splitting solution in micro-services here.