Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
3Activity
0 of .
Results for:
No results containing your search query
P. 1
BASE - An ACID Alternative

BASE - An ACID Alternative

Ratings: (0)|Views: 99|Likes:
Published by newtonapple
In partitioned databases, trading some consistency for availability can lead to dramatic improvements in scalability.
In partitioned databases, trading some consistency for availability can lead to dramatic improvements in scalability.

More info:

Published by: newtonapple on May 28, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

04/25/2015

pdf

text

original

 
48
 
May/Ju 2008
 
ACM
 
QUEUE
rat: dbak@amquu.om
Web applications have grown in popularity over the pastdecade. Whether you are building an application or endusers or application developers (i.e., services), your hopeis most likely that your application will nd broad adop-tion—and with broad adoption will come transactionalgrowth. I your application relies upon persistence, thendata storage will probably become your bottleneck.There are two strategies or scaling any application.The rst, and by ar the easiest, is vertical scaling: movingthe application to larger computers. Vertical scaling worksreasonably well or data but has several limitations. Themost obvious limitation is outgrowing the capacity o thelargest system available. Vertical scaling is also expensive,as adding transactional capacity usually requires purchas-ing the next larger system. Vertical scaling oten createsvendor lock, urther adding to costs.Horizontal scaling oers more fexibility but is alsoconsiderably more complex. Horizontal data scalingcan be perormed along two vectors. Functional scalinginvolves grouping data by unction and spreading unc-
In partitioned databases, trading some consistency for availabilitycan lead to dramatic improvements in scalability.
 
DAN PRITCHETT, EBAY
 
ACM
 
QUEUE
 
May/Ju 2008
 
49
 
mor quu: www.amquu.om
tional groups across databases. Splitting data within unc-tional areas across multiple databases, or
sharding,
1
addsthe second dimension to horizontal scaling. The diagramin gure 1 illustrates horizontal data-scaling strategies.As gure 1 illustrates, both approaches to horizontalscaling can be applied at once. Users, products, and trans-actions can be in separate databases. Additionally, eachunctional area can be split across multiple databases ortransactional capacity. As shown in the diagram, unc-tional areas can be scaled independently o one another.
FUNCTIoNAl PARTITIoNINg
Functional partitioning is important or achieving highdegrees o scalability. Any good database architecture willdecompose the schema into tables grouped by unction-ality. Users, products, transactions, and communicationare examples o unctional areas. Leveraging databaseconcepts such as oreign keys is a common approach ormaintaining consistency across these unctional areas.Relying on database constraints to ensure consistencyacross unctional groups creates a coupling o the schema
 
AN
ACID
ALTERNATIVE
 
50
 
May/Ju 2008
 
ACM
 
QUEUE
rat: dbak@amquu.om
to a database deployment strategy. For constraints to beapplied, the tables must reside on a single database server,precluding horizontal scaling as transaction rates grow. Inmany cases, the easiest scale-out opportunity is movingunctional groups o data onto discrete database servers.Schemas that can scale to very high transactionvolumes will place unctionally distinct data on dierentdatabase servers. This requires moving data constraintsout o the database and into the application. This alsointroduces several challenges that are addressed later inthis article.
CAP THEoREM
Eric Brewer, a proessor at the University o Caliornia,Berkeley, and coounder and chie scientist at Inktomi,made the conjecture that Web services cannot ensure allthree o the ollowing properties at once (signied by theacronym CAP):
2
Consistency
. The client perceives that a set o operationshas occurred all at once.
Availability
. Every operation must terminate in anintended response.
Partition tolerance
. Operations will complete, even i individual components are unavailable.Specically, a Web application can support, at most,only two o these properties with any database design.Obviously, any horizontal scaling strategy is based ondata partitioning; thereore, designers are orced to decidebetween consistency and availability.
ACID SolUTIoNS
ACID database transactions greatly simpliy the job o theapplication developer. As signied by the acronym, ACIDtransactions provide the ollowing guarantees:
Atomicity
. All o the operations in the transaction willcomplete, or none will.
Consistency
. The database will be in a consistent statewhen the transaction begins and ends.
Isolation
. The transaction will behave as i it is the onlyoperation being perormed upon the database.
Durability
. Upon completion o the transaction, theoperation will not be reversed.Database vendors long ago recognized the need orpartitioning databases and introduced a technique knownas 2PC (two-phase commit) or providing ACID guaran-tees across multiple database instances. The protocol isbroken into two phases:
• First, the transaction coordinator asks each database
involved to precommit the operation and indicatewhether commit is possible. I all databases agree thecommit can proceed, then phase 2 begins.
• The transaction coordinator asks each database to com
-mit the data.I any database vetoes the commit, then all databasesare asked to roll back their portions o the transaction.
Data Scaling
trans
0
trans
1
trans
2
products
functional scaling
      s        h      a      r        d        i      n      g
users
0
users
1
 
 Sample Schema
user
idnameamt_soldamt_bought
transaction
xidseller_idbuyer_idamount
AN
ACID
ALTERNATIVE

Activity (3)

You've already reviewed this. Edit your review.
1 thousand reads
1 hundred reads
maelbesson liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->