SlideShare a Scribd company logo
By Suresh Parmar
 Some history
 What is NoSQL –Why?
 CAP Theorem
 What is lost
 Types of NoSQL
 Typical NoSQL API
 Data Model
 NoSQL Database Examples-Demo
 Future trends
 Conclusion
 Question?
 Casing
 Master/slave
 Master/Master
 Cluster
 Table programming
 Sharing
 Distributed data
 WHAT?
 Stands for Not Only SQL
 Class of non-relational data storage systems
 Usually do not require a fixed table schema nor do they use the concept of joins
 All NoSQL offerings relax one or more of the ACID properties
 WHY?
 For data storage, an RDBMS cannot be the be-all/end-all
 Just as there are different programming languages, need to have other data storage tools in the toolbox
 A NoSQL solution is more acceptable to a client now than even a year ago
 Explosion of social media sites (Facebook, Twitter) with large data needs
 Rise of cloud-based solutions such as Amazon S3 (simple storage solution)
 Just as moving to dynamically-typed languages (Ruby/Groovy), a shift to dynamically-typed data with
frequent schema changes
 Open-source community
 Explosion of social media sites (Facebook, Twitter) with large
data needs
 Rise of cloud-based solutions such as Amazon S3 (simple
storage solution)
 Just as moving to dynamically-typed languages
(Ruby/Groovy), a shift to dynamically-typed data with
frequent schema changes
 Open-source community
 Three major papers were the seeds of the NoSQL movement
 Big Table (Google)
 Dynamo (Amazon)
▪ Gossip protocol (discovery and error detection)
▪ Distributed key-value data store
▪ Eventual consistency
 CAP Theorem
 Three properties of a system:
 Consistency
 Availability
 Partitions
 You can have at most two of these three properties for any
shared-data system
 To scale out, you have to partition. That leaves either
consistency or availability to choose from
 In almost all cases, you would choose availability over
consistency
 Traditionally, thought of as the server/process available five
9’s (99.999 %).
 However, for large node system, at almost any point in time
there’s a good chance that a node is either down or there is a
network disruption among the nodes.
 Want a system that is resilient in the face of network disruption
 A consistency model determines rules for visibility and
apparent order of updates.
 For example:
 Row X is replicated on nodes M and N
 Client A writes row X to node N
 Some period of time t elapses.
 Client B reads row X from node M
 Does client B see the write from client A?
 Consistency is a continuum with tradeoffs
 For NoSQL, the answer would be: maybe
 CAP Theorem states: Strict Consistency can't be achieved
at the same time as availability and partition-tolerance.
 When no updates occur for a long period of time, eventually
all updates will propagate through the system and all the
nodes will be consistent
 For a given accepted update and a given node, eventually
either the update reaches the node or the node is removed
from service
 Known as BASE (Basically Available, Soft state, Eventual
consistency), as opposed to ACID
 NoSQL solutions fall into two major areas:
 Key/Value or ‘the big hash table’.
▪ Amazon S3 (Dynamo)
▪ Voldemort
▪ Scalar
 Schema-less which comes in multiple flavors, column-
based, document-based or graph-based.
▪ Cassandra (column-based)
▪ CouchDB (document-based)
▪ Neo4J (graph-based)
▪ HBase (column-based)
Pros:
 very fast
 very scalable
 simple model
 able to distribute horizontally
Cons:
- many data structures (objects) can't be easily modeled as key
value pairs
Pros:
- Schema-less data model is richer than key/value pairs
- eventual consistency
- many are distributed
- still provide excellent performance and scalability
Cons:
- typically no ACID transactions or joins
 Cheap, easy to implement (open source)
 Data are replicated to multiple nodes (therefore identical and
fault-tolerant) and can be partitioned
 Down nodes easily replaced
 No single point of failure
 Easy to distribute
 Don't require a schema
 Can scale up and down
 Relax the data consistency requirement (CAP)
 Basic API access:
 get(key) -- Extract the value given a key
 put(key, value) -- Create or update the value given its key
 delete(key) -- Remove the key and its associated value
 execute(key, operation, parameters) -- Invoke an operation
to the value (given its key) which is a special data structure
(e.g. List, Set, Map .... etc).
 Within Cassandra, you will refer to data this way:
 Column: smallest data element, a tuple with a name and a
value
:Rockets, '1' might return:
{'name' => ‘Rocket-Powered Roller Skates',
‘toon' => ‘Ready Set Zoom',
‘inventoryQty' => ‘5‘,
‘productUrl’ => ‘rockets1.gif’}
 ColumnFamily: There’s a single structure used to group both the
Columns and SuperColumns. Called a ColumnFamily (think table), it
has two types, Standard & Super.
▪ Column families must be defined at startup
 Key: the permanent name of the record
 Keyspace: the outer-most level of organization. This is usually
the name of the application. For example, ‘Acme' (think database
name).
 Talked previous about eventual consistency
 Cassandra has programmable read/writable consistency
 One: Return from the first node that responds
 Quorom: Query from all nodes and respond with the one
that has latest timestamp once a majority of nodes
responded
 All: Query from all nodes and respond with the one that has
latest timestamp once all nodes responded. An unresponsive
node will fail the node
 Zero: Ensure nothing. Asynchronous write done in
background
 Any: Ensure that the write is written to at least 1 node
 One: Ensure that the write is written to at least 1 node’s
commit log and memory table before receipt to client
 Quorom: Ensure that the write goes to node/2 + 1
 All: Ensure that writes go to all nodes. An unresponsive node
would fail the write
 Partition using consistent hashing
 Keys hash to a point on a fixed
circular space
 Ring is partitioned into a set of
ordered slots and servers and
keys hashed over these slots
 Nodes take positions on the circle.
 A, B, and D exists.
 B responsible for AB range.
 D responsible for BD range.
 A responsible for DA range.
 C joins.
 B, D split ranges.
 C gets BC from D.
 Tomcat context.xml
<Resource name="cassandra/CassandraClientFactory"
auth="Container"
type="me.prettyprint.cassandra.service.CassandraHostConfigurator"
factory="org.apache.naming.factory.BeanFactory"
hosts="localhost:9160"
maxActive="150"
maxIdle="75" />
 J2EE web.xml
<resource-env-ref>
<description>Object factory for Cassandra clients.</description>
<resource-env-ref-name>cassandra/CassandraClientFactory</resource-env-ref- name>
<resource-env-ref-type>org.apache.naming.factory.BeanFactory</resource-env-ref-type>
</resource-env-ref>
 Spring applicationContext.xml
<bean id="cassandraHostConfigurator“
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>cassandra/CassandraClientFactory</value></property>
<property name="resourceRef"><value>true</value></property>
</bean>
<bean id="inventoryDao“
class="com.acme.erp.inventory.dao.InventoryDaoImpl">
<property name="cassandraHostConfigurator“
ref="cassandraHostConfigurator" />
<property name="keyspace" value="Acme" />
</bean>
try {
cassandraClient = cassandraClientPool.borrowClient();
// keyspace is Acme
Keyspace keyspace = cassandraClient.getKeyspace(getKeyspace());
// inventoryType is Rockets
List<Column> result = keyspace.getSlice(Long.toString(inventoryId), new
ColumnParent(inventoryType), getSlicePredicate());
inventoryItem.setInventoryItemId(inventoryId);
inventoryItem.setInventoryType(inventoryType);
loadInventory(inventoryItem, result);
} catch (Exception exception) {
logger.error("An Exception occurred retrieving an inventory item", exception);
} finally {
try {
cassandraClientPool.releaseClient(cassandraClient);
} catch (Exception exception) {
logger.warn("An Exception occurred returning a Cassandra client to the pool", exception);
}
}
try {
cassandraClient = cassandraClientPool.borrowClient();
Map<String, List<ColumnOrSuperColumn>> data = new
HashMap<String, List<ColumnOrSuperColumn>>();
List<ColumnOrSuperColumn> columns = new ArrayList<ColumnOrSuperColumn>();
// Create the inventoryId column.
ColumnOrSuperColumn column = new ColumnOrSuperColumn();
columns.add(column.setColumn(newColumn("inventoryItemId".getBytes("utf-
8"), Long.toString(inventoryItem.getInventoryItemId()).getBytes("utf-8"), timestamp)));
column = new ColumnOrSuperColumn();
columns.add(column.setColumn(newColumn("inventoryType".getBytes("utf-
8"), inventoryItem.getInventoryType().getBytes("utf-8"), timestamp)));
….
data.put(inventoryItem.getInventoryType(), columns);
cassandraClient.getCassandra().batch_insert(getKeyspace(), Long.toString(inventoryItem.getInvent
oryItemId()), data, ConsistencyLevel.ANY);
} catch (Exception exception) {
…
}
 www.google.com
 Cassandra
 http://cassandra.apache.org
 Hector
 http://wiki.github.com/rantav/hector
 http://prettyprint.me
 NoSQL News websites
 http://nosql.mypopescu.com
 http://www.nosqldatabases.com
 High Scalability
 http://highscalability.com
 Video
 http://www.infoq.com/presentations/Project-Voldemort-at-Gilt-
Groupe
 www.youtube.com
NoSql Database

More Related Content

What's hot

Introduction to Cassandra: Replication and Consistency
Introduction to Cassandra: Replication and ConsistencyIntroduction to Cassandra: Replication and Consistency
Introduction to Cassandra: Replication and Consistency
Benjamin Black
 
Apache Cassandra @Geneva JUG 2013.02.26
Apache Cassandra @Geneva JUG 2013.02.26Apache Cassandra @Geneva JUG 2013.02.26
Apache Cassandra @Geneva JUG 2013.02.26
Benoit Perroud
 
Cassandra concepts, patterns and anti-patterns
Cassandra concepts, patterns and anti-patternsCassandra concepts, patterns and anti-patterns
Cassandra concepts, patterns and anti-patterns
Dave Gardner
 
Distribute Key Value Store
Distribute Key Value StoreDistribute Key Value Store
Distribute Key Value Store
Santal Li
 
NOSQL Database: Apache Cassandra
NOSQL Database: Apache CassandraNOSQL Database: Apache Cassandra
NOSQL Database: Apache Cassandra
Folio3 Software
 
Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...
Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...
Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...
DataStax Academy
 
Introduction to Cassandra
Introduction to CassandraIntroduction to Cassandra
Introduction to Cassandra
SoftwareMill
 
Introduction to Cassandra
Introduction to CassandraIntroduction to Cassandra
Introduction to Cassandra
Gokhan Atil
 
Data SLA in the public cloud
Data SLA in the public cloudData SLA in the public cloud
Data SLA in the public cloud
Liran Zelkha
 
Cassandra
CassandraCassandra
Cassandra
Edureka!
 
Cassandra
CassandraCassandra
Cassandra
Upaang Saxena
 
Cassandra: Open Source Bigtable + Dynamo
Cassandra: Open Source Bigtable + DynamoCassandra: Open Source Bigtable + Dynamo
Cassandra: Open Source Bigtable + Dynamo
jbellis
 
Cassandra background-and-architecture
Cassandra background-and-architectureCassandra background-and-architecture
Cassandra background-and-architecture
Markus Klems
 
Cassandra basics 2.0
Cassandra basics 2.0Cassandra basics 2.0
Cassandra basics 2.0
Asis Mohanty
 
Apache Cassandra at the Geek2Geek Berlin
Apache Cassandra at the Geek2Geek BerlinApache Cassandra at the Geek2Geek Berlin
Apache Cassandra at the Geek2Geek Berlin
Christian Johannsen
 
Cassandra architecture
Cassandra architectureCassandra architecture
Cassandra architecture
T Jake Luciani
 
Apache Cassandra Multi-Datacenter Essentials (Julien Anguenot, iLand Internet...
Apache Cassandra Multi-Datacenter Essentials (Julien Anguenot, iLand Internet...Apache Cassandra Multi-Datacenter Essentials (Julien Anguenot, iLand Internet...
Apache Cassandra Multi-Datacenter Essentials (Julien Anguenot, iLand Internet...
DataStax
 
Introduction to cassandra
Introduction to cassandraIntroduction to cassandra
Introduction to cassandra
Nguyen Quang
 
Cassandra overview
Cassandra overviewCassandra overview
Cassandra overview
Sean Murphy
 
Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...
Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...
Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...
DataStax Academy
 

What's hot (20)

Introduction to Cassandra: Replication and Consistency
Introduction to Cassandra: Replication and ConsistencyIntroduction to Cassandra: Replication and Consistency
Introduction to Cassandra: Replication and Consistency
 
Apache Cassandra @Geneva JUG 2013.02.26
Apache Cassandra @Geneva JUG 2013.02.26Apache Cassandra @Geneva JUG 2013.02.26
Apache Cassandra @Geneva JUG 2013.02.26
 
Cassandra concepts, patterns and anti-patterns
Cassandra concepts, patterns and anti-patternsCassandra concepts, patterns and anti-patterns
Cassandra concepts, patterns and anti-patterns
 
Distribute Key Value Store
Distribute Key Value StoreDistribute Key Value Store
Distribute Key Value Store
 
NOSQL Database: Apache Cassandra
NOSQL Database: Apache CassandraNOSQL Database: Apache Cassandra
NOSQL Database: Apache Cassandra
 
Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...
Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...
Tales From The Front: An Architecture For Multi-Data Center Scalable Applicat...
 
Introduction to Cassandra
Introduction to CassandraIntroduction to Cassandra
Introduction to Cassandra
 
Introduction to Cassandra
Introduction to CassandraIntroduction to Cassandra
Introduction to Cassandra
 
Data SLA in the public cloud
Data SLA in the public cloudData SLA in the public cloud
Data SLA in the public cloud
 
Cassandra
CassandraCassandra
Cassandra
 
Cassandra
CassandraCassandra
Cassandra
 
Cassandra: Open Source Bigtable + Dynamo
Cassandra: Open Source Bigtable + DynamoCassandra: Open Source Bigtable + Dynamo
Cassandra: Open Source Bigtable + Dynamo
 
Cassandra background-and-architecture
Cassandra background-and-architectureCassandra background-and-architecture
Cassandra background-and-architecture
 
Cassandra basics 2.0
Cassandra basics 2.0Cassandra basics 2.0
Cassandra basics 2.0
 
Apache Cassandra at the Geek2Geek Berlin
Apache Cassandra at the Geek2Geek BerlinApache Cassandra at the Geek2Geek Berlin
Apache Cassandra at the Geek2Geek Berlin
 
Cassandra architecture
Cassandra architectureCassandra architecture
Cassandra architecture
 
Apache Cassandra Multi-Datacenter Essentials (Julien Anguenot, iLand Internet...
Apache Cassandra Multi-Datacenter Essentials (Julien Anguenot, iLand Internet...Apache Cassandra Multi-Datacenter Essentials (Julien Anguenot, iLand Internet...
Apache Cassandra Multi-Datacenter Essentials (Julien Anguenot, iLand Internet...
 
Introduction to cassandra
Introduction to cassandraIntroduction to cassandra
Introduction to cassandra
 
Cassandra overview
Cassandra overviewCassandra overview
Cassandra overview
 
Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...
Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...
Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...
 

Similar to NoSql Database

No sql
No sqlNo sql
No sql
Shruti_gtbit
 
Schemaless Databases
Schemaless DatabasesSchemaless Databases
Schemaless Databases
Dan Gunter
 
Storage cassandra
Storage   cassandraStorage   cassandra
Storage cassandra
PL dream
 
Using Cassandra with your Web Application
Using Cassandra with your Web ApplicationUsing Cassandra with your Web Application
Using Cassandra with your Web Application
supertom
 
No sql (1)
No sql (1)No sql (1)
No sql (1)
sanskar2674
 
Spinnaker VLDB 2011
Spinnaker VLDB 2011Spinnaker VLDB 2011
Spinnaker VLDB 2011
sandeep_tata
 
Cassndra (4).pptx
Cassndra (4).pptxCassndra (4).pptx
Cassndra (4).pptx
NikhilAmauriya
 
Cassandra & Python - Springfield MO User Group
Cassandra & Python - Springfield MO User GroupCassandra & Python - Springfield MO User Group
Cassandra & Python - Springfield MO User Group
Adam Hutson
 
Bhupeshbansal bigdata
Bhupeshbansal bigdata Bhupeshbansal bigdata
Bhupeshbansal bigdata
Bhupesh Bansal
 
Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)
zznate
 
Learning Cassandra NoSQL
Learning Cassandra NoSQLLearning Cassandra NoSQL
Learning Cassandra NoSQL
Pankaj Khattar
 
Appache Cassandra
Appache Cassandra  Appache Cassandra
Appache Cassandra
nehabsairam
 
cassandra
cassandracassandra
cassandra
Akash R
 
Cassandra implementation for collecting data and presenting data
Cassandra implementation for collecting data and presenting dataCassandra implementation for collecting data and presenting data
Cassandra implementation for collecting data and presenting data
Chen Robert
 
Cassandra - A decentralized storage system
Cassandra - A decentralized storage systemCassandra - A decentralized storage system
Cassandra - A decentralized storage system
Arunit Gupta
 
No sql databases
No sql databasesNo sql databases
No sql databases
Ashish Kumar Thakur
 
No sql (not only sql)
No sql                 (not only sql)No sql                 (not only sql)
No sql (not only sql)
Priyodarshini Dhar
 
No sq lv2
No sq lv2No sq lv2
No sq lv2
Nusrat Sharmin
 
Nyc summit intro_to_cassandra
Nyc summit intro_to_cassandraNyc summit intro_to_cassandra
Nyc summit intro_to_cassandra
zznate
 
Introduction to NoSQL CassandraDB
Introduction to NoSQL CassandraDBIntroduction to NoSQL CassandraDB
Introduction to NoSQL CassandraDB
Janos Geronimo
 

Similar to NoSql Database (20)

No sql
No sqlNo sql
No sql
 
Schemaless Databases
Schemaless DatabasesSchemaless Databases
Schemaless Databases
 
Storage cassandra
Storage   cassandraStorage   cassandra
Storage cassandra
 
Using Cassandra with your Web Application
Using Cassandra with your Web ApplicationUsing Cassandra with your Web Application
Using Cassandra with your Web Application
 
No sql (1)
No sql (1)No sql (1)
No sql (1)
 
Spinnaker VLDB 2011
Spinnaker VLDB 2011Spinnaker VLDB 2011
Spinnaker VLDB 2011
 
Cassndra (4).pptx
Cassndra (4).pptxCassndra (4).pptx
Cassndra (4).pptx
 
Cassandra & Python - Springfield MO User Group
Cassandra & Python - Springfield MO User GroupCassandra & Python - Springfield MO User Group
Cassandra & Python - Springfield MO User Group
 
Bhupeshbansal bigdata
Bhupeshbansal bigdata Bhupeshbansal bigdata
Bhupeshbansal bigdata
 
Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)Introduciton to Apache Cassandra for Java Developers (JavaOne)
Introduciton to Apache Cassandra for Java Developers (JavaOne)
 
Learning Cassandra NoSQL
Learning Cassandra NoSQLLearning Cassandra NoSQL
Learning Cassandra NoSQL
 
Appache Cassandra
Appache Cassandra  Appache Cassandra
Appache Cassandra
 
cassandra
cassandracassandra
cassandra
 
Cassandra implementation for collecting data and presenting data
Cassandra implementation for collecting data and presenting dataCassandra implementation for collecting data and presenting data
Cassandra implementation for collecting data and presenting data
 
Cassandra - A decentralized storage system
Cassandra - A decentralized storage systemCassandra - A decentralized storage system
Cassandra - A decentralized storage system
 
No sql databases
No sql databasesNo sql databases
No sql databases
 
No sql (not only sql)
No sql                 (not only sql)No sql                 (not only sql)
No sql (not only sql)
 
No sq lv2
No sq lv2No sq lv2
No sq lv2
 
Nyc summit intro_to_cassandra
Nyc summit intro_to_cassandraNyc summit intro_to_cassandra
Nyc summit intro_to_cassandra
 
Introduction to NoSQL CassandraDB
Introduction to NoSQL CassandraDBIntroduction to NoSQL CassandraDB
Introduction to NoSQL CassandraDB
 

Recently uploaded

Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
saastr
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
c5vrf27qcz
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
Fwdays
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
Fwdays
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Pitangent Analytics & Technology Solutions Pvt. Ltd
 

Recently uploaded (20)

Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Y-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PPY-Combinator seed pitch deck template PP
Y-Combinator seed pitch deck template PP
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
 

NoSql Database

  • 2.  Some history  What is NoSQL –Why?  CAP Theorem  What is lost  Types of NoSQL  Typical NoSQL API  Data Model  NoSQL Database Examples-Demo  Future trends  Conclusion  Question?
  • 3.
  • 4.  Casing  Master/slave  Master/Master  Cluster  Table programming  Sharing  Distributed data
  • 5.
  • 6.  WHAT?  Stands for Not Only SQL  Class of non-relational data storage systems  Usually do not require a fixed table schema nor do they use the concept of joins  All NoSQL offerings relax one or more of the ACID properties  WHY?  For data storage, an RDBMS cannot be the be-all/end-all  Just as there are different programming languages, need to have other data storage tools in the toolbox  A NoSQL solution is more acceptable to a client now than even a year ago  Explosion of social media sites (Facebook, Twitter) with large data needs  Rise of cloud-based solutions such as Amazon S3 (simple storage solution)  Just as moving to dynamically-typed languages (Ruby/Groovy), a shift to dynamically-typed data with frequent schema changes  Open-source community
  • 7.  Explosion of social media sites (Facebook, Twitter) with large data needs  Rise of cloud-based solutions such as Amazon S3 (simple storage solution)  Just as moving to dynamically-typed languages (Ruby/Groovy), a shift to dynamically-typed data with frequent schema changes  Open-source community
  • 8.  Three major papers were the seeds of the NoSQL movement  Big Table (Google)  Dynamo (Amazon) ▪ Gossip protocol (discovery and error detection) ▪ Distributed key-value data store ▪ Eventual consistency  CAP Theorem
  • 9.  Three properties of a system:  Consistency  Availability  Partitions  You can have at most two of these three properties for any shared-data system  To scale out, you have to partition. That leaves either consistency or availability to choose from  In almost all cases, you would choose availability over consistency
  • 10.  Traditionally, thought of as the server/process available five 9’s (99.999 %).  However, for large node system, at almost any point in time there’s a good chance that a node is either down or there is a network disruption among the nodes.  Want a system that is resilient in the face of network disruption
  • 11.  A consistency model determines rules for visibility and apparent order of updates.  For example:  Row X is replicated on nodes M and N  Client A writes row X to node N  Some period of time t elapses.  Client B reads row X from node M  Does client B see the write from client A?  Consistency is a continuum with tradeoffs  For NoSQL, the answer would be: maybe  CAP Theorem states: Strict Consistency can't be achieved at the same time as availability and partition-tolerance.
  • 12.  When no updates occur for a long period of time, eventually all updates will propagate through the system and all the nodes will be consistent  For a given accepted update and a given node, eventually either the update reaches the node or the node is removed from service  Known as BASE (Basically Available, Soft state, Eventual consistency), as opposed to ACID
  • 13.  NoSQL solutions fall into two major areas:  Key/Value or ‘the big hash table’. ▪ Amazon S3 (Dynamo) ▪ Voldemort ▪ Scalar  Schema-less which comes in multiple flavors, column- based, document-based or graph-based. ▪ Cassandra (column-based) ▪ CouchDB (document-based) ▪ Neo4J (graph-based) ▪ HBase (column-based)
  • 14. Pros:  very fast  very scalable  simple model  able to distribute horizontally Cons: - many data structures (objects) can't be easily modeled as key value pairs
  • 15. Pros: - Schema-less data model is richer than key/value pairs - eventual consistency - many are distributed - still provide excellent performance and scalability Cons: - typically no ACID transactions or joins
  • 16.  Cheap, easy to implement (open source)  Data are replicated to multiple nodes (therefore identical and fault-tolerant) and can be partitioned  Down nodes easily replaced  No single point of failure  Easy to distribute  Don't require a schema  Can scale up and down  Relax the data consistency requirement (CAP)
  • 17.  Basic API access:  get(key) -- Extract the value given a key  put(key, value) -- Create or update the value given its key  delete(key) -- Remove the key and its associated value  execute(key, operation, parameters) -- Invoke an operation to the value (given its key) which is a special data structure (e.g. List, Set, Map .... etc).
  • 18.  Within Cassandra, you will refer to data this way:  Column: smallest data element, a tuple with a name and a value :Rockets, '1' might return: {'name' => ‘Rocket-Powered Roller Skates', ‘toon' => ‘Ready Set Zoom', ‘inventoryQty' => ‘5‘, ‘productUrl’ => ‘rockets1.gif’}
  • 19.  ColumnFamily: There’s a single structure used to group both the Columns and SuperColumns. Called a ColumnFamily (think table), it has two types, Standard & Super. ▪ Column families must be defined at startup  Key: the permanent name of the record  Keyspace: the outer-most level of organization. This is usually the name of the application. For example, ‘Acme' (think database name).
  • 20.  Talked previous about eventual consistency  Cassandra has programmable read/writable consistency  One: Return from the first node that responds  Quorom: Query from all nodes and respond with the one that has latest timestamp once a majority of nodes responded  All: Query from all nodes and respond with the one that has latest timestamp once all nodes responded. An unresponsive node will fail the node
  • 21.  Zero: Ensure nothing. Asynchronous write done in background  Any: Ensure that the write is written to at least 1 node  One: Ensure that the write is written to at least 1 node’s commit log and memory table before receipt to client  Quorom: Ensure that the write goes to node/2 + 1  All: Ensure that writes go to all nodes. An unresponsive node would fail the write
  • 22.  Partition using consistent hashing  Keys hash to a point on a fixed circular space  Ring is partitioned into a set of ordered slots and servers and keys hashed over these slots  Nodes take positions on the circle.  A, B, and D exists.  B responsible for AB range.  D responsible for BD range.  A responsible for DA range.  C joins.  B, D split ranges.  C gets BC from D.
  • 23.  Tomcat context.xml <Resource name="cassandra/CassandraClientFactory" auth="Container" type="me.prettyprint.cassandra.service.CassandraHostConfigurator" factory="org.apache.naming.factory.BeanFactory" hosts="localhost:9160" maxActive="150" maxIdle="75" />  J2EE web.xml <resource-env-ref> <description>Object factory for Cassandra clients.</description> <resource-env-ref-name>cassandra/CassandraClientFactory</resource-env-ref- name> <resource-env-ref-type>org.apache.naming.factory.BeanFactory</resource-env-ref-type> </resource-env-ref>
  • 24.  Spring applicationContext.xml <bean id="cassandraHostConfigurator“ class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName"> <value>cassandra/CassandraClientFactory</value></property> <property name="resourceRef"><value>true</value></property> </bean> <bean id="inventoryDao“ class="com.acme.erp.inventory.dao.InventoryDaoImpl"> <property name="cassandraHostConfigurator“ ref="cassandraHostConfigurator" /> <property name="keyspace" value="Acme" /> </bean>
  • 25. try { cassandraClient = cassandraClientPool.borrowClient(); // keyspace is Acme Keyspace keyspace = cassandraClient.getKeyspace(getKeyspace()); // inventoryType is Rockets List<Column> result = keyspace.getSlice(Long.toString(inventoryId), new ColumnParent(inventoryType), getSlicePredicate()); inventoryItem.setInventoryItemId(inventoryId); inventoryItem.setInventoryType(inventoryType); loadInventory(inventoryItem, result); } catch (Exception exception) { logger.error("An Exception occurred retrieving an inventory item", exception); } finally { try { cassandraClientPool.releaseClient(cassandraClient); } catch (Exception exception) { logger.warn("An Exception occurred returning a Cassandra client to the pool", exception); } }
  • 26. try { cassandraClient = cassandraClientPool.borrowClient(); Map<String, List<ColumnOrSuperColumn>> data = new HashMap<String, List<ColumnOrSuperColumn>>(); List<ColumnOrSuperColumn> columns = new ArrayList<ColumnOrSuperColumn>(); // Create the inventoryId column. ColumnOrSuperColumn column = new ColumnOrSuperColumn(); columns.add(column.setColumn(newColumn("inventoryItemId".getBytes("utf- 8"), Long.toString(inventoryItem.getInventoryItemId()).getBytes("utf-8"), timestamp))); column = new ColumnOrSuperColumn(); columns.add(column.setColumn(newColumn("inventoryType".getBytes("utf- 8"), inventoryItem.getInventoryType().getBytes("utf-8"), timestamp))); …. data.put(inventoryItem.getInventoryType(), columns); cassandraClient.getCassandra().batch_insert(getKeyspace(), Long.toString(inventoryItem.getInvent oryItemId()), data, ConsistencyLevel.ANY); } catch (Exception exception) { … }
  • 27.
  • 28.  www.google.com  Cassandra  http://cassandra.apache.org  Hector  http://wiki.github.com/rantav/hector  http://prettyprint.me  NoSQL News websites  http://nosql.mypopescu.com  http://www.nosqldatabases.com  High Scalability  http://highscalability.com  Video  http://www.infoq.com/presentations/Project-Voldemort-at-Gilt- Groupe  www.youtube.com