Giter Club home page Giter Club logo

nquayson.com-backend's People

Contributors

nquayson avatar

Watchers

 avatar  avatar

nquayson.com-backend's Issues

Code Review

Huge congrats on completing this challenge!

Epic accomplishment, great work all around. I especially appreciated that you separated out your database template from the application SAM template -- this is a great way to avoid making mistakes with your data layer. Great work.

Just a few overall code comments as you take your AWS and serverless development skills to the next level:

  • Consider using structured JSON statements as logs -- this makes them easier to search and filter in log analysis platforms. (Very important if you have lots of users hitting your Lambdas!) Here is a great post with some ideas on how to structure Lambda logs: https://theburningmonk.com/2018/01/you-need-to-use-structured-logging-with-aws-lambda/
  • I believe there may be a subtle bug in your DynamoDB UpdateItem logic - what happens if the "visitor_count" is not initialized (ie, on the first time the function is invoked?) Hint: look into the semantics of the "ADD" operation on UpdateItem to make initializing values easier
  • Suggestion: don't give your DynamoDB table a custom name. This removes the ability to update some attributes without replacement in CloudFormation. Instead, let CloudFormation name the table, and pass the generated table name to your function as an environment variable or SSM parameter.
  • Also, don't hardcode your DynamoDB table name in the Lambda code. Instead, pass it as an environment variable or SSM parameter. (This will be helpful if you ever need to deploy multiple version of your stack in the same environment).
  • Suggestion: look into "on demand" billing mode for your DynamoDB table rather than provisioned capacity -- this will likely be a cost savings for a small site like this.
  • Consider initializing your boto resources outside the Lambda handler, in global space - thus, they will only need to be initialized on cold start, which can speed up function performance.
  • Looks like your IAM role is a bit permissive -- do you really need all those DynamoDB access rights? See how far you can scope that down.
  • As a future improvement, you could check out creating your S3 bucket and CloudFront distribution in CloudFormation and deploying them as part of your front end CI/CD workflow -- that was not a requirement for this challenge, though!

Good luck, and I look forward to sharing your amazing work with the community.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.