VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
NoSQL Overview
1. Hoàng
Anh
Tú
NoSQL
Introduction to NoSQL
Hoàng
Anh
Tú
1
2. Introduc6on
to
NoSQL
1An
Overview
of
NoSQL
2Characteris8cs
of
NoSQL
3NoSQL
Storage
Types
3.
1 AN
OVERVIEW
OF
NOSQL
Hoàng
Anh
Tú
3
4. What
is
NoSQL?
Hoàng
Anh
Tú
4
A
NoSQL
(o:en
interpreted
as
Not
Only
SQL)
database
provides
a
mechanism
for
storage
and
retrieval
of
data
that
is
modeled
in
means
other
than
the
tabular
rela6ons
used
in
rela6onal
databases.
5. History
Hoàng
Anh
Tú
5
Billions
of
requests
a
month
RDBMS
limits:
-‐ scalability
-‐ paralleliza6on
-‐ cost
the
data
set
is
minimally
cross-‐referenced
GFS
Chubby
MapReduce
Big
Table
Lucene
Hadoop
Cassandra
Pig
2003
2006
2004
1999
2005
2008
6. CAP
Theorem
Hoàng
Anh
Tú
6
all
nodes
see
the
same
data
at
the
same
6me
A
non-‐failing
node
will
return
a
reasonable
response
within
a
reasonable
amount
of
6me
(no
error
or
6meout)
The
system
will
con6nue
to
func6on
when
network
par66ons
occur
7. CP
vs
AP
Hoàng
Anh
Tú
7
Consistency/Par66on
Tolerance
Availability/Par66on
Tolerance
8. ACID
vs
BASE
• Basic
availability:
Each
request
is
guaranteed
a
response—successful
or
failed
execu6on.
• SoL
state:
The
state
of
the
system
may
change
over
6me,
at
6mes
without
any
input
(for
eventual
consistency).
• Eventual
consistency:
The
database
may
be
momentarily
inconsistent
but
will
be
consistent
eventually.
Hoàng
Anh
Tú
8
9. Why
NoSQL?
• Schemaless
data
representa8on
• Development
8me
• Speed
• Plan
ahead
for
scalability
Hoàng
Anh
Tú
9
15. Challenges
• Schema
flexibility:
the
schema
is
needed
before
implemen6ng
the
applica6on.
Upda6ng
schema
is
hard
especially
when
edi6ng
the
exis6ng
tables’
schema.
• Complex
queries:
the
tables
are
designed
denormalized
which
means
that
the
developers
end
up
wri6ng
complex
so-‐called
JOIN
queries
• Data
update:
Upda6ng
data
across
tables
is
probably
one
of
the
more
complex
scenarios
especially
if
they
are
to
be
a
part
of
the
transac6on.
Note
that
keeping
the
transac6on
open
for
a
long
dura6on
hampers
the
performance
• Scalability
– What
is
the
6me
taken
to
synchronize
the
data
across
physical
database
instances?
– What
is
the
6me
taken
to
synchronize
the
data
across
datacenters?
– What
is
the
bandwidth
requirement
to
synchronize
data?
Is
the
data
exchanged
op6mized?
–
What
is
the
latency
when
any
update
is
synchronized
across
servers?
Typically,
the
records
will
be
locked
during
an
update.
Hoàng
Anh
Tú
15
16. NoSQL
Approach
• Schema
flexibility:
allows
flexibility
of
adding
one
or
more
columns
as
required,
on
the
fly
• Complex
queries:
NoSQL
databases
do
not
have
support
for
rela6onships
or
foreign
keys
• Data
update:
synchroniza6on
with
conflict
resolu6on
and
eventually,
consistency
across
the
datacenters
within
an
acceptable
6me
that
would
run
in
few
milliseconds
• Scalability
– Neilix
moved
from
Oracle
RDBMS
to
Apache
Cassandra,
and
they
could
achieve
over
a
million
writes
per
second1.
Hoàng
Anh
Tú
16
1hjp://www.slideshare.net/hluu/neilix-‐
moving-‐to-‐cloud
17.
3 NOSQL
STORAGE
TYPES
Hoàng
Anh
Tú
17
18. Column-‐oriented
Hoàng
Anh
Tú
18
SM1,Anuj,Sharma,45,10000000
MM2,Anand,,34,5000000
T3,Vikas,Gupta,39,7500000
E4,Dinesh,Verma,32,2000000
SM1,MM2,T3,E4
Anuj,Anand,Vikas,Dinesh
Sharma,,Gupta,Verma,
45,34,39,32
10000000,5000000,7500000,2000000
RDBMS
Column-‐oriented
Oracle
RDBMS
Columnar
Expression
Microso:
SQL
Server
2012
Enterprise
Edi6on
Apache
Cassandra
Hbase
Google
BigTable
19. Advantages
of
Colum-‐oriented
• allow
adding
columns
over
6me
• working
with
a
subset
of
the
available
columns
• new
values
are
applied
for
either
all
rows
at
once
or
with
same-‐
column
filters
• efficient
storage
in
terms
of
size
Hoàng
Anh
Tú
19
21. Advantages
of
Document
Store
• content
is
schemaless
• may
or
may
not
be
possible
to
retrieve
or
update
a
record
par6ally
• Searching
across
mul6ple
en6ty
types
is
far
more
trivial
• JSON-‐based
stores
are
easy
to
define
what
I
call
projec8ons
Hoàng
Anh
Tú
21
22. Key-‐value
Store
Hoàng
Anh
Tú
22
Redis
(in-‐memory,
with
dump
or
command-‐log
persistence)
Memcached
(in-‐memory)
MemcacheDB
(built
on
Memcached)
Berkley
DB
Voldemort
(open
source
implementa6on
of
Amazon
Dynamo)
• Unlike
a
document
store
that
can
create
a
key
when
a
new
document
is
inserted,
a
key-‐value
store
requires
the
key
to
be
specified
• Unlike
a
document
store
where
the
value
can
be
indexed
and
queried,
for
a
key-‐value
store,
the
value
is
opaque
and
as
such,
the
key
must
be
known
to
retrieve
the
value
23. Advantages
of
Key-‐value
Store
• op6mized
for
querying
against
keys
• one
can
generate
the
keys
smartly—say,
bucketed
UUID—and
can
query
against
ranges
of
keys.
Hoàng
Anh
Tú
23
25. Advantages
of
Graph
Store
• special
purpose
NoSQL
databases
op6mized
for
rela6on-‐heavy
data
• easy
representa6on,
retrieval
and
manipula6on
of
rela6onships
between
the
en66es
• It
is
not
uncommon
to
store
data
in
a
document
store
and
rela6onships
in
a
graph
database.
Hoàng
Anh
Tú
25
26. References
• Gexng
started
with
NoSQL,
Gaurav
Vaish,
Packt
Publishing,
2013
Hoàng
Anh
Tú
26