Is DynamoDB actually tenable as a fully fledged DB for an app?

I’ve only played with ScyllaDB a few years ago as a drop-in replacement for Cassandra, it was nice (lightweight iirc) but I’ve never used it in production.

I mean why are you using it like a relational db and thinking of relations? With dynanodb you denormalise and dulplicate data.

I’m still unsure how people actually efficiently manage migrations.

Simply put: efficient migrations aren’t a staple of DDB. DDB is a database that punishes you for changing your mind. If you forsee that happening often, where you need to update your schema or access pattern, do not use DDB.

You should really only use DDB when you know your access patterns up front. If that’s the case and performance and reliability are paramount to your app, and your willing to pay for those assurances, then you use DDB. Otherwise, make your life a whole lot easier and just use Postgres.

Amazon.com itself isn’t using much DynamoDB, what’s your point?

Thanks for the advice!

FYI: We use it store data of like 100 million customers.

That’s absolutely not true. Amazon almost exclusively uses DynamoDB. Hell I only know a single team in all of Amazon that uses RDS. Everyone else used DDB. I worked on one team that used mongo and really regretted it. There’s actually a quite a bit of overhead to use relational databases at amazon, to the point where most apps are not allowed to use them at all.

Hell I was working on a team that was writing a querying layer for distribution centers. The problem statement fit perfectly for relational databases: we want an application to issue arbitrary queries to find inventory levels, locations, purchase orders, statuses, etc. we had to do all of this using DDB, S3, mongo, Neptune or anything other than RDS. We ended up going with DDB, though v0 used mongo and hated it.

Netflix and Tinder come to mind, but I have personally worked with Southwest Airlines making heavy use of dynamo for their ticketing system.

I’m not sure how much love there is for DocumentDB but you might also want to throw it into your tool belt as well. It’s decent, well priced and very easy to integrate with using the SDKs as well. It really depends on your scale too.

I was using Dynamo as DB and I can tell you, if your app isn’t simple you are f*cked. It is a pain in the ass to write complex queries; And you don’t have cool stuff like the ‘unique’ keyword, so you need to write double queries/inserts; And it does not have complex pagination, so forget about it… To model the data in a efficient way, you must beforehand write a document (I did using excel) for every Entity, and for most of the case might have to use MultiTable Modeling and that sucks; I would say that if your job isn’t a full time DynamoDB modeler, then you must only use it for simple purposes, like logging or caching.

Now I switched everything back to Postgres and going to use Dynamo to handle sessions for my web portals instead of Redis (too expensive to me) – lets see if I gonna cry everyday again

Let me tell you, as a consultant who worked with many diverse clients, early on in my career I was all for single table designs in dynamodb. It was fun to talk about, unique, and frankly easy to sell. As a consultant, it was great. Never had to deal with long term maintenance. Now that I’m not a consultant anymore, for the love of God. Do not do this. Single table design is awful to maintain and makes every other aspect of development harder and you end up just throwing a cache in front of it anyways.

Having gone this: don’t use Dynamodb unless you are 100% of your use patterns and that they will not change. The amount of workarounds and compensation that needs to be done when something slightly different gets added is annoying. For example, I need to calculate how many charges a customer generated over a month. This is a new feature and you have tens of millions of entries already. Unless you were aggregating this somewhere, than you are stuck with ineffective/slow scanning OR you use streams and extract it to a 3rd party system like opensearch to do all those calculations. You might be able to add another index to make the scan better, but you get 5 secondaries total on that table which limits how many “features” of this nature can be added. Stuff like this is stupid simple in traditional non-sexy databases technologies, but becomes a pain in the @$$ with nosql. While dynamodb is technologically impressive, I wouldn’t choose to use it for any more than simple apps and certain caching types.

I’m not an expert but I’ve used DDB for a simple ish app (just users and eCards) and even that I screwed that up. The problem is thinking in relational way. Ever since then I gave a lil bit more attention on access patterns. It’s really hard to switch from the relational mindset (and frankly, it’s easier for me to think in relational too)

I wonder what kind of scale are you at that you have to use DDB.

I’ve been using DDB in production for six years. There is a lot of good information already in this thread and I’m going to no repeat it. The one thing I do want to add is that you should construct your DDB schema to support your primary query access patterns and ALL application business logic. Any secondary query patterns you should use OpenSearch (use DDB Streams w/ Lambda to build near realtime index).

It can be sometimes hard to distinguish primary and secondary query access patterns. My rule of thumb is that the primary query access patterns are the default views of data a user might see as well as key user experiences. For example, being able to sort a list of orders by data and status (pending, delivered, canceled) are primary. Being able to sort a list of orders by price, quantity, item type, etc are secondary and should leverage a secondary index store.

We are using DDB for essentially all of our e-commerce production data (millions and millions of rows across hundreds of tables)

We love it. Like, to us i would say it’s paramount to our ability to scale.

You are correct in that you can’t do migrations, but you need to change your frame of mind. Shopping carts have a life span of what, one hour? A week at most? Then it doesn’t matter if your two year old carts are missing some field. You need to understand the patterns of your data and keep an open mind. If you can only see relational traditional structures then you will have a hard time with DDB.

My only big gripe is analytics / reports generation. Getting a lot of data from DDB for aggregation is impossible. Best stream it to some other service for that.

This is such a LOL worthy question.

DynamoDB powers Amazon’s store front. Yes, it is tenable. It is in fact what Amazon built in order to have anything that was capable of handling their needs for black Friday.

Would you mind expanding a bit? Understand if it’s a hot spot issue haha. I’ve tried to use DDB single table for multiple systems now and I just get bitten every time.

Yea, pretty much it works in a system where you know access patterns, you don’t need dynamic search, and your schema/access patterns never or seldom change. Unfortunately these situations pretty much never happen.

It’s just one of those easy shiny things to sell to execs who don’t have to maintain it and it’s great for creating recurring customers of your consultant group.

I’m glad my question made you lol :wink:

I guess I should have phrased it more as `Advice or experience wen using DynamoDB in apps at scale`

It’s cost, complexity and pricing/resource allocation structure is daunting/confusing to envisage in a large, production app.

In any case, the information in this thread has delivered exactly what I was looking for, so maybe I could have phrased it differently and not questioned it’s tenability but, it seems like it’s generated an interesting debate either way.

I’m not sure if DynamoDB will suit your needs. However, if you choose to use it, I’d highly suggest that you check out resources on Single Table Design, before going along that route. You don’t have to do single table design, but using single tables works better in DynamoDB for many situations where you’d normally do joins in a relational database. It does scale pretty damn well, but it has trade-offs. Also, it doesn’t scale down nearly as fast as it scales up, so in the past I’ve had to schedule jobs to scale down the capacity when we knew there were long idle periods to save on costs.