No SQL
Problems With RDBMS
• Should know the entire schema upfront
Problems With RDBMS
• Should know the entire schema upfront
• Every record have same properties [rigid structure]
Problems With RDBMS
• Should know the entire schema upfront
• Every record have same properties [rigid structure]
• Scalability is costly
Problems With RDBMS
• Should know the entire schema upfront
• Every record have same properties [rigid structure]
• Scalability is costly
• Scaling relational database is hard
Problems With RDBMS
• Should know the entire schema upfront
• Every record have same properties [rigid structure]
• Scalability is costly
• Scaling relational database is hard
• Normalization
Problems With RDBMS
• Should know the entire schema upfront
• Every record have same properties [rigid structure]
• Scalability is costly
• Scaling relational database is hard
• Normalization
• Altering schema on a running database is expensive
Problems With RDBMS
• Should know the entire schema upfront
• Every record have same properties [rigid structure]
• Scalability is costly
• Scaling relational database is hard
• Normalization
• Altering schema on a running database is expensive
• Horizontal scaling is a problem
Single server Architecture
Problems with single server
architecture
• Load
Problems with single server
architecture
• Failure – Single point of failure
Problems with single server
architecture
• Maintenance – Downtime during manual maintenance
Distributed Database
Advantage of distributed database
• Speed – Files are retrieved from the nearest location
• If one site fails the system can still run.
What is NoSQL ?
Also known as
• non-relational database
• non SQL
• not only SQL
NoSQL are non-tabular databases and store data differently than relational tables.
Student ID Name Course
123 john ML
234 Doe DL
456 Eric Python
Student table
No SQL
Benefits of NoSQL
• 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.
• Schema-less
• Data are replicated to multiple nodes(so, identical & fault tolerant)
and can be partitioned:
 no single point of failure
 down nodes can easily be replaced
• Cheap, easy to implement(open source)
• Its all object oriented programming that is easy to use and flexible.
• Running well on clusters – geographically distributed scale-out structure.
Types of NoSQL Databases
• Key- value stores
• Document databases
• Graph databases
• Column databases
Key Value Databases
Key value databases, also known as key value stores, are database types where data is
stored in a “key-value” format and optimized for reading and writing that data.
The data is fetched by a unique key or a number of unique keys to retrieve the associated
value with each key. The values can be simple data types like strings and numbers or
complex objects.
eg: Riak, redis server.
Document Databases
• Documents are composed of field-and-value pairs and have the following structure:
• Documents can contain many key value pairs, key array pairs or even nested
documents
• It follow the JSON format.
• eg: MongoDB, Cosmos DB
Graph Databases
• Graph database are NoSQL database which use the graph data model comprised of
vertices and edges
• Vertices which is an entity such as person, place, object or relevant piece of data.
• Edges represent the relationship between two nodes
• eg: neo4j, infinite graph
Column Databases
• A columnar database is a database management system (DBMS) that stores data in
columns instead of rows.
• Very similar to relational databases, but still different.
• Most known because of Google Big Table representation.
• Mostly used in Data analytics.
• eg: BigTable, Cassandra, Hbase.
Row Databases
Column Databases
CAP Theorem
Suppose three properties of a distributed database system.
• Consistency:
 All the replicas have same values.
• Availability:
 Reads and writes always succeed.
• Partition- tolerance
 System will continue to work unless there is total network failure
 If few of the nodes fails then the system will work & answer the query.
CAP Theorem
• Eric Brewer’s CAP theorem says that if you want consistency, availability and partition
tolerance, you have to settle for two out of the three.
Distributed system
X=10
X=10
X=10
Then user can’t access the data until all the servers are in sync
Guaranteeing Consistency
X=10
X=10
X=10
Then user can’t access the data until all the servers are in sync
Guaranteeing Consistency
X=10
X=10
X=10
Guaranteeing Availability User will not get updated all the time.
Then user can’t access the data until all the servers are in sync
Guaranteeing Consistency
X=10
X=10
X=10
Guaranteeing Availability User will not get updated all the time.
Guaranteeing Partition Tolerance Consistency and availability both can’t be possible
Base Property of Transation
• Basically Available – failure will not halt the system
• Soft state – state of the system will change over the time
• Eventually consistency – system will become consistent over time
Real world Use case of NoSQL DB
• User profile store
 All Web applications require user profiles and the ability to log in. A global user profile store is an
example of where the key value characteristics of NoSQL come into play.
• E-Commerce
 E-commerce companies use NoSQL for store huge volume of data and large amount of request from user.
• Mobile Applications
 Since NoSQL database store the data in schema-less for the application developer can update the apps
without having to do major modification in database.
• Session storage
 NOSQL is suitable for storing such web application session information very is large in size.
NewSQL Databases
• NewSQL is a new approach to relational databases that want to combine
transactional ACID guarantees the goods RDBMS and the horizontal
scalability of NoSQL.
• They maintain ACID guarantees.
Advantages of NewSQL
• It introduces new implementation to traditional relational databases.
• It brings together the advantages of SQL and NoSQL.
• Fragmentation is supported
• Replication- copies of databases stored in remote site.
• Secondary indexes – accessing database records using a value other than a
primary key.
• Crash recovery- recovers to a consistent state.
No SQL

No SQL

  • 1.
  • 2.
    Problems With RDBMS •Should know the entire schema upfront
  • 3.
    Problems With RDBMS •Should know the entire schema upfront • Every record have same properties [rigid structure]
  • 4.
    Problems With RDBMS •Should know the entire schema upfront • Every record have same properties [rigid structure] • Scalability is costly
  • 8.
    Problems With RDBMS •Should know the entire schema upfront • Every record have same properties [rigid structure] • Scalability is costly • Scaling relational database is hard
  • 10.
    Problems With RDBMS •Should know the entire schema upfront • Every record have same properties [rigid structure] • Scalability is costly • Scaling relational database is hard • Normalization
  • 11.
    Problems With RDBMS •Should know the entire schema upfront • Every record have same properties [rigid structure] • Scalability is costly • Scaling relational database is hard • Normalization • Altering schema on a running database is expensive
  • 12.
    Problems With RDBMS •Should know the entire schema upfront • Every record have same properties [rigid structure] • Scalability is costly • Scaling relational database is hard • Normalization • Altering schema on a running database is expensive • Horizontal scaling is a problem
  • 13.
  • 14.
    Problems with singleserver architecture • Load
  • 15.
    Problems with singleserver architecture • Failure – Single point of failure
  • 16.
    Problems with singleserver architecture • Maintenance – Downtime during manual maintenance
  • 17.
  • 18.
    Advantage of distributeddatabase • Speed – Files are retrieved from the nearest location • If one site fails the system can still run.
  • 19.
    What is NoSQL? Also known as • non-relational database • non SQL • not only SQL NoSQL are non-tabular databases and store data differently than relational tables.
  • 20.
    Student ID NameCourse 123 john ML 234 Doe DL 456 Eric Python Student table
  • 21.
  • 22.
    Benefits of NoSQL •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. • Schema-less • Data are replicated to multiple nodes(so, identical & fault tolerant) and can be partitioned:  no single point of failure  down nodes can easily be replaced • Cheap, easy to implement(open source) • Its all object oriented programming that is easy to use and flexible. • Running well on clusters – geographically distributed scale-out structure.
  • 23.
    Types of NoSQLDatabases • Key- value stores • Document databases • Graph databases • Column databases
  • 24.
    Key Value Databases Keyvalue databases, also known as key value stores, are database types where data is stored in a “key-value” format and optimized for reading and writing that data. The data is fetched by a unique key or a number of unique keys to retrieve the associated value with each key. The values can be simple data types like strings and numbers or complex objects. eg: Riak, redis server.
  • 26.
    Document Databases • Documentsare composed of field-and-value pairs and have the following structure: • Documents can contain many key value pairs, key array pairs or even nested documents • It follow the JSON format. • eg: MongoDB, Cosmos DB
  • 27.
    Graph Databases • Graphdatabase are NoSQL database which use the graph data model comprised of vertices and edges • Vertices which is an entity such as person, place, object or relevant piece of data. • Edges represent the relationship between two nodes • eg: neo4j, infinite graph
  • 28.
    Column Databases • Acolumnar database is a database management system (DBMS) that stores data in columns instead of rows. • Very similar to relational databases, but still different. • Most known because of Google Big Table representation. • Mostly used in Data analytics. • eg: BigTable, Cassandra, Hbase.
  • 29.
  • 30.
  • 31.
    CAP Theorem Suppose threeproperties of a distributed database system. • Consistency:  All the replicas have same values. • Availability:  Reads and writes always succeed. • Partition- tolerance  System will continue to work unless there is total network failure  If few of the nodes fails then the system will work & answer the query.
  • 32.
    CAP Theorem • EricBrewer’s CAP theorem says that if you want consistency, availability and partition tolerance, you have to settle for two out of the three. Distributed system
  • 33.
  • 34.
    Then user can’taccess the data until all the servers are in sync Guaranteeing Consistency X=10 X=10 X=10
  • 35.
    Then user can’taccess the data until all the servers are in sync Guaranteeing Consistency X=10 X=10 X=10 Guaranteeing Availability User will not get updated all the time.
  • 36.
    Then user can’taccess the data until all the servers are in sync Guaranteeing Consistency X=10 X=10 X=10 Guaranteeing Availability User will not get updated all the time. Guaranteeing Partition Tolerance Consistency and availability both can’t be possible
  • 37.
    Base Property ofTransation • Basically Available – failure will not halt the system • Soft state – state of the system will change over the time • Eventually consistency – system will become consistent over time
  • 38.
    Real world Usecase of NoSQL DB • User profile store  All Web applications require user profiles and the ability to log in. A global user profile store is an example of where the key value characteristics of NoSQL come into play. • E-Commerce  E-commerce companies use NoSQL for store huge volume of data and large amount of request from user. • Mobile Applications  Since NoSQL database store the data in schema-less for the application developer can update the apps without having to do major modification in database. • Session storage  NOSQL is suitable for storing such web application session information very is large in size.
  • 39.
    NewSQL Databases • NewSQLis a new approach to relational databases that want to combine transactional ACID guarantees the goods RDBMS and the horizontal scalability of NoSQL. • They maintain ACID guarantees.
  • 40.
    Advantages of NewSQL •It introduces new implementation to traditional relational databases. • It brings together the advantages of SQL and NoSQL. • Fragmentation is supported • Replication- copies of databases stored in remote site. • Secondary indexes – accessing database records using a value other than a primary key. • Crash recovery- recovers to a consistent state.