V
V
Vladimir2019-04-10 12:21:09
Django
Vladimir, 2019-04-10 12:21:09

Transactions in DynamoDB?

Hello! There is a small service written in Django. The general essence is a user with a balance of points and a table for writing off / crediting points. When acting with points, the user's balance field is updated, plus when writing off, it is checked whether the user has a balance. In view of possible loads and in general, django transaction.atomic (to all or nothing) and select_for_update are implemented to block the balance for the duration of the write-off.
The trick is that the service should always be available, but in fact it can stand idle for a month.
There was an idea (more for interest) to translate it as serverless (Lambda + DynamoDB)
Please tell me, is it possible to implement something similar with DynamoDB?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Shumov, 2019-04-12
@FonVald

There are no transactions in DDB, but you can come up with a different interaction scheme. In the Cloud, especially in AWS, when moving, you need to understand that in this world, other rules of the game and traditional architecture are expensive and painful. You can create events for your case on events via lambda. For example, write a balance change to a table, send an event to lambda and handle exceptions there. It's an asynchronous world

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question