diff --git a/docs/assets/backend-system/scaled-deployments.drawio.svg b/docs/assets/backend-system/scaled-deployments.drawio.svg new file mode 100644 index 0000000000..85060af236 --- /dev/null +++ b/docs/assets/backend-system/scaled-deployments.drawio.svg @@ -0,0 +1,429 @@ + + + + + + + + + + + + + + + + + + + +
+
+
+ Backend Deployment A +
+
+
+
+ + Backend Deployme... + +
+
+ + + + +
+
+
+ Frontend App +
+
+
+
+ + Frontend App + +
+
+ + + + + + + +
+
+
+ All other traffic +
+
+
+
+ + All other traffic + +
+
+ + + + + +
+
+
+ /api/{techdocs,scaffolder}/* +
+
+
+
+ + /api/{techdocs,scaffolder}/* + +
+
+ + + + +
+
+
+ (Authenticating) Reverse Proxy +
+
+
+
+ + (Authenticating)... + +
+
+ + + + + + + + +
+
+
+ Backend Deployment C +
+
+
+
+ + Backend Deployme... + +
+
+ + + + + + + + +
+
+
+ Backend Deployment B +
+
+
+
+ + Backend Deployme... + +
+
+ + + + + + +
+
+
+ app +
+
+
+
+ + app + +
+
+ + + + + + +
+
+
+ auth +
+
+
+
+ + auth + +
+
+ + + + + + +
+
+
+ catalog +
+
+
+
+ + catalog + +
+
+ + + + + + +
+
+
+ search +
+
+
+
+ + search + +
+
+ + + + + + +
+
+
+ techdocs +
+
+
+
+ + techdocs + +
+
+ + + + + + +
+
+
+ scaffolder +
+
+
+
+ + scaffolder + +
+
+ + + + + + +
+
+
+ proxy +
+
+
+
+ + proxy + +
+
+ + + + +
+
+
+ Plugins +
+
+
+
+ + Plugi... + +
+
+ + + + + + +
+
+
+ /api/{catalog,search}/* +
+
+
+
+ + /api/{catalog,search}/* + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + Horizontally Scaled + +
+ + Deployments + +
+
+
+
+ + Horizontally Scale... + +
+
+ + + + +
+
+
+ Logical Databases +
+
+
+
+ + Logical Databases + +
+
+ + + + + + + + + + + + + + + + + + + + + + +
+
+
+ DBMS Instances +
+
+
+
+ + DBMS Instances + +
+
+
+ + + + + Text is not SVG - cannot display + + + +
diff --git a/docs/backend-system/building-backends/01-index.md b/docs/backend-system/building-backends/01-index.md index b1c85aad5d..4caa6fd524 100644 --- a/docs/backend-system/building-backends/01-index.md +++ b/docs/backend-system/building-backends/01-index.md @@ -140,3 +140,13 @@ backend.start(); ``` We've now split the backend into two separate deployments, but we still need to make sure that they can communicate with each other. This is the hard and somewhat tedious part, as Backstage currently doesn't provide an out of the box solution that solves this. You'll need to manually configure the two backends with custom implementations of the `DiscoveryService` and have them return the correct URLs for each other. Likewise, you'll also need to provide a custom implementation of the `DiscoveryApi` in the frontend, unless you surface the two backends via a proxy that handles the routing instead. + +### Split backend deployments architecture example + +Below is an example of a more elaborate setup where we have three different backend deployments, each with their own set of plugins and modules. Between our frontend app and the backend instances we have a reverse proxy that routes the traffic to the appropriate instance. As an option for securing the Backstage deployment the proxy can be set up as an authenticating reverse proxy as well, denying unauthenticated users access to the backend instances. + +![diagram of a backstage deployment with three separate horizontally scaled backend systems](../../assets/backend-system/scaled-deployments.drawio.svg) + +In this example we have split out the Catalog and Search plugins into one backend deployment. The proxy routes all traffic for `/api/catalog/` and `/api/search/` to this instance. With this separation we're able to scale and deploy these two plugins independently, and they are also isolated from both a performance and security perspective. Likewise the TechDocs and Scaffolder plugins are split out as well, and then we route the rest of the traffic to our instance that contains the App, Auth, and Proxy plugins. + +We also see how each of the plugins have their own logical database, but are often set up to share the actual Database Management System (DBMS) instance. This is of course not a requirement, and you can choose to further divide or consolidate the databases as you see fit.