Overview
The Site Experience team manages a separate webservice named storefront-backend, which is meant to serve as a general purpose BFF (backend-for-frontend) layer supporting the Hydrogen application. This webservice is primarily used for any integration that requires persistence with our Cloud SQL Postgres database.
At the time of writing, the storefront-backend webservice exclusively serves the Party Planner use case.
When to use the BFF layer vs Hydrogen API Routesโ
For integrations that don't require heavy compute or direct access to a Google Cloud service, a Hydrogen API route should still be preferred over an external microservice (our BFF layer, another BG owned microservice, etc). With our Shopify subscription, we aren't billed for resource utilization on the Oxygen runtime so if we can deal with Webworker performance, we should opt for that.
Oxygen workers are non-Node.js environments, so an integration with a third-party SDK that requires Node.js might also signal usage of a Cloud Run microservice. Note that this does not specifically recommend integration through our storefront-backend layer, but warrants further architectural discussion with the team.