Relative Content

Tag Archive for amazon-dynamodb

how to use partition key effectively in dynamodb?

I am creating a dynamodb and stumbled upon the basic concept here and want to clarify. in the dynamo db , I have a primary key , demonstrated by id (see example below) . based on the docs , in dynamo db, this primary key is used to generate some hash internally , to determine partition this record will be in . so question , I have is , if I’m generating an unique value for id , then I assume the hash of that will be unique as well . so will each record be in a separate partition ? in that case a sort key wouldn’t make sense, right?

how to use partition key effectively in dynamodb?

I am creating a dynamodb and stumbled upon the basic concept here and want to clarify. in the dynamo db , I have a primary key , demonstrated by id (see example below) . based on the docs , in dynamo db, this primary key is used to generate some hash internally , to determine partition this record will be in . so question , I have is , if I’m generating an unique value for id , then I assume the hash of that will be unique as well . so will each record be in a separate partition ? in that case a sort key wouldn’t make sense, right?

How to implement pagination with ExclusiveStartKEey and LastAccessDate?

This was aws JS sdk
“TableName”: “lmsprojectqa”,
“ScanIndexForward”: true,
“ConsistentRead”: false,
“KeyConditionExpression”: “#876e0 = :876e0 And begins_with(#876e1, :876e1)”,
“FilterExpression”: “#876e2 BETWEEN :876e2 AND :876e3”,
“Limit”: 2,
“ExclusiveStartKey”: {
“SK”: {
“S”: “APP#b1-3”
},
“PK”: {
“S”: “PROJECT#b”
}
},
“ExpressionAttributeValues”: {
“:876e0”: {
“S”: “PROJECT#b”
},
“:876e1”: {
“S”: “APP#”
},
“:876e2”: {
“S”: “2024-07-23T04:00:00.168Z”
},
“:876e3”: {
“S”: “2024-07-31T04:00:00.168Z”
}
},
“ExpressionAttributeNames”: {
“#876e0”: “PK”,
“#876e1”: “SK”,
“#876e2”: “lastAccessDate”
}
}

DynamoDB OneToMany relation

I want to create small live chat app with socket connections based on AWS serverless architecture. For this I was created socket and 3 lambda functions (connect, sendMessage and disconnect). I will have many chats and users can enter to the chat and create connection to socket for this chat. One chat can have many connections and when users leave the chat I need to remove this connection. For implement this I can’t understand how to add connection to DynamoDB, because y need to get all connection to the chat for send messages to all of them, and how i can get chat by connectionID for removing this connection from chat.