
The Life of a Single Click: A Travel Diary Through AWS
Follow one tiny “Place Order” request on its journey through Route 53, CloudFront, API Gateway, Lambda and DynamoDB, and see how a real serverless app fits together, one stop at a time.
The Life of a Single Click: A Travel Diary Through AWS
Written by the click itself.
Hi. I'm a click. A very small one.
A few seconds ago, someone tapped a button that says Place Order, and that's how I was born. I have one job: reach the database, get my order saved, and come back home with a "Success!" message.
It sounds simple. But when I looked around, I realised I'm a long way from home. So I kept a diary of the trip.
Stop 1: Route 53, the signboard
The first thing I met was a huge signboard. I only knew the name of the place I wanted (
shop.example.com ), but names are no use on a road. I needed an address.Route 53 is AWS's DNS service. It looked at my name and pointed me to the right address.
Diary note: DNS is like asking "which road leads to this shop?" and getting a direct answer.
Stop 2: CloudFront, the nearby checkpoint
Next came a busy checkpoint close to my user's city. CloudFront is a content delivery network (CDN), which keeps copies of things like images and pages in many places around the world so they load quickly.
My request was an order, which can't be answered from a stored copy, so the checkpoint waved me through. But I watched my friends who were only asking for the logo get an instant reply and leave early.
Diary note: CloudFront serves cached content fast. Anything that needs fresh work goes ahead to the backend.
Stop 3: API Gateway, the front gate
At the next stop there was a tall gate and a guard with a clipboard. API Gateway is the front door of the backend. It checked:
- Is this request going to a valid route (
POST /orders)?
- Is the sender allowed in?
- Is too much traffic arriving at once?
I passed all three and was sent through.
Diary note: API Gateway handles routing, authorization and throttling, so your code doesn't have to.
Stop 4: Lambda, the worker
Inside was a worker who looked like they had just woken up. That is how AWS Lambda works: your code only runs when a request arrives. There is no server for you to keep switched on.
The worker read my order, checked that the quantity made sense, added a timestamp, and got ready to save it.
import jsonimport boto3import uuidfrom datetime import datetime
table = boto3.resource("dynamodb").Table("Orders")
def lambda_handler(event, context): body = json.loads(event["body"])
order = { "orderId": str(uuid.uuid4()), "item": body["item"], "quantity": body["quantity"], "createdAt": datetime.utcnow().isoformat(), }
table.put_item(Item=order)
return { "statusCode": 200, "body": json.dumps({"message": "Order placed!", "orderId": order["orderId"]}), }Diary note: Lambda runs a small piece of code when something happens, and you pay only for the time it runs.
Stop 5: DynamoDB, the storeroom
Finally I reached the storeroom. Amazon DynamoDB is a NoSQL database, and its job here was to store my order safely and quickly. The worker placed me on a shelf with a unique
orderId label.That was it. I was saved.
The journey back
The "Success!" message travelled back along the same road: DynamoDB, then Lambda, then API Gateway, then CloudFront, and finally to the screen of the person who tapped the button.
The whole trip took a moment. Most people never realise a trip happened at all.
User → Route 53 → CloudFront → API Gateway → Lambda → DynamoDB │User ← ← ← ← ← ← ← ← ← ← ← ← ← ← ← ← ← ← ← ← ┘
Quick recap
Stop | Service | Its job |
|---|---|---|
1 | Route 53 | Turns a name into an address (DNS) |
2 | CloudFront | Caches content close to users (CDN) |
3 | API Gateway | Routes, secures and throttles requests |
4 | Lambda | Runs your code on demand |
5 | DynamoDB | Stores your data |
What I learned
Before this trip, I thought "the cloud" was one big machine somewhere. It isn't. It's a set of small, focused services, each doing one job well and passing the work along.
If you're just starting out, try building this exact path yourself. Create a DynamoDB table, a Lambda function, and an API Gateway route in front of it, then send your own tiny click through. Once you have watched one request travel from start to finish, a lot of AWS diagrams will suddenly make sense.
Safe travels!
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article