I have a below requirement in Microservice architecture desgin. My project which is of type Azure Service Fabric stateless and stateful services in Dot Net Core.
Total 3 stateless and 3 stateful services in that project.
For Each stateful service we have created one stateless service as gateway to that.
We will be storing data in stateful service and through stateless we will sending data and retriving data.
For communication purpose we will be using Service proxy(ie. IService implemented interface).
I can easily call methods of stateful1 from stateless1, But I have requirement like I need data from stateful1 which is depended on the stateful 2 and stateful 3.
I have some business logic in between each stateful service,
Currently am creating Service proxy on statful1 and gathering all the data of stateful 2 & 3 and after comuting entire data will be sending to stateless.
My question wll be, Is it better to have one more layer called repository(Class library project used by the stateless) which will contact each stateful service and comupte the business logic?
Or If have antire business logic in stateful will impact on performance, instead of having business logic in stateless.
I have taken simple example of 3 stateless and 3 stateful, But actually my project consists of more than 50+ services each one is having Gateway and stateful service. Between each stateful service I have more business need to write.
Please suggest me better approach for doing this requirement.
stateful2
andstateful3
? What I mean is that is there are use cases when we need to return data directly fromstateful2
orstateful3
? Or these services are only used bystateful1
? – Oleg Karasik