0

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:

    1. Feeding module with example features: a. foods, b. feeding schedule.
    2. Hospital module with example features: a. medications, b. illnesses, c. treatment plans, d. quarantine.
    3. Beauty module with example features: a. cleaning methods, b. accessories and products for animal grooming.
    4. File Import module with example features: a. animal health score-based report, pictures.
    5. Manual data input 1 module with example features: a. daily activities with timeline, b. score based behavior grading feature
    6. 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:

    1. 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.
    2. 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.
    3. Analytics/Reporting module where we have already created approx. 30 different report templates using Power BI.
    4. Contact module – various way of communications i.e.: email, instant messages,
    5. User management module – user profiles and roles

Our objectives:

  • 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,

Questions:

  1. 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?
  2. 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?
  3. 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.

5
  • 1
    while there are things I dont like here, it looks like a pretty standard architecture that ive seen used in huge sites. What exactly isnt scaling currently?
    – Ewan
    Commented Oct 29, 2018 at 7:21
  • Is the database shared between all locations, or 1 database per location? Commented Oct 29, 2018 at 16:34
  • @Ewan we can not talking about scaling yet, our front end client needs to be replaced - current one is not supper responsive and slow. We don't have central authentication we will probably add identity server to help out with it. As i wrote we need to add new features with pretty big reporting that will be growing over a time which will definitely impact our performance.
    – Cyberman
    Commented Oct 30, 2018 at 1:39
  • @GregBurghardt there is 1 db per location, we definitely want to keep the separation
    – Cyberman
    Commented Oct 30, 2018 at 1:40
  • CQRS and WebAPI pretty much come hand in hand. Add Swagger too, and check out BenchmarkDotNet. Also check out Blazor, it is a mix of Razor and Angular using SignalR, and our tests have shown it out performs Angular if you allow the processing to take place on the server rather than in the browser. Commented Mar 27, 2019 at 13:40

1 Answer 1

3

You probably don't need to change the architecture or technologues used In order to achieve your stated goals.

It looks like you have identified the things about your application which are slightly old fashioned and are preposing to change them to new technologies which do the same job.

While this can be a good thing to do generally it won't help with your stated goals of scalability, centralisation, adding the new features etc.

You need to take a different approach. Indentify the problems first.

  • What stops you centralising?
  • Why are pages slow?
  • Which part doesnt scale and why?

Then prioritise.

  • Is fixing the problem more important than adding a feature?
  • How much money is each problem costing you?

Then look at the simplest fix.

  • Buy more stuff. Can you just upgrade the server, add another node to the db, upgrade the network etc

Only then are you in a position to ask yourself whether say, switching to angular instead of razor views will fix any of your problems and assess how much that change will cost.

In all likelyhood though, its probably just some slow sql and old servers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.