Database Reference
In-Depth Information
cloud instances. The database automatically replicates and/or divides data across servers as
necessary. This process of automatically replicating or dividing data is called “sharding” in
MongoDB.
FOCUS
With RDBMS, the focus is on data integrity. A handy acronym to remember is ACID
(Atomic, Consistent, Isolated, and Durable):
Atomic . Everything within a transaction succeeds or the entire transaction is rolled
back. For example, if an Order is deleted, all of its Order Lines are also deleted.
When I transfer $10 from my savings to checking account, $10 is deducted from
my savings account and credited to my checking account.
Consistent . Consistent means that the data accurately reflects any changes up to
a certain point in time. With RDBMS it is the current state, which is achieved
through database constraints. A transaction cannot leave the database in an incon-
sistent state. If an Order Line exists without its Order , recreate the Order or re-
move the Order Line . If $10 was deducted from my savings account but not cred-
ited to my checking account, roll the transaction back so the $10 goes back to my
checking account.
Isolated . Transactions cannot interfere with each other. That is, transactions are in-
dependent. The $10 transferred from my savings to checking account is a separate
transaction from the $20 check I wrote, and these two transactions (fund transfer
or fund withdrawal) are separate from each other.
Durable . Completed transactions persist even when servers restart or there are
power failures. That is, there is no undo button. Once the Order and its Order
Lines are deleted, they are gone from the system even if electricity is lost in the
building in which the server resides.
With NoSQL, the focus is less on data integrity and more on data performance and avail-
ability. A handy acronym to remember is BASE (Basically Available, Soft-state, Eventual
consistency):
Basically Available . There is a response to every query, but it could be a response
saying there was a failure in getting the data or the response that comes back may
Search WWH ::




Custom Search