I'm using ASP.NET Core 6. I have multiple apps:
uri | user | tech |
---|---|---|
www.example.com | visitors (landing pages, products, about us, contacts, etc.) |
razor pages |
api.example.com | - | webapi (to support blazor apps) |
app.example.com | customers | blazor wasm |
staff.example.com | staff | blazor wasm |
I wanted everything in one server app - which is possible, but complicated; I managed to get some of it working. There are many questions (here and in the aspnet repo) for this approach - its popular because deployment seems simple and self-contained (but many people struggle with this, and many questions don't even have working answers).
I realised that even if I succeed, there are many moving parts (the config is a nightmare!), many things that could break in production, and someone else might have to maintain it.
So maybe it's better to have separate (dockerised) apps.
Pros:
- simpler implementation
- simpler maintenance
- easier to scale (especially read-heavy apps, e.g. www and blazor apps, which could even be moved to a CDN)
- better division of labour (different team members responsible for different apps)
- from personal experience the "www" public website changes more often (sometimes daily) than the "api" web app, so pushing changes to production requires updating everything - whereas if separate then one only pushes changes to individual apps
- easier to isolate faults: if something fails or must be taken down for maintenance, the problem is localised and other parts of the system continue to function
Cons:
- complicated deployment
- more monitoring and health checks
- ...?
If you've dealt with this, in production, please share your experience. I've no idea what to expect.
I'm interested in the core problem: is serving everything from one server app asking for trouble, or is it a worthy (and maintainable) goal? Thanks!