SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Downloaden Sie, um offline zu lesen
Hackolade Tutorial
Part 3- Query driven data modeling based on access patterns
Copyright Š 2016-2023 Hackolade 1
The rules of data modeling
• Data modeling for RDBMSs uses the rules of normalization
Copyright Š 2016-2023 Hackolade 2
The rules of data modeling
• NoSQL databases are completely different
• Different data models
• Different sizing parameters and capabilities
• True “horizontal” scalability in infinitely distributed systems
• Different transactional capabilities
• immediate vs. eventual consistency
• ACID vs BASE
• Different use cases
• NoSQL requires a mindshift in schema design, adhering to different
rules and parameters
Copyright Š 2016-2023 Hackolade 3
The rules of data modeling
• NoSQL advocates UNLEARNING the rules of normalisation
• NoSQL allows to aggregate information that belongs together
• join the data “on write”, instead of (time and time again) “on read”
Copyright Š 2016-2023 Hackolade 4
The NoSQL mindshift
• From APPLICATION-AGNOSTIC to APPLICATION-SPECIFIC data
modeling
Copyright Š 2016-2023 Hackolade 5
The ”Embedding” approach
Query driven data modeling
• first define the queries (aka “access patterns”) for the
application,
• then store the data according to the query needs
• Ideally, single db access should provide access to all related,
joined-up information: EMBEDDING the data into single
atomic document
<> “referencing” – leveraging data stored elsewhere using foreign keys, pulled
in with joins
Copyright Š 2016-2023 Hackolade 6
Important factors for Query-driven Data Modeling
• Aggregate / Document size and transaction volume
• Cardinality of relationships
• Beware of unbounded arrays: consequences of unlimited growth!
• When embedding one-to-many relationships, one should estimate
the cardinality
Copyright Š 2016-2023 Hackolade 7
Important factors for Query-driven Data Modeling
Referential integrity
• To ACID or not to ACID
• Embedding vs. ACID: documents are atomic units!
• Role of the application!
Indexing impacts
Polymorphic document designs can lead to proliferation of
indexes
Data duplication can be a good idea!
Copyright Š 2016-2023 Hackolade 8
Schema versioning and migration
• Schemas can often be evolved without interruption of
database operations.
• Handle with care!
• Especially when multiple applications / reporting & analytical tools access
the same DB!
• Transition periods & strategies matter!
Copyright Š 2016-2023 Hackolade 9
Schema versioning and migration
Different strategies are used:
• Eager: first migrate data, then application
• Does not leverage the benefits of JSON
• Lazy: only update the document when used
• Some documents will never be migrated!
• Incremental: migrate when lower load!
• Predictive migration: based on heuristics/estimates
• Also combinations of strategies: predictive migration
first, followed by incremental
• Endless versioning: not desirable!
• See entire chapter in MongoDB Data Modeling & Schema Design
book
Copyright Š 2016-2023 Hackolade 10
Backward- and forward-compatibility
• No database is an island: many systems interacting with it
• Avoid the introduction of breaking changes: huge impacts on
agility and costs.
• Think through each evolution: features in schema standards
(JSON Schema, Avro, etc.) for full compatibility of schemas.
• consumers and producers can upgrade at their own pace!
Copyright Š 2016-2023 Hackolade 11
Choice of partition / sharding keys
• NoSQL databases offer horizontal scaling
• through distribution of data across servers, data centers and
geographies
• Requires careful design
• find a scalable way to facilitate efficient retrieval of information
when serving queries, from a minimal number of shards
• a query should hit 1 shard!
Copyright Š 2016-2023 Hackolade 12
Facilitating communication and collaboration
• The purpose of all Data Modeling!!!
• “Looking at the code” vs. sharing an ERD picture
• Data modeling and schema design for NOSQL databases and data
formats provides some guardrails in the face of unlimited flexibility
and power of NoSQL.
Copyright Š 2016-2023 Hackolade 13
Reading material
• See Hackolade online documentation
• The Hackolade Blog
• This excellent new book:
MongoDB Data Modeling & Schema Design
• Many of the principles in the book are related to query
driven modeling based on access patterns!
• Hackolade’s on social media: LinkedIn page, Twitter page
• Download Hackolade studio for free
Copyright Š 2016-2023 Hackolade 14
Questions?
Answers!
Copyright Š 2016-2023 Hackolade 15

Weitere ähnliche Inhalte

Ähnlich wie Hackolade Tutorial - part 3 - Query-driven data modeling based on access patterns

NoSql Brownbag
NoSql BrownbagNoSql Brownbag
NoSql Brownbag
Sandeep Kumar
 
Nosql-Module 1 PPT.pptx
Nosql-Module 1 PPT.pptxNosql-Module 1 PPT.pptx
Nosql-Module 1 PPT.pptx
Radhika R
 
NoSQLDatabases
NoSQLDatabasesNoSQLDatabases
NoSQLDatabases
Adi Challa
 
CS828 P5 Individual Project v101
CS828 P5 Individual Project v101CS828 P5 Individual Project v101
CS828 P5 Individual Project v101
ThienSi Le
 

Ähnlich wie Hackolade Tutorial - part 3 - Query-driven data modeling based on access patterns (20)

NoSql Brownbag
NoSql BrownbagNoSql Brownbag
NoSql Brownbag
 
Couchbase 3.0.2 d1
Couchbase 3.0.2  d1Couchbase 3.0.2  d1
Couchbase 3.0.2 d1
 
Introduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDBIntroduction to NoSQL and MongoDB
Introduction to NoSQL and MongoDB
 
DBMS - Introduction.ppt
DBMS - Introduction.pptDBMS - Introduction.ppt
DBMS - Introduction.ppt
 
NoSQL
NoSQLNoSQL
NoSQL
 
SQL vs NoSQL Data Modeling.pptx
SQL vs NoSQL Data Modeling.pptxSQL vs NoSQL Data Modeling.pptx
SQL vs NoSQL Data Modeling.pptx
 
NoSQL and MongoDB
NoSQL and MongoDBNoSQL and MongoDB
NoSQL and MongoDB
 
Presentation On NoSQL Databases
Presentation On NoSQL DatabasesPresentation On NoSQL Databases
Presentation On NoSQL Databases
 
Nosql-Module 1 PPT.pptx
Nosql-Module 1 PPT.pptxNosql-Module 1 PPT.pptx
Nosql-Module 1 PPT.pptx
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
 
NoSql
NoSqlNoSql
NoSql
 
Hackolade Tutorial - part 9 - Export or forward-engineer.pdf
Hackolade Tutorial - part 9 - Export or forward-engineer.pdfHackolade Tutorial - part 9 - Export or forward-engineer.pdf
Hackolade Tutorial - part 9 - Export or forward-engineer.pdf
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
 
NoSQL.pptx
NoSQL.pptxNoSQL.pptx
NoSQL.pptx
 
Report 2.0.docx
Report 2.0.docxReport 2.0.docx
Report 2.0.docx
 
NoSQLDatabases
NoSQLDatabasesNoSQLDatabases
NoSQLDatabases
 
CS828 P5 Individual Project v101
CS828 P5 Individual Project v101CS828 P5 Individual Project v101
CS828 P5 Individual Project v101
 
Distributed RDBMS: Data Distribution Policy: Part 2 - Creating a Data Distrib...
Distributed RDBMS: Data Distribution Policy: Part 2 - Creating a Data Distrib...Distributed RDBMS: Data Distribution Policy: Part 2 - Creating a Data Distrib...
Distributed RDBMS: Data Distribution Policy: Part 2 - Creating a Data Distrib...
 
NoSQL Basics and MongDB
NoSQL Basics and  MongDBNoSQL Basics and  MongDB
NoSQL Basics and MongDB
 
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
 

Mehr von PascalDesmarets1

Mehr von PascalDesmarets1 (20)

Tutorial Workgroup - Working with Forks
Tutorial Workgroup - Working with ForksTutorial Workgroup - Working with Forks
Tutorial Workgroup - Working with Forks
 
Tutorial Advanced How-To - Oracle 23c Duality views
Tutorial Advanced How-To - Oracle 23c Duality viewsTutorial Advanced How-To - Oracle 23c Duality views
Tutorial Advanced How-To - Oracle 23c Duality views
 
Tutorial Expert How-To - Docker-based automation
Tutorial Expert How-To - Docker-based automationTutorial Expert How-To - Docker-based automation
Tutorial Expert How-To - Docker-based automation
 
Tutorial Getting Started part 4 - Domain-Driven Data Modeling
Tutorial Getting Started part 4 - Domain-Driven Data ModelingTutorial Getting Started part 4 - Domain-Driven Data Modeling
Tutorial Getting Started part 4 - Domain-Driven Data Modeling
 
Tutorial Getting Started part 3 - Metadata-as-Code
Tutorial Getting Started part 3 - Metadata-as-CodeTutorial Getting Started part 3 - Metadata-as-Code
Tutorial Getting Started part 3 - Metadata-as-Code
 
Tutorial Getting Started part 2 - Polyglot Data Modeling
Tutorial Getting Started part 2 - Polyglot Data ModelingTutorial Getting Started part 2 - Polyglot Data Modeling
Tutorial Getting Started part 2 - Polyglot Data Modeling
 
Tutorial Expert How-To - Create a model for Avro schemas
Tutorial Expert How-To - Create a model for Avro schemasTutorial Expert How-To - Create a model for Avro schemas
Tutorial Expert How-To - Create a model for Avro schemas
 
Tutorial Getting Started part 1 - Overview
Tutorial Getting Started part 1 - OverviewTutorial Getting Started part 1 - Overview
Tutorial Getting Started part 1 - Overview
 
Tutorial Expert How-To - Verify Data Model
Tutorial Expert How-To - Verify Data ModelTutorial Expert How-To - Verify Data Model
Tutorial Expert How-To - Verify Data Model
 
Tutorial Workgroup - Model versioning and collaboration
Tutorial Workgroup - Model versioning and collaborationTutorial Workgroup - Model versioning and collaboration
Tutorial Workgroup - Model versioning and collaboration
 
Tutorial Expert How-To - Naming Conventions
Tutorial Expert How-To - Naming ConventionsTutorial Expert How-To - Naming Conventions
Tutorial Expert How-To - Naming Conventions
 
Tutorial Expert How-To - Export-Import with Excel template
Tutorial Expert How-To - Export-Import with Excel templateTutorial Expert How-To - Export-Import with Excel template
Tutorial Expert How-To - Export-Import with Excel template
 
Tutorial Expert How-To - Compare and Merge
Tutorial Expert How-To - Compare and MergeTutorial Expert How-To - Compare and Merge
Tutorial Expert How-To - Compare and Merge
 
Tutorial Expert How-To - Custom properties
Tutorial Expert How-To - Custom propertiesTutorial Expert How-To - Custom properties
Tutorial Expert How-To - Custom properties
 
Tutorial Expert How-To - Command Line Interface (CLI)
Tutorial Expert How-To - Command Line Interface (CLI)Tutorial Expert How-To - Command Line Interface (CLI)
Tutorial Expert How-To - Command Line Interface (CLI)
 
Tutorial Expert How-To - Add reusable Definitions
Tutorial Expert How-To - Add reusable DefinitionsTutorial Expert How-To - Add reusable Definitions
Tutorial Expert How-To - Add reusable Definitions
 
Hackolade Tutorial - part 13 - Leverage a Polyglot data model
Hackolade Tutorial - part 13 - Leverage a Polyglot data modelHackolade Tutorial - part 13 - Leverage a Polyglot data model
Hackolade Tutorial - part 13 - Leverage a Polyglot data model
 
Hackolade Tutorial - part 12 - Create a REST API model
Hackolade Tutorial - part  12 - Create a REST API modelHackolade Tutorial - part  12 - Create a REST API model
Hackolade Tutorial - part 12 - Create a REST API model
 
Hackolade Tutorial - part 8 - Import or reverse-engineer.pdf
Hackolade Tutorial - part 8 - Import or reverse-engineer.pdfHackolade Tutorial - part 8 - Import or reverse-engineer.pdf
Hackolade Tutorial - part 8 - Import or reverse-engineer.pdf
 
Hackolade Tutorial - part 6 - Add choice, conditional, pattern fields.pdf
Hackolade Tutorial - part 6 - Add choice, conditional, pattern fields.pdfHackolade Tutorial - part 6 - Add choice, conditional, pattern fields.pdf
Hackolade Tutorial - part 6 - Add choice, conditional, pattern fields.pdf
 

KĂźrzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

KĂźrzlich hochgeladen (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

Hackolade Tutorial - part 3 - Query-driven data modeling based on access patterns

  • 1. Hackolade Tutorial Part 3- Query driven data modeling based on access patterns Copyright Š 2016-2023 Hackolade 1
  • 2. The rules of data modeling • Data modeling for RDBMSs uses the rules of normalization Copyright Š 2016-2023 Hackolade 2
  • 3. The rules of data modeling • NoSQL databases are completely different • Different data models • Different sizing parameters and capabilities • True “horizontal” scalability in infinitely distributed systems • Different transactional capabilities • immediate vs. eventual consistency • ACID vs BASE • Different use cases • NoSQL requires a mindshift in schema design, adhering to different rules and parameters Copyright Š 2016-2023 Hackolade 3
  • 4. The rules of data modeling • NoSQL advocates UNLEARNING the rules of normalisation • NoSQL allows to aggregate information that belongs together • join the data “on write”, instead of (time and time again) “on read” Copyright Š 2016-2023 Hackolade 4
  • 5. The NoSQL mindshift • From APPLICATION-AGNOSTIC to APPLICATION-SPECIFIC data modeling Copyright Š 2016-2023 Hackolade 5
  • 6. The ”Embedding” approach Query driven data modeling • first define the queries (aka “access patterns”) for the application, • then store the data according to the query needs • Ideally, single db access should provide access to all related, joined-up information: EMBEDDING the data into single atomic document <> “referencing” – leveraging data stored elsewhere using foreign keys, pulled in with joins Copyright Š 2016-2023 Hackolade 6
  • 7. Important factors for Query-driven Data Modeling • Aggregate / Document size and transaction volume • Cardinality of relationships • Beware of unbounded arrays: consequences of unlimited growth! • When embedding one-to-many relationships, one should estimate the cardinality Copyright Š 2016-2023 Hackolade 7
  • 8. Important factors for Query-driven Data Modeling Referential integrity • To ACID or not to ACID • Embedding vs. ACID: documents are atomic units! • Role of the application! Indexing impacts Polymorphic document designs can lead to proliferation of indexes Data duplication can be a good idea! Copyright Š 2016-2023 Hackolade 8
  • 9. Schema versioning and migration • Schemas can often be evolved without interruption of database operations. • Handle with care! • Especially when multiple applications / reporting & analytical tools access the same DB! • Transition periods & strategies matter! Copyright Š 2016-2023 Hackolade 9
  • 10. Schema versioning and migration Different strategies are used: • Eager: first migrate data, then application • Does not leverage the benefits of JSON • Lazy: only update the document when used • Some documents will never be migrated! • Incremental: migrate when lower load! • Predictive migration: based on heuristics/estimates • Also combinations of strategies: predictive migration first, followed by incremental • Endless versioning: not desirable! • See entire chapter in MongoDB Data Modeling & Schema Design book Copyright Š 2016-2023 Hackolade 10
  • 11. Backward- and forward-compatibility • No database is an island: many systems interacting with it • Avoid the introduction of breaking changes: huge impacts on agility and costs. • Think through each evolution: features in schema standards (JSON Schema, Avro, etc.) for full compatibility of schemas. • consumers and producers can upgrade at their own pace! Copyright Š 2016-2023 Hackolade 11
  • 12. Choice of partition / sharding keys • NoSQL databases offer horizontal scaling • through distribution of data across servers, data centers and geographies • Requires careful design • find a scalable way to facilitate efficient retrieval of information when serving queries, from a minimal number of shards • a query should hit 1 shard! Copyright Š 2016-2023 Hackolade 12
  • 13. Facilitating communication and collaboration • The purpose of all Data Modeling!!! • “Looking at the code” vs. sharing an ERD picture • Data modeling and schema design for NOSQL databases and data formats provides some guardrails in the face of unlimited flexibility and power of NoSQL. Copyright Š 2016-2023 Hackolade 13
  • 14. Reading material • See Hackolade online documentation • The Hackolade Blog • This excellent new book: MongoDB Data Modeling & Schema Design • Many of the principles in the book are related to query driven modeling based on access patterns! • Hackolade’s on social media: LinkedIn page, Twitter page • Download Hackolade studio for free Copyright Š 2016-2023 Hackolade 14