abpframework / abp

Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
https://abp.io
GNU Lesser General Public License v3.0
12.82k stars 3.42k forks source link

Permission Manipulation for inter-communication between modules in a monolithic app #10239

Closed AbuDawood closed 2 years ago

AbuDawood commented 3 years ago

I am developing a monolithic app using ABP IO. However, I want to apply as much as I can the ethic of microservices for easy migration to that latter architectural structure.

I have respected almost all constraints including Aggregation, DDD, and so on.

For the scenario synchronous communication between services, I have used the Client proxy for the C# as it has documented and it worked perfectly except on the side of permissions. I want configurable permission that could I use to differ between internal requests that are performed between modules (future microservices) and the public requests that come from outside.

Any suggestions??

maliming commented 3 years ago

except on the side of permissions

Can you explain this?

AbuDawood commented 3 years ago

well, Thank you for ur interest I am trying to maximize the isolation between modules to ease the future migration to the microservice-based architecture.

How can I pass permission validation for service B when this latter is called by his siblings not directly by the User?

maliming commented 3 years ago

You can refer to this design. The permission should be as infrastructure. https://github.com/abpframework/eShopOnAbp https://github.com/maliming/abp-ms-map

AbuDawood commented 3 years ago

Can I apply the multiple gateways design to my monolithic app??

gterdem commented 3 years ago

Can I apply the multiple gateways design to my monolithic app??

I think there is a misconception in understanding here.

Monolithic application is a single application containing all your functionality (from UI to data access) of your business. This application is deployed as a single unit to a web server. It has its own advantages and disadvantages.

Microservice application is a distributed approach for your application; distributing functionality to many other applications with their own data store and functionality. This means you divide your application to mini self running applications and deploying each of them to their own web-servers.

Like pizza. pizza Your application is a whole monolithic pizza and all ingredients can communicate with each other with ease. Since they are on the same plate.

You decide to slice the pizza to 4 pieces and now each one of them contains a piece of your business logic and responsible for itself. If pieces need to communicate with each other, they need to find a way (message broker or http/rpc call) since they are all in different plates now.

Now, about gateways.. Think about the sliced pizza and you want a slice with mushrooms but you can't see the whole pizza, it is covered (microservices running on internal network). So you make a request, asking for a slice of pizza with mushrooms; this request goes to API Gateway and it redirects to wherever the mushroom piece is located inside.

Maybe too simple analogy but I hope it helps to understand the main concept.

PS: Image is from www.williams-sonoma.com

afresh commented 2 years ago

You decide to slice the pizza to 4 pieces and now each one of them contains a piece of your business logic and responsible for itself. If pieces need to communicate with each other, they need to find a way (message broker or http/rpc call) since they are all in different plates now.

@gterdem How to use the rpc call in "abp-MicroserviceDemo"?

gterdem commented 2 years ago

@afresh You can check rpc sample about it. Also, please create a new issue if you have questions about it.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.