Instructor: So here is a new feature
of DynamoDB called Transactions.
It's a new feature from November 2018.
So it should appear in the exam very soon.
And a transaction is the ability
to create, update or delete multiple rows in multiple tables
at the same time.
It's very familiar to what a transaction is in RDBMS
such as PostgreSQL.
So it's called Transactions because it's an all or nothing
type of operation.
That means that, either all the things you said
as per that transaction happen.
Either none of them happen.
This is the main feature of a transaction here.
So now for the Write Modes.
We know the Standard Write Mode,
but now there's a new Write Mode called Transactional.
And for the Read Mode we know Eventual Consistency,
we know Strong Consistency,
but now there is Transactional as a new Read Mode.
So, for the Transactional Mode,
it Consumes twice the WCU or RCU that you know of.
No calculations should be expected of you.
The only thing is, that is expected of you
is to remember what the transaction is,
and in which case you will use it.
So how about we go through an example.
And this is just a theory lecture.
So let's say we have an Account Balance Table.
And the Account Balance Table has the account id,
the balance, the money the user has in their account,
and the last transaction timestamp.
Now so there is a Bank Transaction Tables,
which represents the transactions
maybe between the accounts.
So here we can see that we have two transactions
between these two accounts.
And we can see the value of these transactions.
Obviously, if I wanted update,
and add a bank transaction to a table,
I also want to add that to my Account Balance Table
at the very same time.
I don't want an update to happen
to the Bank Transaction Tables
and not happen to the Account Balance.
So we need either both things to happen,
both Writes to happen to both tables
or none of it.
And this is a perfect use case for transaction.
So transaction again is a Write to both tables, or none.
And hopefully that clarifies the concept for you.
So it's not something you can do for the console
but it's something you need to be know about.
And for the exam, probably just a high level.
So I hope that was helpful
and I will see you in the next lecture.