Skip to content

Commit 9eb96e4

Browse files
authored
Merge pull request #225 from alphagov/ldeb-add-adr-remove-forms-api
Add ADR for removing forms-api app
2 parents dff55bc + 2486c0e commit 9eb96e4

2 files changed

Lines changed: 82 additions & 1 deletion

File tree

ADR/ADR004-store-form-schemas-in-an-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Date: 2022-02-18
44

55
## Status
66

7-
Accepted
7+
Superseded by [AD045: Remove forms-api](ADR045-use-forms-api.md)
88

99
## Context
1010

ADR/ADR045-remove-forms-api.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# ADR045: Remove forms-api
2+
3+
Date: 2025-08-19
4+
5+
## Status
6+
7+
Accepted
8+
9+
## Context
10+
11+
In [ADR004: Store form schemas in an API] we decided to implement a separate API app so that we could scale the services required for form submissions separately to the services required for building forms.
12+
13+
However, maintaining multiple apps has resulted in increased toil. Having multiple services has also resulted in challenges around designing and maintaining the interface between forms-admin and forms-api.
14+
15+
As the cost of compute is low at the moment, the cost of the additional developer time outweighs any savings due to efficient capacity management.
16+
17+
We are currently refactoring forms-admin and forms-api to work with the v2 API described in [ADR034: API v2 for Forms]. We have an opportunity now as part of this work to make a large architectural change, namely using the forms-admin app to serve the v2 API endpoints needed for forms-runner, and removing the need for forms-api.
18+
19+
[ADR004: Store form schemas in an API]: ADR004-store-form-schemas-in-an-api.md
20+
[ADR034: API v2 for Forms]: ADR034-api-v2-for-forms.md
21+
22+
## Decision
23+
24+
We will add endpoints to forms-admin that can be used to retrieve v2 API form documents in JSON format.
25+
26+
We will change forms-runner to read form documents from these new endpoints in forms-admin.
27+
28+
We will keep the new endpoints in forms-admin accessible from the private VPC only (keep them not accessible from the public internet), and not require authentication for their use.
29+
30+
We will retire the forms-api app and remove it, its database, and associated systems, networks and configuration files.
31+
32+
The plan to follow to achieve this is documented separately, in [Migrating forms-admin to v2 API (Google Docs)](https://docs.google.com/document/d/1Ea2rEK3gcaRhAVKiLIelD8FNxNI7YHqWmKSfbzMjeLQ/).
33+
34+
## Consequences
35+
36+
Positives:
37+
- We will have fewer separate apps to maintain
38+
39+
For each app we have to maintain we have additional maintenance workload,
40+
including regular security patches, keeping files common to all repositories
41+
in sync, and other causes of toil. Fewer apps means less toil for developers.
42+
43+
Negatives:
44+
- forms-admin will be in the critical path for submitting a form
45+
46+
The system will be less resilient (all other things being equal) because an
47+
issue in forms-admin could cause form submissions to fail. We could look at
48+
ways to mitigate this loss of resilience if it is thought to be necessary.
49+
50+
- We won't have an external API for retrieving form documents
51+
52+
This will make it harder for developers to debug and/or investigate the
53+
production system, but we have found that with the current API it is not
54+
common for developers to make API requests directly to forms-api. If we find
55+
that there is a need we can consider adding an external API with access
56+
control.
57+
58+
### Consequences for costs and resource usage
59+
60+
This change is likely to be resource-neutral, in the best case it may use
61+
slightly less resources, but it is more likely it will increase our resource
62+
usage. Currently we have fewer forms-admin instances than forms-api instances
63+
running in production, but each forms-api instance uses more compute. It is
64+
difficult to predict what the right number of instances for the forms-admin app
65+
including API endpoints would be, we will probably over-provision initially and
66+
optimise resource usage later.
67+
68+
In terms of costs we are currently on a [compute savings plan] that has pay a
69+
fixed annual cost for a pre-agreed amount of compute, so we may not see an
70+
increase of cost.
71+
72+
In terms of CO2 usage our AWS systems are currently nominally carbon-neutral,
73+
as Amazon has "purchased renewable energy that compensated all or part of the
74+
emissions associated with [our] usage", and the change in this ADR is unlikely
75+
to increase our emissions beyond the point of being carbon-neutral.
76+
77+
If we do find that we need to improve the scaling properties of the system, we
78+
could consider cache layers between forms-admin and forms-runner rather than a
79+
full API.
80+
81+
[compute savings plan]: https://aws.amazon.com/savingsplans/compute-pricing/

0 commit comments

Comments
 (0)