-
Notifications
You must be signed in to change notification settings - Fork 14
RFC for mobile app backend stack #170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,80 @@ | ||||||
| --- | ||||||
| status: proposed | ||||||
| implementation: proposed | ||||||
| status_last_reviewed: | ||||||
| --- | ||||||
|
|
||||||
| # Back end stack for GOV.UK App backends | ||||||
|
|
||||||
| ## Summary | ||||||
|
|
||||||
| This RFC proposes a back end architecture and tech stack for internet-facing services (i.e. APIs) which underpin the GOV.UK mobile app. It draws on the existing work carried out on the Digital Identity programme to define an extensible, scalable architecture which meets the needs of a high-volume mobile application, and create a solid base for future development. | ||||||
|
|
||||||
| The proposal is to adopt an AWS serverless stack, in line with DI, with the predominant implementation approach being to run Node.js Lambda functions to execute business logic. | ||||||
|
|
||||||
| ## Problem | ||||||
|
|
||||||
| The new GOV.UK App is going to require back end services to enable many of its features. The app is a shared product with Digital Identity, where the existing ID Check app that they have in production will be superseded by a new, single app that incorporates both Digital Identity and GOV.UK features. | ||||||
|
|
||||||
| The DI Mobile team have an existing set of back ends which are implemented in line with the Digital Identity architecture - namely, AWS serverless using Lambda functions (primarily Node.js with some Java). The decision making process behind this is recorded in the Digital Identity architecture repostitory (for example, [ADR-0001](https://github.com/govuk-one-login/architecture/blob/main/adr/0001-auth-hosting.md)) _(N.B. this is currently a private repo)_. | ||||||
|
|
||||||
| As GOV.UK, we need to determine a tech stack for back end services which underpin the GOV.UK elements of the app. | ||||||
|
|
||||||
| The following are key considerations we need to take into account: | ||||||
|
|
||||||
| 1. There is a single app, and it would be most straightforward to integrate the app with a single back end. This means we only need a single set of configuration rather than multiple settings for different features. Additionally, we can centralise concerns like logging, monitoring and alerting. | ||||||
|
||||||
| 1. In all likelihood, the various mobile back end services across both DI and GOV.UK will _eventually_ end up being supported and maintained by the same group of people. Therefore, parity of skillset is an advantage. | ||||||
| 1. There are broader conversations across GDS looking into our strategy around tech stacks, and we should fold in to those | ||||||
|
|
||||||
| ## Options | ||||||
|
|
||||||
| We have considered two principal options for tech stacks: | ||||||
|
|
||||||
| 1. Adopt a serverless stack on AWS | ||||||
| 2. Adopt a Ruby-based containerised stack on AWS | ||||||
|
|
||||||
| ### Option 1 - Adopt a serverless stack on AWS | ||||||
|
|
||||||
|  | ||||||
|
|
||||||
| Under this option, we would adopt a serverless stack which broadly mirrors the approach taken on DI. Connectivity would be provided by API Gateways (see note below about the proposed approach to this). Compute would be based on Lambda functions, running the Node.JS runtime. | ||||||
|
|
||||||
| The Lambda functions would be able to call out to other AWS services as needed. While the subject of this RFC is predominantly the connectivity and compute (i.e. API Gateway and Lambda), the proposal would also be to adopt other cloud-native services which commonly form part of a serverless approach, namely using DynamoDB for storage. | ||||||
|
|
||||||
| This option has the following advantages: | ||||||
| * Essentially unlimited scalability without the need for active management | ||||||
| * Cost-efficient, pay-for-what-you-use pricing (we can get some cost reports from DI if this would be helpful) | ||||||
| * A step towards no-ops, where we are not responsible for or have the cost/burden of infra maintenance as this would be handled by AWS, so there are no [tricky manual steps](https://guides.rubyonrails.org/upgrading_ruby_on_rails.html) to upgrade to latest versions of underpinning software (only deprecated runtimes need to be considered) | ||||||
| * Lambda functions are small and self-contained, thus easy to reason about. They are written in JavaScript, which is familiar to many developers and therefore the learning curve is not too steep | ||||||
| * Aligns with the DI tech stack so that the entire mobile back end estate could be maintained by a single group of people | ||||||
| * Benefit from existing DI infrastructure for NFRs like monitoring / logging / alerting | ||||||
|
||||||
|
|
||||||
| The principal drawback of this option is that it is not currently a stack that is widely used and understood across GOV.UK, so would require some upskilling - particularly in terms of infrastructure management and use of AWS SAM (although we could look at an alternative to this like CDK). | ||||||
|
||||||
|
|
||||||
| ### Option 2 - Adopt a Ruby-based containerised stack on AWS | ||||||
|
||||||
| ### Option 2 - Adopt a Ruby-based containerised stack on AWS | |
| ### Option 2 - Adopt a Ruby-based containerised stack on AWS |
(nit: non-breaking space)
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think option 2 should be more of a "consistent with GOV.UK" option. If we were going down that route, I would suggest using our existing kubernetes clusters, and building services using Ruby on Rails with Postgres for persistence. I wouldn't expect you to have new AWS accounts or really any new infrastructure in this model at all - we'd just reuse what we have.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to second this - we've already build a platform to run containerised applications in GOV.UK, which I'd thought we can just reuse. If there are concerns as to why we couldn't, it be good to understand what those are.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This decision feels like it's heavily entwined with GDS' future organisation design, which is itself somewhat unknown.
There are two paths I think we could follow - be consistent with GOV.UK, or be consistent with DI. If the app ends up close to DI in terms of organisation structure, then it will have been better to have been consistent with DI. If the app ends up close to GOV.UK, then it will have been better to have been consistent with GOV.UK.
A big reason for that is support - who will be supporting this infrastructure? Does it need 24x7 support? If there's any intent to piggy back on GOV.UK or DI's existing arrangements, then being consistent with the infrastructure those teams currently use will be a requirement (or at the very least, highly desirable).