6. RMySQL Package
No need to parse the data â the Fetch function puts the
queried data directly into an R data.frame format!
7. What does NoSQLmean?
â
NoSQL stands for:
â
â
â
No Relational
No RDBMS
NonRel
â Not OnlySQL
â
NoSQL is
â An umbrella term for all databases and data stores that donât
follow the RDBMSprinciples
â
â
A class of products
A collection of several (related) concepts about data storage and
manipulation
â Often related to large data sets
8. Where does NoSQL comefrom?
â
â
Non-relational DBMSs are not new
But NoSQL represents a newincarnation
â Due tomassively scalable Internet applications
â Based on distributed and parallel computing
â
Development
â Starts with Google
â
First research paper published in 2003
â
â
Continues also thanks to Lucene's developers/Apache
(Hadoop) and Amazon (Dynamo)
Then a lot of products and interests came from Facebook,
Netfix, Yahoo, eBay, Hulu, IBM, and many more
9. NoSQL and big data
â
â
NoSQL comes from Internet, thus it is often related to the
âbig dataâ concept
How much big are âbig dataâ?
â
â
Over few terabytes (>1012 â240)
Enough to start spanning multiple storage units
â
Challenges
â
â
â Efciently storing and accessing large amounts of data is
difcult, even more considering fault tolerance and backups
Manipulating large data sets involves running immensely
parallel processes
Managing continuously evolving schema and metadata for
semi-structured and un-structured data is difcult
10. Why are RDBMSnot suitable for big data?
â
â
The context is Internet
RDBMSs assume that dataare
â Dense
â Largely uniform (structureddata)
â
Data coming from Internet are
â
â
Massive and sparse
Semi-structured or unstructured
â
With massive sparse data sets, the typical storage
mechanisms and access methods getstretched
12. The Benefits of NoSQL
[https://www.mongodb.com/nosql-explained]When compared to relational databases, NoSQL databases
are more scalable and provide superior performance, and
their data model addresses several issues that the relational
model is not designed to address:
â Geographically distributed architecture instead of
expensive, monolithic architecture
â Large volumes of rapidly changing structured, semi-
structured, and unstructured data
â Agile sprints, quick schema iteration, and frequent code
pushes
â Object-oriented programming that is easy to use and
flexible12
13. NoSQL Database Types
[https://www.mongodb.com/nosql-explained]
âą Key-value stores are the simplest NoSQL databases. Every single item
in the database is stored as an attribute name (or 'key'), together with its
value. Examples of key-value stores are Riak and Berkeley DB.
âą Wide-column stores such as Cassandra and HBase are optimized for
queries over large datasets, and store columns of data together, instead
of rows.
âą Document databases pair each key with a complex data structure
known as a document.
âą Graph stores are used to store information about networks of data, such
as social connections. Graph stores include Neo4J and triple stores like
Fuseki.
13
14. ï§Features
ï§Simple primitive data
structure
ï§No predefined schema
ï§Limited query capabilities
ï§Dictionary-like
functionality at large scale
key3
key2
key1 value1
value2
value2
ï§Bioinformatics Use Case
ï§Word vectors in text
mining
ï§Caching
ï§Limitations
ï§Key lookup only, no
generalized query
ï§Small number of
attributes per entity
Key/value stores
15. Key/value stores
â
â
Store datain a schema-less way
Store data asmaps
â
â
HashMaps or associativearrays
Provide a very efcient average running time algorithm for
accessing data
â
Notable for:
â
â
â
â
â
â Couchbase (Zynga, Vimeo, NAVTEQ,...)
Redis (Craiglist, Instagram, StackOverfow, fickr, ...)
Amazon Dynamo (Amazon, Elsevier, IMDb,...)
Apache Cassandra (Facebook, Digg, Reddit, Twitter,...)
Voldemort (LinkedIn, eBay,⊠)
Riak (Github, Comcast, Mochi, ...)
16. Sorted ordered column-orientedstores
â
Data are stored in a column-oriented way
â
â
â
Data efficiently stored
Avoids consuming space forstoring nulls
Unit of data is a set of key/value pairs
â
â
Identified byârow-keyâ
Ordered and sorted based on row-key
â
â
Columns are grouped incolumn-families
Data isnât stored as a single table but is stored by column-
families
â
Notable for:
â Google's Bigtable (used in all Google's services)
â HBase (Facebook, StumbleUpon, Hulu, Yahoo!,...)
18. ï§Features
ï§Groups attributes into
column families
ï§Column families store key-
value pairs
ï§Implemented as sparse
multi-dimensional arrays
ï§Denormalized
ï§104-106 columns; 109 rows
ï§ Bioinformatics Use Case
ï§ Large studies
ï§ Many experiments & data types
ï§ Simulations
ï§ Limitations
ï§ Operationally
challenging
ï§ Suitable for large
number of servers
19. Document databases
â
Documents
â
â
â
â Loosely structured sets of key/value pairs in documents, e.g.,
XML, JSON, BSON
Encapsulate and encode data in some standard formats or
encodings
Are addressed in the database via a unique key
Documents are treated as a whole, avoiding splitting a
document into its constituent name/value pairs
â
â
Allow documents retrieving by keys or contents
Notable for:
â MongoDB (used in FourSquare, Github, and more)
â CouchDB (used inApple, BBC, Canonical, Cern, and more)
22. ï§Features
ï§ JSON/XML structures
ï§ Fields vary between docs
ï§ No predefined schema
ï§ Documents analogous to
rows
ï§ Collections analogous to
tables
ï§ Query capabilities
ï§Bioinformatics Use Case
ï§Text mining
ï§Atherosclerosis
ï§Limitations
ï§No joins
ï§No referential integrity
checks
ï§Object-based query language
{
id : <value>,
<key> : <value>,
<key> : <embedded
document>,
<key> : <array>
}
23. ï§Limitations
ï§Less suited for tabular
data
ï§Features
ï§Highly normalized
ï§Graph-based query
language (Gremlin)
ï§SQL-inspired query
language (Cypher)
ï§Support for path finding
and recursion
ï§Bioinformatics Use Case
ï§Epidemiology
simulations
ï§Interaction networks
24. Property Graph Model
name: the Doctor
age: 907
species: Time Lord
first name: Rose
late name: Tyler
vehicle: tardis
model: Type 40
25.
26. Modeling NoSQLstores
â
NoSQL data modeling often starts from the
application-specific queries as opposed to relational
modeling:
â
â Relational modeling is typically driven by the
structure of available data. The main design theme is
âWhat answers doI have?â
NoSQL data modeling is typically driven by
application-specific access patterns, i.e. thetypes of
queries to be supported. The main design theme is
âWhat questions doI have?â
â
Data duplication and denormalization are first-class
citizens
27. Querying NoSQLstores
â
Different NoSQLstores provide diferent
querying tools andfeatures
â
â From âsimpleâ filtering ofdata basedon âcolumnsâ
names/values (MongoDB, HBase,Redis, âŠ)
ToSQL-likelanguages (GoogleApp Engine,
HyperTable, Hive,...)
28. NoSQL, No ACID
â
â
RDBMSs are based on ACID (Atomicity,Consistency,
Isolation, and Durability) properties
NoSQL
â Does not give importance to ACID properties
â In some cases completely ignoresthem
â
In distributed parallel systems itis difcult/impossible
to ensure ACIDproperties
â Even with a centralcoordinator
â 2PL, 2PC and SS2PLcan help
â
Long-running transactions don't work because keeping
resources blocked for a long time is not practical
29. CAPTheorem
â
A congruent and logical way for assessing the problems
involved in assuring ACID-like guarantees in distributed
systems is provided by the CAP theorem
â At most two of the following three can be maximized at one
time
â
â
â
Consistency - Each client has the same view of the data
Availability - Each clientcan always read and write
Partition tolerance - System works wellacross distributed
physical networks
â
â
Conjectured by Eric Brewer in 2000
Proved by Seth Gilbert and Nancy Lynch in 2002
30. References
â
â
â
â
â
â
â
Tiwari, Shashank. Professional NoSQL. Wrox, 2011.
Warden, Pete. Big Data Glossary. O'Reilly Media, 2011.
Vogels, Werner (Amazon.com's CTO). All Things Distributed. Werner Vogels'
weblog on building scalable and robust distributed systems.
http://www.allthingsdistributed.com/
Katsov, Ilya. NoSQL Data Modeling Techniques.
http://highlyscalable.wordpress.com/2012/03/01/nosql-data-modeling-techniques/
Bushik, Sergey. A vendor-independent comparison of NoSQL databases:
Cassandra, HBase, MongoDB, Riak. October 2012. Available online.
Gilbert, Seth and Lynch, Nancy. Brewer's conjecture and the feasibility of
consistent, available, partition-tolerant web services. ACM SIGACT News
33.2 (2002): 51-59.
Redmond, Eric, Wilson, Jim R. , and Carter, Jacquelyn. Seven databases in
seven weeks: a guide to modern databases and the NoSQL movement. The
Pragmatic Programmers, LLC,2012.