r/dynamodb • • Sep 26 '17

Creating Table only With Partition Key (i.e.) Partition Key will be unique for each item

Thumbnail
acloud.guru
0 Upvotes

r/dynamodb • • Jun 24 '20

PSA: dynamoDB is NOT free

0 Upvotes

You are charged for read/write transactions. It looks like I'm going back to app engine. At least that has an actual free service. I'm not willing to pay for anything until I have something worth paying for. I'm looking for ways to host multiplayer game data for an IOS game I'm developing. So it's either going to be App Engine or Game Center.


r/dynamodb • • Jul 31 '19

3 cost-cutting tips for Amazon DynamoDB

3 Upvotes

While DynamoDB is quite popular, one common complaint we often hear from developers is that DynamoDB is expensive. In particular, costs can scale sharply as usage grows in an almost surprising manner. In this post, we will examine three reasons why DynamoDB is perceived as being expensive at scale, and outline steps that you can take to make DynamoDB costs more reasonable.

  1. Using DynamoDB partition keys

  2. DynamoDB read/write capacity modes

  3. DynamoDB scans and GSIs

More details here: https://www.infoworld.com/article/3409075/3-cost-cutting-tips-for-amazon-dynamodb.html


r/dynamodb • • Mar 29 '20

Dynobase - Professional DynamoDB GUI Client

Thumbnail
dynobase.dev
5 Upvotes

r/dynamodb • • Apr 19 '20

Multiple Entity Types in 1 Table

2 Upvotes

I come from a Relational background and I'm used to creating a Table per Entity.

With DynamoDB, the best practice is to have basically 1 Table.

If you have multiple entities in 1 Table, won't that create a ton of attributes that end of being NULL depending on the entity? Is there any downsides to that?


r/dynamodb • • Mar 10 '20

DynamoDB cost estimate question

2 Upvotes

I don't know why I just cant fully wrap my head around DynamoDB cost estimate. Wondering if someone can help.

I have about 70GB of data that I need to push into dynamo. Each record is about 500 bytes OR .5 KB.

The data is written once and would be only need eventual consistency reading there after.

The consuming application gets about 2K request per second (again, all of which would be eventual consistency reads), and each individual request would only ever fetch one record.

Im trying to estimate how much this might cost on a monthly basis.

I tried using the calculator https://calculator.s3.amazonaws.com/index.html but im getting an astronomical estimate which cannot be correct.


r/dynamodb • • Mar 30 '20

DynamoDB sparse index intro

Thumbnail
medium.com
3 Upvotes

r/dynamodb • • May 20 '19

A question related to table design

2 Upvotes

I want to create a table, in which i can able to query data based on id, then filtering out them based on age and then gender id (0 male/1 female) How can i design dynamodb design based on this concept

Thanks


r/dynamodb • • Apr 25 '18

Dynaflow, a NodeJS driver for DynamoDB using Observables

Thumbnail
medium.com
3 Upvotes

r/dynamodb • • May 19 '19

Good table design question

1 Upvotes

I am trying to grasp how to model tables where there are lots of categories of entities and lots of dead entries.

If you consider the example customer ordering scenario that the docs use you have customers, shippers, products etc.

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-modeling-nosql-B.html

Here are some questions that I have mapped to this example

  1. What happens if you have 1 million customers but only 100 of something else(like warehouses in this example). Your users primary keys are very divergent and spread the partions well, but your warehouses are very few. However each order has a warehouse(and maybe also a shipper) so they are going to be referenced a lot of times.

  2. What is the consequence of having these customers becoming inactive. Say only 100k customers are active at any given time(the rest have moved on to greener pastures but might come back). Now you have all these partitions that are not being used and only 10% that are?

  3. Should configuration data be stored in some other place entirely if every request needs to fetch it and thus its a huge hot key, or should it be stuck in there anyways and just cached on the webservers?


r/dynamodb • • Oct 03 '19

Dynamodb stream with initial state

2 Upvotes

A dynamodb table contains a list of events. A client can subscribe for updates in order to get the current events notified (I believe I would take advantage of Streams for that). If a new client subscribes I need to send the initial list of events at this moment and still make sure the subsequent notifications don't contain an event what's already in the initial list but also the notifications don't miss an event with could have happend right after the client subscribed... How can I do that?


r/dynamodb • • Jun 08 '20

Any performance implications of adding TTL

1 Upvotes

I am new to dynamodb, so I apologize if the terminology is incorrect.

I have a table with documents of many different schemas (I store the object inside of a _source attribute). I want to add a TTL attribute to the table.

From the docs, it seems pretty straight forward. I'm wondering if there are any implications of adding a new attribute - implications on performance, existing documents, etc. Or if there are any heads-up/gotchas I should be aware of.


r/dynamodb • • Jun 07 '20

Do you need to save Attributes individually if combined in Secondary Index?

3 Upvotes

I was reading this blog post and was confused a certain part.

https://aws.amazon.com/blogs/database/how-to-design-amazon-dynamodb-global-secondary-indexes/

Please Control + F to the part that says Country:State:City (sort key)

The author saves the following attributes as a sort key USA:Washington:Seattle

If the table has the Sort Key as `Country:State:City` (3 attributes combined as 1 attribute), does that mean I do not need to save 3 attributes (Counry, State, City) individually since it can be combined into the Sort Key? Seems like duplication of data if it I am saving in the Sort Key plus as individual attributes.


r/dynamodb • • Mar 25 '18

Connect to DynamoDB using AWS Lambda

Thumbnail
youtube.com
1 Upvotes

r/dynamodb • • Jun 15 '17

Invalid Key in Map? Can someone please help me identify this?

2 Upvotes

Item: { "Stats": { "M": { "N": {"Stamina": String(this.Stamina) }, "N": {"Strength": String(this.Strength) }, "N": {"Speed": String(this.Speed) }, "N": {"Wisdom": String(this.Wisdom) }, "N": {"Spirit": String(this.Spirit) }, "N": {"Agility": String(this.Agility) }, "N": {"Unspent": String(this.Unspent) }, } } },

returns error

Error: Unexpected key 'Unspent' found in params.Item['Stats'].M['N'] at constructor.fail (VM38387 aws-sdk-2-70-0-min.js:2)

I am not sure how or why, the data is there and valid, the json was valid when i posted it into dynamo. How is this key unexpected?


r/dynamodb • • Jan 13 '16

Update where X <= Y

1 Upvotes

I'm trying to write a query that will update all items where attribute "X" has a value greater than "Y". Does anybody have any example code or even tell me which command I should be using? The updateItem method requires the full key and does not appear suitable.

Many thanks.


r/dynamodb • • Jul 02 '20

French company builds life-saving GPS-enabled wristband using Rockset's real-time SQL for geo-search on DynamoDB

3 Upvotes

At ido-data, we develop waterproof GPS-connected wristbands that allow rescuers to locate water sports participants in an emergency. The ability to analyze geolocation data in real time is of critical importance to us and our customers. Knowing exactly where the wearer of our wristband is at any point in time can be the difference between life and death. We use Amazon DynamoDB as our primary database to store beacon data from the GPS tags in our wristbands. When we needed to build real-time applications on this data, we found Rockset to be the simplest way to achieve the performance we require. Rockset offers click-and connect integration with DynamoDB, so we do not have to write a single line of ETL code. All modifications in DynamoDB are continuously synced to Rockset, which automatically builds indexes to enable SQL queries that run in milliseconds. With Rockset, we were able to set up our application in a matter of hours instead of weeks. Since DynamoDB and Rockset are both serverless, our lean engineering team can focus on delivering life-saving innovations in the product rather than managing data infrastructure, because we trust DynamoDB and Rockset to give us the reliability and scale we need. DynamoDB and Rockset additionally offer the data encryption and GDPR compliance that we require for our product. We are always adding features to our product and are currently implementing functionality to determine whether a wristband is on land or water, given its latitude and longitude. This can be a complicated undertaking, as water polygons can have thousands of vertices, but Rockset’s high-performance indexing, including support for geospatial queries, will shorten our development time from weeks to days

Read full story here: https://rockset.com/case-study-ido-data-uses-rockset-for-geosearch-on-dynamodb.pdf


r/dynamodb • • Feb 01 '17

Using Datomic? Here’s How to Move from PostgreSQL to DynamoDB Local.

Thumbnail
blog.clubhouse.io
4 Upvotes

r/dynamodb • • Jul 23 '19

Reserved attribute name

3 Upvotes

I have a relative simple table with a couple of attributes but it could get bigger over time. As of now I've added `status` as another attribute, but it's a reserved key word

I was using the SDK to do getItem with `table` and `key` as the only params. Without specifying `ProjectionExpression` I would get all the attributes on the table. After adding `status` I found I have to use ExpressionAttributeNames because it's reserved and I also need to add it to `ProjectionExpression`.
Is there a way I can still get all attributes without specifying each one in `ProjectionExpression` ?


r/dynamodb • • Aug 01 '18

Setting a Boolean attribute in an UpdateExpression

1 Upvotes

Is there a more direct way to set a Boolean attribute than assigning it to a variable? That is, is this optimal?

"ExpressionAttributeValues": {":my_val": {"BOOL": true}},
"UpdateExpression": "SET my_val = :my_val"

r/dynamodb • • Feb 20 '19

Design question: Howto convert this RDMBS schema to Dynamodb?

1 Upvotes

I have a simple bookmarking-type app that will have registered users, and those users will each have list of URLs that they have bookmarked, ordered and timetamped.

I'm guessing I can/should accomplish this in....one collection (Users)? Maybe two (Users and Urls)?

I'll be talking to it from Python inside an AWS Lambda function, presumably with boto3 library.

Am I on the right track?

Thanks.

Table: Users

------------------------------------------------

user_id (PK) (autoincrement)

email (unique)

first_name (optional)

last_name (optional)

pro_account (boolean) (tinyint in mysql) -- signed up for the pro version?

signup_date - date signed up for service

signup_date_pro - date signed up for pro/paid service

Table: Users_Urls

Desc: List of Users and the Urls they've bookmarked

----------------------------------------------------

users_urls_id (PK) (autoincrement)

user_id (FK)

url

dt_bookmarked (datetime)


r/dynamodb • • Feb 03 '20

Primary key question

2 Upvotes

From what I understand, a primary key must be unique and scalar. Can a primary key have a nested value, like a list?


r/dynamodb • • Jan 30 '20

Basic update issue frustrating ( can't see the issue )

1 Upvotes

Schema

This triggered code fails

def updateDynamoDBAfterSuccess(buildid):

#todo:use a role
dynamodb = boto3.resource('dynamodb', region_name='us-east-1', aws_access_key_id='xxx',
aws_secret_access_key='xxx')
table = dynamodb.Table('builds')
response = table.update_item(
Key={
'id' : {"S": "xxx"}
},
UpdateExpression="set releasestatus = :p",
ExpressionAttributeValues={
':p': { "S": "Hardware" }
},
ReturnValues="UPDATED_NEW"
)
print("UpdateItem succeeded:")
print(json.dumps(response, indent=4, cls=DecimalEncoder))
updateDynamoDBAfterSuccess('xxx')

Error I am getting is

botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the UpdateItem operation: The provided key element does not match the schema


r/dynamodb • • Aug 28 '19

The Complete DynamoDB bootcamp - free for limited time!

4 Upvotes

I'm super excited and happy to announce my new course "The Complete DynamoDB Bootcamp". This course is valued at $79 and will teach you the basics of Amazon DynamoDB in just about 3 hours

I'm offering this course for free for a limited time. Please use the following link to enroll for free:

https://www.udemy.com/course/the-complete-dynamodb-bootcamp/?couponCode=RLSOFFER

Remember, this offer is for a limited time only and until the coupon runs out. I hope to see you there!


r/dynamodb • • Jan 05 '20

dynocsv - CLI tool to export DynamoDB table into CSV

2 Upvotes

I created the CLI tool dynocsv which allows exporting DynamoDB table into CSV file either whole (using Scan) or part of it by using a particular Query on the composite primary key (partition and/or sort) on both table or index.

The tool also supports limiting and attributes to export or rather set up attributes to skip.

Obviously, it might not be the best tool if the table is really large in size, but for the moderate size table, this works fine.

It is available to install as a go package

go get github.com/zshamrock/dynocsv

or as a snap:

snap install dynocsv

I hope you find it handy!