Live data from Hacker News

Distributed Transactions at Scale in Amazon DynamoDB (2023)

muratbuffalo.blogspot.com

51–60 of 62 posts

Re: Distributed Transactions at Scale in Amazon DynamoDB (2023)

#51
post #42

DynamoDB is great if you want to fork over a lot of money to AWS on a monthly basis. It's inability to allow you to query on arbitrary attributes/fields without creating a separate index (i.e. copy of the entire collection) is mind-boggling. There are so many better, less expensive options out there for 99.99999% of use-cases. Friends don't let friends use DynamoDB.

> It's inability to allow you to query on arbitrary attributes/fields without creating a separate index (i.e. copy of the entire collection) is mind-boggling. This attitude of everybody is incompetent at ...I need to teach them, is what is mind-boggling. Your statement misunderstands the design principles of a system like this one or others similar. It's precisely those design principles that led to not allowing to r…

Hey Skinny,

What kind of system/application/query pattern does DynamoDB optimize for that relational databases are worse options for?

I'm legitimately ignorant and a lot of people seem to dislike it. I remember thinking that running queries in JSON seemed silly. Heh.

Re: Distributed Transactions at Scale in Amazon DynamoDB (2023)

#52
post #31

No, thank you. DynamoDB promotes a terrible dev workflow, and there’s no way around it. It’s like embedding S3 directly into your application code. The client libraries are gigantic, and the documentation is misleading at times. Plus, Dynamo expects your access patterns to be static, which isn’t true most of the time. Hyperscaling is great, but many aren’t willing to give up everything else just for that.

I tried using it once and designing a schema for it makes relational databases seem fun by comparison.

Relational databases are indeed fun. There's no such thing as schemaless data; the schema either lives in your database or in your code. In the case of Dynamo, the schema lives in your code, determined by your access patterns. The problem is that access patterns change, and this state of extreme denormalization is difficult to adapt to evolving business requirements.

Re: Distributed Transactions at Scale in Amazon DynamoDB (2023)

#53
post #7

Earlier quoted context omitted.

2 times I have used DynamoDB and been extremely happy; - In a SAAS API service we used dynamodb to look up API keys and track their daily usage data. It is fast enough to look up k/v pairs (api key => key info). And also aggregate small sets (We'd sum up call counts for current month and check if the API key had enough credits). This meant that the API itself did not need our RDBMS to function. We also had a postgres…

> We also had a postgresql instance for all relational data, subscriptions, user info etc. Had a trigger that would push any api key / subscription change to DynamoDB. Wouldn't doing it right there in postgres limit your footprint?

We did not want postgres to be a central failure point of this API.

Needed a pretty high uptime guarantee so we decided that as long as AWS region is up and running, the API would also be available by using only completely managed aws services like dynamodb, lambda etc. Also had a bunch of beefy servers around other providers (hetzner, online.net etc) handling the actual work. They did not have any other dependencies either.

Re: Distributed Transactions at Scale in Amazon DynamoDB (2023)

#54
post #8

Using DynamoDB in 2025 is such a weird proposition. Horrible dev experience, no decent clients/libs, complex pricing, weird scaling in/out mechanism, slow, it only works well for well defined use-cases.

> Horrible dev experience, no decent clients/libs, complex pricing, weird scaling in/out mechanism, slow, it only works well for well defined use-cases. Most of these arguments probably don't outweigh the benefits. If you're in need of a managed, highly-consistent, highly-scalable, distributed database, and you're already an AWS customer, what would you use instead?

Postgres running in a computer.

Re: Distributed Transactions at Scale in Amazon DynamoDB (2023)

#55
post #52

Earlier quoted context omitted.

I tried using it once and designing a schema for it makes relational databases seem fun by comparison.

Relational databases are indeed fun. There's no such thing as schemaless data; the schema either lives in your database or in your code. In the case of Dynamo, the schema lives in your code, determined by your access patterns. The problem is that access patterns change, and this state of extreme denormalization is difficult to adapt to evolving business requirements.

Schemaless and denormalized are orthogonal qualities

Re: Distributed Transactions at Scale in Amazon DynamoDB (2023)

#56
post #42

Earlier quoted context omitted.

> It's inability to allow you to query on arbitrary attributes/fields without creating a separate index (i.e. copy of the entire collection) is mind-boggling. This attitude of everybody is incompetent at ...I need to teach them, is what is mind-boggling. Your statement misunderstands the design principles of a system like this one or others similar. It's precisely those design principles that led to not allowing to r…

Hey Skinny, What kind of system/application/query pattern does DynamoDB optimize for that relational databases are worse options for? I'm legitimately ignorant and a lot of people seem to dislike it. I remember thinking that running queries in JSON seemed silly. Heh.

My name is Marco Inaros!

> What kind of system/application/query pattern does DynamoDB optimize for

Start here:

"Real-world use cases for Amazon DynamoDB" - https://d1.awsstatic.com/events/reinvent/2019/REPEAT_1_Real-...

> I'm legitimately ignorant and a lot of people seem to dislike it.

Start here:

"AWS re:Invent 2018: Amazon DynamoDB Deep Dive: Advanced Design Patterns for DynamoDB " - https://youtu.be/HaEPXoXVf2k

Then:

"Build with DynamoDB | S1 E5 – A Data Modeling Use Case Deep Dive" - https://youtu.be/mcZwJQ7O8iw

"Model hierarchical automotive component data using Amazon DynamoDB" - https://aws.amazon.com/blogs/database/model-hierarchical-aut...

"AWS re:Invent 2024 - Advanced data modeling with Amazon DynamoDB" - https://youtu.be/hjqrDqVaiw0

Re: Distributed Transactions at Scale in Amazon DynamoDB (2023)

#57
post #49
post #36

Earlier quoted context omitted.

> You can get really far with a RDMS before event sourcing etc is needed You can manage up to 0 partners easily. Once you go above that threshold, you're into "2-Generals" territory. At that point you're either inconsistent, eventually-consistent, or you're just bypassing your own database and using theirs directly. > dev and user experience are going to be much simpler and easier. I have objects, not relations. I'm…

Yeah this is a much better initial dev experience but you still have a schema, even if you ignore it. When your objects are inconsistently shaped something has to fix them. That something is going to take the shape of custom code that would make even the Perl-iest DBA blush.

So we've shifted from:

  SQL now (for dev experience) && no-SQL later (for scaling)
to:

  no-SQL initially (for *much better* dev experience) && no-SQL later (for scaling)
I can get behind that.

> When your objects are inconsistently shaped something has to fix them

They have one schema (the class file) instead of two (the class file and the SQL migrations).

Re: Distributed Transactions at Scale in Amazon DynamoDB (2023)

#58
post #18

Earlier quoted context omitted.

> The thing that would put me off using DynamoDB is the same reason I wouldn't use any other tech - can I download it? Amazon provides a downloadable version for development. I don't know how close it is to the real thing, but it makes it easier to do local dev. Localstack also supports it in their paid version

The downloadable version is nowhere near ready for production. It's performance is also excruciatingly slow.

It's not supposed to be used for production, it's supposed to be used for development

Re: Distributed Transactions at Scale in Amazon DynamoDB (2023)

#59
post #57
post #49

Earlier quoted context omitted.

Yeah this is a much better initial dev experience but you still have a schema, even if you ignore it. When your objects are inconsistently shaped something has to fix them. That something is going to take the shape of custom code that would make even the Perl-iest DBA blush.

So we've shifted from: SQL now (for dev experience) && no-SQL later (for scaling) to: no-SQL initially (for *much better* dev experience) && no-SQL later (for scaling) I can get behind that. > When your objects are inconsistently shaped something has to fix them They have one schema (the class file) instead of two (the class file and the SQL migrations).

> They have one schema (the class file) instead of two (the class file and the SQL migrations).

But what happens when that schema defining class file needs to change? You put all your migration code there? How is that different from SQL migrations?

Re: Distributed Transactions at Scale in Amazon DynamoDB (2023)

#60
post #52

Earlier quoted context omitted.

I tried using it once and designing a schema for it makes relational databases seem fun by comparison.

Relational databases are indeed fun. There's no such thing as schemaless data; the schema either lives in your database or in your code. In the case of Dynamo, the schema lives in your code, determined by your access patterns. The problem is that access patterns change, and this state of extreme denormalization is difficult to adapt to evolving business requirements.

Schemas are a lot easier to modify in code. As a network admin I have spent many hours using solarwinds and directly using SQL to query the database and it is a non-normalized mess of duplicate fields. They have MAC addresses stored in 10 different places in 4 different formats. I think the reason for this is that they simply can't easily change existing tables so have to create new ones.
Post reply on HN