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
5.
6.
7.
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
9.
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
18. Advantage of distributed database
• 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 Name Course
123 john ML
234 Doe DL
456 Eric Python
Student table
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 NoSQL Databases
• Key- value stores
• Document databases
• Graph databases
• Column databases
24. 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.
25.
26. 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
27. 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
28. 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.
31. 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.
32. 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
34. Then user can’t access the data until all the servers are in sync
Guaranteeing Consistency
X=10
X=10
X=10
35. 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.
36. 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
37. 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
38. 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.
39. 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.
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.