Why Your First Side Project Should Be Serverless (And How to Build It)
Switching to a serverless-first approach eliminates the operational overhead and costs practically $0 to run. Here is how a junior developer can build a production-ready micro-app in three steps using AWS Lambda, Amazon API Gateway, and DynamoDB.
The Architecture: Pay-Per-Request, Never for Idle
Traditional servers charge by the hour whether users visit your site or not. Serverless scales automatically on demand:
- Amazon API Gateway: Exposes a public HTTPS endpoint and routes requests.
- AWS Lambda: Executes your code in response to API triggers and shuts down immediately after returning a response.
- Amazon DynamoDB: Stores your records in a fast, managed NoSQL table with a generous Free Tier allowance.
Step 1: Create a Simple NoSQL Table
- Open the DynamoDB Console and click Create table.
- Name the table UserFeedback and set the Partition Key to id (String).
- Under Table settings, select Default settings (or ensure it uses On-Demand capacity).
Step 2: Write the Lambda Handler
- Navigate to AWS Lambda and click Create function (choose Python or Node.js).
- Attach the basic execution role with DynamoDB write permissions (dynamodb:PutItem).
- Add a minimal handler that parses an incoming payload and inserts a record:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import json
import boto3
import uuid
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('UserFeedback')
def lambda_handler(event, context):
body = json.loads(event.get('body', '{}'))
item_id = str(uuid.uuid4())
table.put_item(
Item={
'id': item_id,
'message': body.get('message', 'Hello Builder!'),
'author': body.get('author', 'Anonymous')
}
)
return {
'statusCode': 200,
'headers': {'Content-Type': 'application/json'},
'body': json.dumps({'success': True, 'id': item_id})
}Step 3: Wire an HTTP Endpoint via API Gateway
- Inside your Lambda function view, click Add trigger.
- Select API Gateway → Create an API → HTTP API.
- Set Security to Open for initial testing, and save.
- Copy the generated API endpoint URL and test it using curl or Postman:
1
2
3
curl -X POST https://<your-api-id>.execute-api.<region>.amazonaws.com/default/<function-name> \
-H "Content-Type: application/json" \
-d '{"message": "Deploying my first serverless app!", "author": "JuniorDev"}'Key Takeaway for Builders
Starting serverless removes infrastructure anxiety. You never have to worry about forgetting to terminate a server before heading to sleep, and you get hands-on experience with modern event-driven architectures.
Builders: What was the first serverless service you experimented with, and what did you build? Let’s connect in the comments below!
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article