- Keep your backend and frontend systems separate
- Run workers alongside your main app
- Or even go for a full microservices architecture
Separate projects
If you have multiple apps sharing the same code but each of them has its own data, keep your apps in separate projects. Upsun provides the automation to deploy multiple projects from the same code base, which makes their maintenance effortless.By design, Upsun doesn’t allow your app to access services in another project through HTTP.
- Your apps are for different customers/clients
- Your apps don’t need to directly connect to the same database
- Different teams are working on different apps
- You want to develop true microservices, where each microservice is a fully standalone process with its own data
Clustered applications
A clustered application is one where your project requires multiple app services that are all part of the same conceptual project. Clustered applications can range from a straightforward headless architecture, where frontend and backend systems are separated, to micro-services with dozens of apps in multiple runtimes and frameworks forming a consistent whole. Meaning, removing one of the app services would break the others. Upsun allows you to configure access from one service to another without having to worry about service discovery or complex ingress controllers. Configuring incoming routes is straightforward. You can have services that are only exposed to another service as well as services that are exposed to the internet. In a clustered application, you can have one of the following configurations:- Multiple applications, often in different directories or with separate code bases that deploy separately
- A single app that spawns one or more worker instances that run background processes
- You want one user-facing app and an entirely separate admin-facing app that are both operating on the same data
- You want to have a user-facing app and a separate worker process (either the same code or separate) that handles background tasks
- You want a single conceptual app written in multiple programming languages
A note on “multi-site” applications
Some Content Management Systems or other applications support running multiple logical “sites” off of a single code base. This approach isn’t recommended on Upsun. This multi-site logic is often dependent on the domain name of the incoming request, which on Upsun varies by branch. Running multiple databases, as is often recommended with this approach, is supported on Upsun but makes the setup process for each site more difficult. Leveraging the multi-site capabilities of an app are appropriate only in the following cases:- There is only a single team working on all of the “sites” involved
- All “sites” should be updated simultaneously as a single unit
- Each individual site is relatively low traffic. This means that the total traffic for all sites is appropriate for the resources that have been allocated. allocated resources
- All sites really do use the same codebase with no variation, just different data