Couple of Minutes: Serverless Microservices Architecture

Loganathan Murugesan
Couple of Minutes
Published in
2 min readFeb 2, 2019

In this post, let us look at building a digital gallery using serverless microservices in AWS. Let us not worry about login screen in this post. Let us see how we can architect a digital gallery where you can upload pictures, view pictures you’ve uploaded with relevant advertisements shown based on labels in the respective picture and delete pictures.

I’ve come up with the below architecture to build this digital gallery.

Serverless Architecture

Key components in the architecture are described below.

S3 Buckets: We will need 2 buckets. One bucket to hold static web resources like html, js, css. This bucket will have “Static website hosting” enabled. Second bucket will hold the images the users upload.

Lambda Functions: We will have n number of lambda functions, each with a specific single responsibility. These functions operate as microservices, communicate with each other as needed to respond to requests.

API Gateway: Act as a “front door” for user interface to invoke the logic that reside in Lambda functions. We will use API Key to secure our Lambda function invocations.

Rekognition: AWS Rekognition API is used to extract contextual metadata from the images users upload to S3 bucket.

DynamoDB: The metadata extracted by Rekognition will be stored in DynamoDB.

SQS: Help Lambda functions post to a queue which trigger another lambda function asynchronously.

Deals API: A third party API to show advertisements to a user when a image is viewed, based on rekognition results on that image.

In the next post, let us look at the different microservices patterns used in this architecture.

--

--