Skip to content

Instantly share code, notes, and snippets.

@jpwesselink
Last active October 12, 2022 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpwesselink/55f764be4bfe8da530543afb58f9bc78 to your computer and use it in GitHub Desktop.
Save jpwesselink/55f764be4bfe8da530543afb58f9bc78 to your computer and use it in GitHub Desktop.
ADR

Graphql federation with ...

  • Status: proposed
  • Date: 2022-10-12

Technical Story:

How to stitch multiple graphql/rest/grpc services into one graphql schema?

Decision Drivers

  • Hostibility: how can it be hosted?
  • DX: how is the experience for developers using the system
  • Hackability: how easy is it to extend and/or fix the system?
  • Support, or how is community or paid support, documentation, development resources
  • Performance: how fast does it perform?
  • Security: how secure is the system?

Considered Options

  • AWS AppSync link
  • Apollo Federation Gateway link
  • Mercurius in gatewway mode link
  • Hasura GraphQL Engine remote schemas link
  • Apollo Router link

Pros and Cons of the Options

AWS AppSync

  • Good, is offered as part of the AWS platform, comes with AWS CDK support
  • Bad, DX is not smooth since it does not offer federation out of the box, federation needs to be implemented manually through resolvers. Red flag: there is an outstanding issue involving missing resolvers with CDK updates [link](https://github.com/aws/aws-cdk/issues/13269}
  • Bad, underlying tech is not open source, which makes it harder to understand what is going on under the hood
  • Good, support through AWS is available, documentation is ok but not great, seems like commmunity adoption is not visible.
  • Neutral, performance: could not find hard data on performance, only anecdotal evidence that it is not great. link
  • Good, security: it is offered as part of the AWS platform, which means it is secure by default, it does support OIDC and Cognito. Custom auth is possible through lambdas

Apollo Federation Gateway

  • Bad, need to host it ourselves, which means we need to maintain it
  • Good DX, however, it is not as smooth as it could be, since it requires a lot of boilerplate code to be written
  • Good hackability, since it is open source, it is easy to extend and fix
  • Good support, both community and commercial support is available, documentation is good, development resources are available
  • Neutral performance, could be better. Needs benchmarking
  • Good security, given that you can build your own auth layer

Mercurius in gatewway mode

[example | description | pointer to more information | …]

  • Good, because [argument a]
  • Good, because [argument b]
  • Bad, because [argument c]

Links

  • [Link type] [Link to ADR]

[short title of solved problem and solution]

  • Status: proposed
  • Date: 2022-10-12

Technical Story:

Which GraphQL server to use for the new API? To answer this question, we need to understand the requirements of the API and the GraphQL server.

  • we need to maintain one or multiple databases where data from multiple sources is stored
  • we need to expose some of the data in the database to both logged in and anonymous users of our service
  • we need to expose some of the data in the database to logged in users of our internal services
  • we need to expose some of the data in the database

Context and Problem Statement

[Describe the context and problem statement, e.g., in free form using two to three sentences. You may want to articulate the problem in form of a question.]

Decision Drivers

  • Lead time
  • Ease of use and learning curve
  • Performance
  • Community support
  • Security
  • Scalability
  • Total cost of ownership

Considered Options

  • AWS AppSync (AAS) link
  • Apollo Server (APO) link
  • PostGraphile (PG) link
  • Hasura GraphQL Engine (HAS) link
  • Prisma (PRI) link

Decision Outcome

Chosen option: "[option 1]", because [justification. e.g., only option, which meets k.o. criterion decision driver | which resolves force force | … | comes out best (see below)].

Positive Consequences

  • [e.g., improvement of quality attribute satisfaction, follow-up decisions required, …]

Negative Consequences

  • [e.g., compromising quality attribute, follow-up decisions required, …]

Pros and Cons of the Options

AWS AppSync

  • Good, lead time can be short since it is a managed service
  • Bad, ease of use is ok for simple use cases but not for complex use cases. Learning curve involves learning Velocity templates and AWS AppSync specific concepts. AppSync also has a strong tie-in with AWS Amplify, which is opionate
  • performance
  • community support
  • Security
  • Scalability

[option 2]

[example | description | pointer to more information | …]

  • Good, because [argument a]
  • Good, because [argument b]
  • Bad, because [argument c]

[option 3]

[example | description | pointer to more information | …]

  • Good, because [argument a]
  • Good, because [argument b]
  • Bad, because [argument c]

Links

  • [Link type] [Link to ADR]

[short title of solved problem and solution]

  • Status: [proposed | rejected | accepted | deprecated | … | superseded by ADR-0005]
  • Deciders: [list everyone involved in the decision]
  • Date: [YYYY-MM-DD when the decision was last updated]

Technical Story: [description | ticket/issue URL]

Context and Problem Statement

[Describe the context and problem statement, e.g., in free form using two to three sentences. You may want to articulate the problem in form of a question.]

Decision Drivers

  • [driver 1, e.g., a force, facing concern, …]
  • [driver 2, e.g., a force, facing concern, …]

Considered Options

  • [option 1]
  • [option 2]
  • [option 3]

Decision Outcome

Chosen option: "[option 1]", because [justification. e.g., only option, which meets k.o. criterion decision driver | which resolves force force | … | comes out best (see below)].

Positive Consequences

  • [e.g., improvement of quality attribute satisfaction, follow-up decisions required, …]

Negative Consequences

  • [e.g., compromising quality attribute, follow-up decisions required, …]

Pros and Cons of the Options

[option 1]

[example | description | pointer to more information | …]

  • Good, because [argument a]
  • Good, because [argument b]
  • Bad, because [argument c]

[option 2]

[example | description | pointer to more information | …]

  • Good, because [argument a]
  • Good, because [argument b]
  • Bad, because [argument c]

[option 3]

[example | description | pointer to more information | …]

  • Good, because [argument a]
  • Good, because [argument b]
  • Bad, because [argument c]

Links

  • [Link type] [Link to ADR]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment