DynamoDB Update Field with a Serverless API

  Рет қаралды 9,852

Complete Coding - Master AWS Serverless

Complete Coding - Master AWS Serverless

Күн бұрын

Пікірлер: 30
@saadsher
@saadsher 4 жыл бұрын
Cheers Sam, these series of videos come in handy as I transition from frontend to full stack! I owe you loads of beers :)
@CompleteCoding
@CompleteCoding 4 жыл бұрын
It's great to know that you're making the most of these. Good luck with the career upgrade!
@adrianjason13
@adrianjason13 4 жыл бұрын
As always, outstanding content from you Sam. Glad to have found your channel last week. Helpful in doing my current dev work here at our company. Subscribed!
@CompleteCoding
@CompleteCoding 4 жыл бұрын
Fantastic! Glad to hear that you're finding the videos useful
@vivekgupta1590
@vivekgupta1590 4 жыл бұрын
Hi Sam, Your tutorials are amazing! Thanks for sharing it with AWS community :)
@CompleteCoding
@CompleteCoding 4 жыл бұрын
My pleasure!
@CompleteCoding
@CompleteCoding 4 жыл бұрын
Are there any topics you would like me to do a video on?
@divyanshsrivastava5540
@divyanshsrivastava5540 4 жыл бұрын
Yes. How to use sdk to add 1. Auto scaling, Loadbalancing in aws.
@divyanshsrivastava5540
@divyanshsrivastava5540 4 жыл бұрын
How to implement Redis Cache by using code when impementing data bases. Or tell the process by doing practicle. Thank u from New Delhi
@CompleteCoding
@CompleteCoding 4 жыл бұрын
When you create an API with API Gateway and Lambda they both automatically scale. That is one of the main reasons that I use Lambdas everywhere possible. You only need auto scaling and load balancing when you are working with EC2s. There are two main ways of doing this: using ElasticBeanstalk OR creating a custom load balancer and autoscaling group. You would do both of these when you first create your servers. You'd use either a serverless plugin or write cloudformation to do this, not the aws-sdk
@CompleteCoding
@CompleteCoding 4 жыл бұрын
To use Redis you need to set up a redis cluster. This can very complicated and very expensive. There is a service called lambda.store/ where you can use redis as a pay-per-request service. I haven't used it but it would be the easiest way to add caching to your lambdas.
@divyanshsrivastava5540
@divyanshsrivastava5540 4 жыл бұрын
@@CompleteCoding okay. can we use ElasticCahe for lambda? Probably lambda is stateless so we cannot use cache, is it right??
@FaizBerserk
@FaizBerserk 2 жыл бұрын
Hi, I have a query, In a PATCH API how do I pass an optional request body where the user may or may not update the request but if they do update, it should be reflected in response and if they don't it shouldn't
@VasylHerman
@VasylHerman 4 жыл бұрын
Happy New Year, Sam !!! I tried to update an ID that doesn't exist but a new reccord was created in DynamoDB. Can you please explain that behaviour? Thanks. You're doing an amazing job!!!
@CompleteCoding
@CompleteCoding 4 жыл бұрын
That is the behaviour that you would expect. Updating a record takes the existing record and adds the data that you have passed up. If there is no data there then it adds all of the data you sent up. If you update an existing record of { ID: 123, A: true, B: false, C: true} with a record of { ID: 123, A: true, B: true } the final record will still have a C field. If you just did a post then it would override the whole record, removing the C field.
@privymassage3458
@privymassage3458 4 жыл бұрын
Hi Sam, thanks again for another clear and easy to understand video. Quick question; how would I update nested attribute. Eg games.callofduty.score ?
@CompleteCoding
@CompleteCoding 4 жыл бұрын
The way that dynamo works is that it is a key: value pair. The value can be a string, number, array, map or a few other things. I'm your case it would be a map. The player row would have a key of games which would be a map (object) that looks like { callofduty: {score: 13}, pubg:{score:7}}. You would have to pass that whole object in the data for the update. If this is a feature that you want to implement there are better ways to design the dynamo table to make this easier. I'll be doing a video on dynamo table design soon.
@prakharbakshi7627
@prakharbakshi7627 3 жыл бұрын
bro how can we update multiple items in a single table ?
@CompleteCoding
@CompleteCoding 3 жыл бұрын
You have two options: 1. repeat the process done in this video for multiple items. You could map over them so they are all updating at once and then do a Promise.all on the returned list of promises. 2. use batchGet and batchWrite. You can get or write up to 25 requests/ batch so you may still need to do multiple batches. This will be slower and more expensive but also allows you to change multiple fields in one go.
@prakharbakshi7627
@prakharbakshi7627 3 жыл бұрын
@@CompleteCoding can you please a video on it , it will be very helpfull
@seanknowles9985
@seanknowles9985 3 жыл бұрын
Yeah this is pretty straightforward, but normally we are updating more than one field and it could be a variable update amount.... how do we do that?
@CompleteCoding
@CompleteCoding 3 жыл бұрын
In that case I would do a read to get the whole row, update all of the fields that you need and then write that whole row back.
@seanknowles9985
@seanknowles9985 3 жыл бұрын
@@CompleteCoding amazing thank you :)
@seanknowles9985
@seanknowles9985 3 жыл бұрын
@@CompleteCoding any chance for a video tut :D
@kunalghosh1117
@kunalghosh1117 3 жыл бұрын
Solid tutorial......Sam could you please create a video tutorial for chatting application in node js using AWS gateway web socket API & DynamoDB.
@CompleteCoding
@CompleteCoding 3 жыл бұрын
I already have that video! kzbin.info/www/bejne/eqvTeJmvd5Wcgc0 We don't do anything complicated with Dynamo but we do store the connection details from each websocket connection.
Create an API to get data from your DynamoDB Database
20:17
Complete Coding - Master AWS Serverless
Рет қаралды 23 М.
Create a Serverless Database - DynamoDB with the Serverless Framework
9:59
Complete Coding - Master AWS Serverless
Рет қаралды 19 М.
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
How to Query your DynamoDB tables with Serverless
21:00
Complete Coding - Master AWS Serverless
Рет қаралды 10 М.
Securing Your Serverless API With API Keys
14:21
Complete Coding - Master AWS Serverless
Рет қаралды 10 М.
AWS DynamoDB Schema Design | How to choose the right key
12:15
Be A Better Dev
Рет қаралды 219 М.
How to debug Serverless from within VS Code
17:40
Complete Coding - Master AWS Serverless
Рет қаралды 17 М.
Creating an API with Serverless - API Gateway and AWS Lambda
14:23
Complete Coding - Master AWS Serverless
Рет қаралды 31 М.
Adding New Data to your DynamoDB Database
14:45
Complete Coding - Master AWS Serverless
Рет қаралды 10 М.
Automating Emails and Tasks With Scheduled Lambda Functions - CRON job tutorial
29:16
Complete Coding - Master AWS Serverless
Рет қаралды 7 М.
Adding and Getting Files from Amazon S3 with Serverless.
21:39
Complete Coding - Master AWS Serverless
Рет қаралды 15 М.
'OXYGEN LEAK!'' Elon Musk Revealed WHY Starship Flight 7 Exploded...
11:01
Working with Data in DynamoDB from React with AWS Amplify - Full tutorial
43:10
Complete Coding - Master AWS Serverless
Рет қаралды 65 М.