Skip to content

Commit 8787d76

Browse files
added initial sequence diagrams to doco
1 parent 31d7d2c commit 8787d76

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

README.MD

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,13 @@ Pub/Sub: https://github.com/googleapis/nodejs-pubsub/
4040

4141
## Architecture
4242
The API endpoint footprint is small and doesn't need to maintain any state. This makes it a prime candidate for Lamba-style webhooks. (Benefits: Auto-scaling, minimal upkeep, smaller code footprint etc.)
43-
User will interact with a single REST endpoint (/images) through GET and POST requests.
43+
User will interact with a single REST endpoint (/images) through GET and PUT requests.
4444

45+
![Image API GET sequence](/screenshots/doc_assets/GET.png)
4546

46-
For Uploading the images, we need the POST endpoint to initiate one or more upload operations. In this case, we'll trigger one or more instances of a Lambda function. (Phase 2 could utilize a Pub/Sub service with workers consuming the upload tasks - Beyond the scope of this demo)
47+
![Image API PUT sequence](/screenshots/doc_assets/PUT.png)
48+
49+
For Uploading the images, we need the PUT endpoint to initiate one or more upload operations. In this case, we'll trigger one or more instances of a Lambda function. (Phase 2 could utilize a Pub/Sub service with workers consuming the upload tasks - Beyond the scope of this demo)
4750

4851

4952
For real-time feedback on the upload process, we could have the client long-poll the GET status. However, because we want to have multiple image uploads of undefined size, a better approach would be to use a Web Socket where the client can be notified of status updates of each upload. This would also provide a means for real-time upload states - a chunked upload can provide %age upload completions to the client side in real-time.

doc_assets/GET.png

178 KB
Loading

doc_assets/PUT.png

134 KB
Loading

0 commit comments

Comments
 (0)