Skip to content
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

[Issue 188] Architecture diagram #365

Merged
merged 16 commits into from
Aug 11, 2023

Conversation

SammySteiner
Copy link
Contributor

Summary

Fixes #188

Time to review: 30

Changes proposed

Added a architecture readme file with several diagrams.

Context for reviewers

I used mermaid to create the diagrams as code to help us maintain them going forward. However, I ran into a few challenges:

  • Mermaid does not make it easy to include images so i couldn't use aws service icons
  • Mermaid has issues when drawing lines between nested subgraphs so I had to settle for higher order nodes
  • I couldn't really get the hang of formatting and direction of the diagrams, so that may be suboptimal

It would be really helpful to get feedback on both the diagrams themselves and what they are missing, as well as my implementation of mermaid because I'm sure I have a lot to learn there.

@SammySteiner SammySteiner marked this pull request as ready for review July 27, 2023 15:53
@SammySteiner
Copy link
Contributor Author

SammySteiner commented Jul 27, 2023

Copy link
Contributor

@gcarson-bit gcarson-bit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job on the mermaid diagram--really neat stuff! My only question/comment is regarding the database - shouldn't the replica DB be the same as the Postgres DB?

@SammySteiner
Copy link
Contributor Author

SammySteiner commented Jul 28, 2023

Great job on the mermaid diagram--really neat stuff! My only question/comment is regarding the database - shouldn't the replica DB be the same as the Postgres DB?

@gcarson-bit Good question, I wasn't sure what to do with that. I imagine while we're using the replica database living in the microhealth tenant, those are definitely separate. But once we set up replication, I wasn't sure if we would keep the logging and user access tables for our api in a separate db or just in separate tables in the replicated database.

Copy link
Collaborator

@widal001 widal001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks awesome!! I left a few comments about some of the details hard coded in the diagram that we can discuss further in slack.

Once we reach alignment on that question, I'll approve!

classDef ecs fill:#FF9900,color:black
```

## Relevant ADRs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the links to the relevant ADRs!!! Great addition.

Comment on lines 96 to 98
tstgrntsee1.cshqswcusbcd.
us-east-1.rds.amazonaws.com
:1521")]:::db
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is in a private subnet so there shouldn't necessarily be a security concern, but my instinct would be avoid hard coding IP addresses and ports into the diagram -- unless you feel like including those details here provides important system-design-level information.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would agree w/ removing the actual address.

:1521")]:::db
PDB[("Multi-AZ Postgres DB
for Back End
IP.TBD:5432")]:::db
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above, I'd exclude this from the final diagram.

subgraph private-subnet3 [Private Subnet]
DB[("Multi-AZ Grants.gov
Replica Database
tstgrntsee1.cshqswcusbcd.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment above re: IP address and Port details

Copy link
Collaborator

@acouch acouch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Along with the comment above, I would also either remove the "IAM," "SSM," and "Cloudwatch" or integrate them into the flow. Does cloudwatch trigger the container update, or is it just for logging? If it is the latter, pulling it out into its own graph could help indicate that
image

@lucasmbrown-usds
Copy link
Collaborator

A couple stray thoughts:

  1. Will the front-end point at the API endpoints of the backend through the public internet (i.e., there's no privileged access of the front-end)?

  2. To convert data from the existing data format (in the replica DB) into a streamlined, new data format (in the Postgres DB), there's probably some type of conversion task (maybe it's stream processing where changes in the replica trigger a task to update data in the new Postgres DB? or maybe batch processing). Is that represented here as part of the ECS Back-End Tasks, or do we want to call it out separately?

Otherwise looks great!

@acouch
Copy link
Collaborator

acouch commented Aug 1, 2023

Will the front-end point at the API endpoints of the backend through the public internet (i.e., there's no privileged access of the front-end)?

At some point. I would imagine that the need for HHS internal users to edit the text would be the driver there. We can update the diagram once we make that change.

To convert data from the existing data format (in the replica DB) into a streamlined, new data format (in the Postgres DB), there's probably some type of conversion task (maybe it's stream processing where changes in the replica trigger a task to update data in the new Postgres DB? or maybe batch processing). Is that represented here as part of the ECS Back-End Tasks, or do we want to call it out separately?

We are still doing discovery (#369 ) on what service or set of tools we will do that with. I think the replication could be a separate diagram as you've noted, once we have a strategy in place. I do think we could be more explicit about that relationship in this diagram.

@SammySteiner
Copy link
Contributor Author

I'd like to keep those in the general architecture as one of the goals is to document all the AWS services we're using, but I like the idea of subgraphing them to identify how they are being used.

Copy link
Collaborator

@acouch acouch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fantastic!

@SammySteiner SammySteiner merged commit 112cea5 into main Aug 11, 2023
@SammySteiner SammySteiner deleted the sammysteiner/issue-188-arch-diagram branch August 11, 2023 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Story]: Architecture Diagram
5 participants