We have a large monorepo project with a unified release flow. We decided to move the frontend and admin frontend to separate repositories, but the backend remains monolithic. This causes version desynchronization between backend and client. How would you see a solution to this problem to be as protected from breakdowns in production as possible?
sobes.tech AI
Answer from AI
To avoid version desynchronization between the frontend and backend when separating repositories, several approaches can be used:
-
API Versioning: The backend should support multiple API versions simultaneously. Clients (frontends) are tied to a specific API version, allowing independent updates of the frontend and backend.
-
Contracts and Schemas: Use schemas (e.g., OpenAPI/Swagger) to describe the API and check compatibility when changes are made.
-
Feature Flags and Canary Releases: Gradually introduce new features to minimize risks.
-
Automated Integration Testing: Set up CI/CD that checks frontend and backend compatibility before release.
-
Monorepo for Shared Libraries: Extract common types and API clients into separate packages that can be versioned and used across different repositories.
Thus, the main solution is clear API versioning and automation of compatibility checks, so that the frontend and backend can develop independently without breaking in production.