|
| 1 | +--- |
| 2 | +readingTime: PT10M |
| 3 | +audiences: everyone |
| 4 | +docType: explanation |
| 5 | +title: System Architecture |
| 6 | +--- |
| 7 | + |
| 8 | +import { Callout } from "nextra/components"; |
| 9 | +import { DocMetadata } from "@/components/doc-metadata/DocMetadata"; |
| 10 | +import Diagram from "@/components/c4_diagram"; |
| 11 | + |
| 12 | +<DocMetadata /> |
| 13 | + |
| 14 | +## Prerequisites |
| 15 | + |
| 16 | +- Understanding of [Five Safes TES](/introduction). |
| 17 | + |
| 18 | +## System Architecture |
| 19 | + |
| 20 | +The Five Safes TES (Task Execution Service) is designed to handle sensitive data analysis within a secure and controlled environment. The architecture followed by a Fan-out pattern for the implementation and is organized into multiple layers and application components. |
| 21 | + |
| 22 | +Aggregation is supported via external tools and after 5S-TES completes analysis tasks, users can run a dedicated aggregation tool to collect and summarise results. |
| 23 | + |
| 24 | +{/* TODO: link to an example of aggregation */} |
| 25 | + |
| 26 | +<figure> |
| 27 | + <Diagram |
| 28 | + alt_image="/images/likec4/deployments/parl.png" |
| 29 | + alt_text="Illustrative context diagram for Five Safes TES architecture. Researcher interacts with submission layer, behind which three TREs are shown, each of which interact with the submission layer separately." |
| 30 | + viewId="parl" |
| 31 | + /> |
| 32 | + <figcaption |
| 33 | + style={{ fontStyle: "italic", fontSize: "0.7em", marginTop: "8px" }} |
| 34 | + > |
| 35 | + Figure 1: Illustration of the context diagram for Five Safes TES |
| 36 | + architecture. Click for interactive mode. |
| 37 | + </figcaption> |
| 38 | +</figure> |
| 39 | + |
| 40 | +## Components Architecture |
| 41 | + |
| 42 | +The Five Safes TES is divided into multiple layers of process and multiple app stack as discussed below. |
| 43 | + |
| 44 | +**The layers of the architecture are:** |
| 45 | + |
| 46 | +- **Submission Layer**: Entrypoint for user requests, authentication, and authorisation. |
| 47 | +- **TRE Layer**: Core processing layer for data analysis. |
| 48 | + |
| 49 | +**The Five Safes TES app stack includes:** |
| 50 | + |
| 51 | +- **Submission App:** Handles user submissions. |
| 52 | +- **TRE Agent App:** Manages task execution within the TRE for data analytics. |
| 53 | +- **Egress App:** Checks and approve/reject the results of the analysis. |
| 54 | + |
| 55 | +<figure> |
| 56 | + <Diagram |
| 57 | + alt_image="/images/likec4/logic.png" |
| 58 | + alt_text="Data flow through the Five Safe TES architecture." |
| 59 | + viewId="logic" |
| 60 | + /> |
| 61 | + <figcaption |
| 62 | + style={{ fontStyle: "italic", fontSize: "0.7em", marginTop: "8px" }} |
| 63 | + > |
| 64 | + Figure 2: App structure and data flow within Five Safe TES. Click for |
| 65 | + interactive mode, including data flow walkthrough. |
| 66 | + </figcaption> |
| 67 | +</figure> |
| 68 | +<Callout type="info"> |
| 69 | + The data flow diagram above is interactive. Click twice on the diagram to |
| 70 | + enter interactive mode, and then click on the blue 'Start' button at the top |
| 71 | + of the diagram to enter the data flow walkthrough. |
| 72 | +</Callout> |
| 73 | + |
| 74 | +## Operational Overview |
| 75 | + |
| 76 | +The high level overview of working of the Five Safes TES is as follows: |
| 77 | + |
| 78 | +<u style={{ display: 'block', marginTop: '20px' }}> |
| 79 | + <strong>Submission App</strong> |
| 80 | +</u> |
| 81 | +<div> |
| 82 | + |
| 83 | +1. The process begins with the end user or researcher submitting a request for the desired analysis through the Trusted Research Environments. Then, authentication and authorisation checks are performed to ensure the user is assigned to the relevant project. |
| 84 | + |
| 85 | +2. The request is then placed in a queue as a task for the corresponding nodes in the federated network and the researcher can track the stages of the analysis. |
| 86 | + |
| 87 | +</div> |
| 88 | + |
| 89 | +<u style={{ display: 'block', marginTop: '20px' }}> |
| 90 | + <strong>TRE Agent App</strong> |
| 91 | +</u> |
| 92 | +<div> |
| 93 | + 1. The TRE Agent in the TRE Layer monitors the queue for new jobs (tasks). Once identified, TRE agent get the task and start the pre-processing of the task. |
| 94 | + |
| 95 | + 2. A tool called Camunda will dynamically inject the ephemeral credentials into the environment variables of the TES message, which Executor will use to connect to the database. |
| 96 | + |
| 97 | + 3. The standardised payload is sent to the Executor, then the analysis will be executed against TRE's restricted database. |
| 98 | + |
| 99 | + 4. The results of this analysis are then saved in storage at the TRE Layer. |
| 100 | + |
| 101 | +</div> |
| 102 | + |
| 103 | +<u style={{ display: 'block', marginTop: '20px' }}> |
| 104 | + <strong>Egress App</strong> |
| 105 | +</u> |
| 106 | +<div> |
| 107 | + 1. After the analysis results are stored, the TRE notifies the data owner (a designated human reviewer) to approve the release of results. |
| 108 | + |
| 109 | + 2. The owner can now reviews the output and, if approved, authorises the egress. |
| 110 | + |
| 111 | + 3. Upon approval, the results are copied over to the Submission layer's storage, and finally, the researcher receives the analysis results. |
| 112 | + |
| 113 | +</div> |
0 commit comments