Elasticity:Bothstorageandservercapacitycanbeaddedontheflyby
merelyaddingmoreservers.Nodowntimeisrequired.Whenanewnodeis
added,thedatabasebeginsgivingitsomethingtodoandrequeststofulfill.
Sharding:Insteadofviewingthestorageasamonolithicspace,records
arepartitionedintoshards.Usually,ashardissmallenoughtobemanaged
byasingleserver,thoughshardsareusuallyreplicated.Shardingcanbe
automatic(e.g.,anexistingshardsplitswhenitgetstoobig),orapplications
canassistindatashardingbyassigningeachrecordapartitionID.
Asynchronousreplication:ComparedtoRAIDstorage(mirroringand/or
striping)orsynchronousreplication,NoSQLdatabasesemployasynchronous
replication.Thisallowswritestocompletemorequicklysincetheydon't
dependonextranetworktraffic.Onesideeffectofthisstrategyisthatdatais
notimmediatelyreplicatedandcouldbelostincertainwindows.Also,locking
isusuallynotavailabletoprotectallcopiesofaspecificunitofdata.
BASEinsteadofACID:NoSQLdatabasesemphasizeperformanceand
availability.ThisrequiresprioritizingthecomponentsoftheCAPtheorem
(describedelsewhere)thattendstomaketrueACIDtransactionsimplausible.
1.↑TopreventthemisunderstandingthatSQLsomehowcannotbeused,some
haveredefinedNoSQLasmeaning"notonlySQL".
DatabaseTypesbyEntityType
The new breed of NoSQL databases can be categorized several ways. This section
proposes a taxonomy that describes databases from lower to high levels of
functionality based on the type of entity that each supports. An entity could be
a tuple, record, document, or something else. Generally, more functionality is
available with the more complex entity types. Strictly speaking, however, higher
level databases are not necessarily supersets of the database "below" them.
DistributedMemoryCaches
AmemorycachesitsontopofapersistentstoresuchasaSQLdatabase,cachingmost
recentlyuseddata,typicallyrecordsorfieldvalues.Atahighlevel,amemorycacheisjust
ahashtable:everyvalueisaccessedviaakey.TheopensourceprojectMemcached
wasoneofthefirsttoexpandthememorycachemodelandcreatethenotionof
distributedcaching.Itallowsarequestononenodetofetchthevaluefromanynodein
thenetwork.Consequently,thetotalsizeoftheinmemorycacheisthesumofthe
memorycacheonallnodes.Usingcommodityhardware,morenodescanbeaddedto
increasethecachesizeandthereforeoverallperformanceoftheapplication.Intendedto
acceleratewebapplications,Memcacheddemonstratesthatanydataintensiveapplication
canenjoysignificantperformanceandscalabilitygainsusingthedistributedcache
architecture.
Memcachedisthemostusedopensourcedistributedcache,butthereareseveral
commercialdistributedcachesthatprovidesimilarfunctionality.ExamplesareOracle's
Coherence,GigaStore'sXAPInMemoryGrid,andIBM'sWebSphereeXtremeScale.
Distributedcachesprompteddeveloperstoviewdistributeddatabasesinanewway,by
invertingtheconceptofadistributedcache.Insteadofprovidingacachinglayertoan
existingdatastore,somenewdistributeddatabasestreatthedistributedhashtableasthe
database,backedbyapersistentstore.Suchimplementationsdonotrequireabackend