I’m working with legacy web app for managing an animal shelter which need to be rearchitected/redesign, so it can scale and be possible to deploy in a central location.
Currently it's physically deployed on the servers at customers locations (9 and more waiting till centralizing will be possible).
Short description of current architecture/design:
6 layers MVC 5, EF(code first):
- entities with DB context (class library),
- domain model (class library),
- repository with unit of work pattern and auto mapper (class library),
- services (class library),
- commons with NLog and structure map (class library),
- presentation (MVC with razor views).
6 existing modules:
- Feeding module with example features: a. foods, b. feeding schedule.
- Hospital module with example features: a. medications, b. illnesses, c. treatment plans, d. quarantine.
- Beauty module with example features: a. cleaning methods, b. accessories and products for animal grooming.
- File Import module with example features: a. animal health score-based report, pictures.
- Manual data input 1 module with example features: a. daily activities with timeline, b. score based behavior grading feature
- Manual data input 2 module with example features: a. animal physical condition description, b. scored based physical condition grading feature.
New modules that are requested:
- Notification module – real time/instant messages when action/events occurred i.e. low food stocks, low medicine stocks, sick animal, physical condition < 50 or when users sends internal message to other use - SinglaR to be used here.
- Action plan module – automatic generation of the form with a plan of action in case of any action/events occurred i.e. low food stocks, low medicine stocks, sick animal, physical condition < 50 etc.
- Analytics/Reporting module where we have already created approx. 30 different report templates using Power BI.
- Contact module – various way of communications i.e.: email, instant messages,
- User management module – user profiles and roles
- have a scalable architecture,
- deploy in the data center, remove from customer locations,
- deliver decent performance,
- expose our data in case need of mobile clients or sharing data,
We are considering porting existing presentation layer to stand alone angular 6 project with token-based authorization:
- Is it a good idea to have front end project in non-Visual Studio solution, any drawbacks?
- Wanting to expose our data with .NET core WebAPI and consume it in our front end.
- How to handle cases that will be difficult to cover by API’s should we have another service layer and there consume WebAPI? If so then how to consume that kind of service by the front end – adding another MVC project or a different pattern?
- We’re adding heavy analytic/reporting module and while discussing performance I came across “command query responsibility segregation pattern” which allows to use separate db’s for write and read operations which in our case will be mostly reports etc.
- Is it possible to use CQRS with MVC pattern or would it have to be DDD or something else?,
- in case of two read/write db's we would need replication, would that be problematic, especially keeping db's in sync?,
- Does CQRS fit in WebAPI concept? Does it mean that the web api would have to use this pattern or we would need another abstraction?
- In reading about CQRS sql materialized views were mentioned for the read model, are these in fact better option than having views with indexes, should we consider it at all?
- ID generation strategy change – currently we use “integers” for our key values, some forums are suggesting that introducing GUID’s might help with performance especially on CREATE requests, are there any other problems, benefits?
From the hardware stand point we are considering hosting client application on two VM's using a load balancer and a seprate DB solution per customer.
As your probably guessed not much of architectural experience from my side therefore I would appreciate help and pointing into the right direction.
If you think there might be some examples of architectures/designs we could adapt then please give a heads up.