Databases Reference
In-Depth Information
can
go wrong it
will
go wrong—and must be carefully tested in order to guarantee the
integrity of transactions.
While
ACID
systems focus on high data integrity, NoSQL systems that use
BASE
take
into consideration a slightly different set of constraints. What if blocking one transac-
tion while you wait for another to finish is an unacceptable compromise? If you have a
website that's taking orders from customers, sometimes
ACID
systems are
not
what you
want.
2.5.2
Non-RDBMS transaction control using BASE
What if you have a website that relies on computers all over the world? A computer in
Chicago manages your inventory, product photos are on an image database in Vir-
gina, tax calculations are performed in Seattle, and your accounting system is in
Atlanta. What if one site goes down? Should you tell your customers to check back in
20 minutes while you solve the problem? Only if your goal is to drive them to your
competitors. Is it realistic to use
ACID
software for every order that comes in? Let's
look at another option.
Websites that use the “shopping cart” and “checkout” constructs have a different
primary consideration when it comes to transaction processing. The issue of reports
that are inconsistent for a few minutes is less important than something that prevents
you from taking an order, because if you block an order, you've lost a customer. The
alternative to
ACID
is
BASE
, which stands for these concepts:
Basic availability
allows systems to be temporarily inconsistent so that transac-
tions are manageable. In
BASE
systems, the information and service capability
are “basically available.”
Soft-state
recognizes that some inaccuracy is temporarily allowed and data may
change while being used to reduce the amount of consumed resources.
Eventual consistency
means eventually, when all service logic is executed, the sys-
tem is left in a consistent state.
Unlike
RDBMS
s that focus on consistency,
BASE
systems focus on availability.
BASE
sys-
tems are noteworthy because their number-one objective is to allow new data to be
stored, even at the risk of being out of sync for a short period of time. They relax the
rules and allow reports to run even if not all portions of the database are synchro-
nized.
BASE
systems aren't considered
pessimistic
in that they don't fret about the
details if one process is behind. They're
optimistic
in that they assume that eventually
all systems will catch up and become consistent.
BASE
systems tend to be simpler and faster because they don't have to write code
that deals with locking and unlocking resources. Their mission is to keep the process
moving and deal with broken parts at a later time.
BASE
systems are ideal for web
storefronts, where filling a shopping cart and placing an order is the main priority.
Prior to the NoSQL movement, most database experts considered
ACID
systems to
be the only type of transactions that could be used in business. NoSQL systems are