Data API architecture

Now that we know the requirements and shape of the data that we want to return, we will talk about the overall architecture. Again, the whole stack will rely on the JSON format for data exchange between all the services.

The following diagram shows what we have in the the request:


 

The request flow is as follows:

  1. We have a client browser, mobile client, or a backend service on the internet.
  2. That will query our API Gateway, passing the request with the EventId and the startDate as an optional URL parameter.
  3. This will get authenticated through an AWS IAM role.
  4. That will then launch the Lambda function.
  5. The Lambda function will then use a role to access DynamoDB.
  6. The Lambda will query Dynamo to search for that specific EventId. Optionally, the query will also include a specific startDate that is compared with EventDay. If EventDay is greater than startDate, then the records will be returned.

The following diagram shows what we have in the the response:


 

The response flow is as follows:

  1. The data will be returned from DynamoDB, as shown at the bottom-right of the preceding diagram
  2. This will be via the same IAM role associated with the Lambda function
  3. The JSON records from DynamoDB are returned to the Lambda function, which parses it into a JSON response
  4. That will get passed via the API Gateway role by the Lambda function
  5. It is passed back into API Gateway
  6. Eventually, it is returned to the client browser mobile client, or the backend service that made the initial request, so that it can be charted

We also have Amazon CloudWatch configured for monitoring requests, by providing dashboards for metrics and logs.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset