DynamoDB

DynamoDB now supports cross-account access. But is that a good idea?

DynamoDB now supports resource-based policies, which simplified cross-account access to tables.

But just because you can, doesn’t mean you should!

Cross-account access to DynamoDB tables is almost always a smell. But as with everything, there are exceptions and edge cases. You should think carefully before you use resource-based policies to enable cross-account access to your DynamoDB tables.

In this post, let’s explore some legitimate use cases for cross-account access to DynamoDB tables.

How to create private, VPC-only DynamoDB tables

You don’t need network security to keep your DynamoDB data safe. However, adding network security on top of IAM authentication and authorization is not a bad thing. Sometimes, it’s even necessary to meet regulatory requirements.

In this post, let’s see how to put DynamoDB in VPC so your data can only be accessed from within a VPC. We will look at what works best for feature teams and what works best for platform teams.

How to Securely let Frontend Apps to Directly Access AWS services

In this post, let’s discuss a radical idea – if the API layer is not adding any value besides authentication and calling the AWS SDK, then why not just remove it and let the frontend talk to your AWS resources directly? It will be the cheapest way to build a full-stack application, and there are similar precedents in the IoT space already.

It’s not the way that I’d recommend for most of you. But it’s possible to do it safely so that a user can only access his/her data. All you need is a little bit of IAM policy and a Cognito Identity Pool.

How to perform database migration for a live service with no downtime

Performing a database migration while continuing to serve user requests can be challenging. It’s a question that many students have asked during the Production-Ready Serverless [1] workshop. So here’s my tried-and-tested approach to migrating a live service to a new database without downtime. I’m going to use DynamoDB as an example, but it should work …

How to perform database migration for a live service with no downtime Read More »

How I built an affiliate tracking system in a weekend with serverless

Having taught thousands of students to build serverless applications via my online courses and workshops, I felt it was time to kick-start an affiliate program to boost sales. Affiliates would receive 50% of the revenue and get a 15% discount code for their audience. It feels like a good deal but I would need a …

How I built an affiliate tracking system in a weekend with serverless Read More »

How to model one-to-many relationships with AppSync and DynamoDB

Thank you to Josh for asking this question on the AppSync Masterclass forum. His original question goes like this: Let’s say I want to add a one-to-many relationship from Profile to a new property called “Tag” (a complex object with “name” and “color” properties) so a user can define their own Tags. I would also like a …

How to model one-to-many relationships with AppSync and DynamoDB Read More »

AppSync: how to error on DynamoDB conditional check failures

TL;DR To make an AppSync DynamoDB resolver throw exceptions on conditional check errors, we need to check $context.error in the response mapping template ourselves. Like this: #if ( $ctx.error ) #if ( $ctx.error.type.equals(“DynamoDB:ConditionalCheckFailedException”) ) $util.error(“your error message”) #else $util.error($ctx.error.message, $ctx.error.type) #end #end $utils.toJson($context.result) And now, the longer version. The problem AppSync lets us perform DynamoDB …

AppSync: how to error on DynamoDB conditional check failures Read More »

All you need to know about caching for serverless applications

Caching is still important for serverless architectures. Just because AWS Lambda auto-scales by traffic, it doesn’t mean we can forget about caching. In this post, let’s break down by caching is still relevant for serverless and where we can apply caching in a serverless architecture. Caching is still VERY relevant. Yes, Lambda auto-scales by traffic. …

All you need to know about caching for serverless applications Read More »

How to include SNS and Kinesis in your e2e tests

Update 17/09/2019: based on feedback, I added a few more alternatives that do not require you to deploy additional Lambda functions to the e2e-test stage. Scroll to the end to find out more. Being event-driven is a key characteristic of a serverless architecture. Often our Lambda functions would publish events to SNS topics or Kinesis …

How to include SNS and Kinesis in your e2e tests Read More »

A simple event-sourcing example with snapshots using Lambda and DynamoDB

Recently, I have been helping a client implement an event-sourced system. In the process, I put together a very simple demo app to illustrate how one could build such a system using Lambda and DynamoDB. The source code is available on GitHub here. Before you go ahead and read all about the demo app, I …

A simple event-sourcing example with snapshots using Lambda and DynamoDB Read More »

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close