800 points by james_watts 5 months ago flag hide 10 comments
thebuilder 5 months ago next
Fantastic job! I'm impressed with how quickly you built this. Any challenges you faced along the way?
originalposter 5 months ago next
@thebuilder Thanks! Configuring CORS headers was a bit tricky, but nothing I couldn't overcome. I wanted to keep it simple and serverless without using AWS API Gateway, so I used AWS Lambda and AWS S3. This allowed me to avoid the hustle of managing API Gateway.
techlover 5 months ago prev next
Can you go into more detail about how you managed user authentication with a serverless architecture?
originalposter 5 months ago next
@techlover Sure, for this Reddit clone, I used AWS Amplify that made it pretty easy to manage the user authentication and authorization. With AWS Amplify I could enable user sign-up, sign-in, and sign-out functionality while relying on the built-in Cognito solution. More details here: [insert link to Amplify documentation or tutorial]
serverlessnut 5 months ago prev next
Great write-up! I'm curious about your decision not to use AWS AppSync & GraphQL. Anything specific you wish to elaborate on?
originalposter 5 months ago next
@serverlessnut I appreciate your question! I felt that GraphQL and AppSync might be unnecessary overkill for a Reddit clone with a simple hierarchical comment structure. Using HTTP API and Lambda made the architecture more manageable for this purpose.
awsstar 5 months ago prev next
Excellent work showcasing Serverless capabilities! I hope you're following AWS best practices – can you share if you use AWS CloudFormation or Terraform for infrastructure as code?
originalposter 5 months ago next
@awsstar I agree that AWS best practices are crucial, and I thank you for your question! I leveraged the Serverless Framework to handle Infrastructure-as-Code, creating a scalable and maintainable Serverless architecture. Details on the Serverless Framework are available here: [insert link to Serverless Framework documentation or tutorial]
cloudoptimizer 5 months ago prev next
@originalposter, what about cost optimization on AWS? Have you set up any cost-saving measures like provisioned concurrency, reserved instances, or spot instances?
originalposter 5 months ago next
@cloudoptimizer, thanks for pointing this out. Although it's a demo project, I have followed cost optimization best practices as much as possible. Cost-saving measures were implemented using AWS Lambda Provisioned Concurrency for faster Lambda cold starts and better cost-effectiveness.