2.1.2 Data Models
2.1.2 Data Models
Pravin Y Pawar
• Most important part of developing software, because they have such a profound effect
o on how the software is written
o on how we think about solving the problem
• For example, consider Books relation Title Author Format PubID Price
o Lot of duplicate data – publisher , country Book1 Pawar Paperback 1 20
Major downside : need to join data back from multiple tables – expensive for large tables!
Relational Model(3)
Querying
• Databases built around relational data model are relational databases
• Language used to specify data to be retrieved from database is query language
o Most popular is SQL
• SQL
o Declarative query language – specify the output needed rather than steps needed to get it
o Specify the pattern of data –
o Tables from which data is needed
o Conditions the results must meet
o Transformations, such as joins, sort, group, aggregate
o Database figures out how to provide those results
o How to break query in parts
o What methods to user execute each part of query
o Order in which the parts needs to be executed
NoSQL
Need and Origin
• Relational model generalizes a lot but still restrictive
• Needs a strict schema – schema management is painful!
• Per Couchbase 2014 survey, frustration with schema management is #1 reason for adoption of non
relational databases