Cross-Cutting Concerns for An Enterprise Application
Cross-cutting concerns are an integral part of any system design. By identifying and defining the Cross-cutting concerns upfront helps to design more secure and performant applications
Join the DZone community and get the full member experience.
Join For FreeIn this article, I would like to explain what a cross-cutting concern is and what are cross-cutting concerns that must be considered as part of the system design. In this article, I would like to provide the core concerns that should be considered while designing the application. Please do note that additional cross-cutting concerns need to be applied based on the domain of the application.
Before delving into details, let us first understand what a "cross-cutting concern" is and why we must consider them while building the enterprise applications.
Concern means "it is a behavior/functionality that we would like to implement in an application/module"
What Is a Cross-Cutting Concern?
The cross-cutting concern is a concern that is applicable throughout the application and it affects the entire application.
Cross-cutting concerns help you to manage the application level functionalities in a centralized location.
Below are the cross-cutting concerns those are applicable for all the enterprise applications:
- Security
- Performance
- Request tracing
- Exception handling and logging
- Monitoring
- Transaction management (distributed)
- Audit log (does not require in every application)
- Communication with external systems (does not require in every app)
Microservice applications require to take care of a few more additional concerns in addition to above-mentioned ones:
- Centralize configuration management
- Distributed request tracing
- Service registration & discovery
- Service-to-service communication
- Message idempotency (when dealing with message queues)
- Shared data/logic/libraries
As part of the security, below are the few concepts you should look at:
- Authentication/authorization
- Data transport protocols/message handling
- Identity and Access Management
- Secure Accessibility of resources
- Data Security (Encryption/Hashing considerations)
- Security at REST and Transit
Below are the few areas/concepts you should look at:
- Server-side Cache
- HTTP cache
- Static resources cache/CDN
- Browser cache
Also, please make sure you have the cache invalidation techniques in place to avoid serving the stale data to users.
It is always good to trace the request from where it is originated and how it responded to the user. It is very helpful when debugging the application in production.
Centralized exception handling is one strategy to make sure our system is always responding in a positive note. Any unhandled exception can lead to crashing the entire application.
By centralizing all the exceptions into a datastore helps to identify the common errors that development needs to improve on and stability of a new feature when released to production.
The monitoring system helps you to identify the system behavior and issues that are occurring in the production. It helps you to detect the failures proactively and early to avoid system failures.
Transaction management makes sure your application is following the ACID properties. By defining and adopting the transaction management strategy you can avoid data inconsistency issues.
Distributed Transaction Management is critical when dealing with microservice systems.
Please let me know if you would like to add additional concerns in addition to the above-mentioned ones.
Hope you enjoyed the article. Please share your thoughts in the comments box below. Thank you for reading the article.
Published at DZone with permission of Anji K. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments