SlideShare una empresa de Scribd logo
1 de 49
Descargar para leer sin conexión
Data Modeling, Normalization and Denormalization
Nordic PgDay 2018, Oslo
Dimitri Fontaine
CitusData
March 13, 2018
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 1 / 49
Data Modeling, Normalization and Denormalization
Dimitri Fontaine
PostgreSQL Major Contributor
pgloader
CREATE EXTENSION
CREATE EVENT TRIGGER
Bi-Directional Réplication
apt.postgresql.org
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 2 / 49
Mastering PostgreSQL in Application Development
I wrote a book!
Mastering PostgreSQL in Application
Development teaches SQL to devel-
oppers: learn to replace thousands of
lines of code with simple queries.
http://MasteringPostgreSQL.com
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 3 / 49
Rob Pike, Notes on Programming in C
Rule 5. Data dominates.
If you’ve chosen the right data structures
and organized things well, the algorithms
will almost always be self-evident. Data
structures, not algorithms, are central to
programming. (Brooks p. 102.)
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 4 / 49
Database Anomalies
We normalize a database model so as to avoid Database Anomalies. We
also follow simple data structure design rules to make the data easy to
understand, maintain and query.
Database Anomalies
Update anomaly
Insertion anomaly
Deletion anomaly
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 5 / 49
Update Anomaly
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 6 / 49
Insertion Anomaly
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 7 / 49
Deletion Anomaly
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 8 / 49
Database Design and User Workflow
Show me your flowcharts and conceal your
tables, and I shall continue to be mystified.
Show me your tables, and I won’t usually
need your flowcharts; they’ll be obvious.
(Fred Brooks)
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 9 / 49
Database Modeling & Tooling
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 10 / 49
Tooling for Database Modeling
We can use psql and SQL scripts to edit database schemas:
BEGIN;
create schema if not exists sandbox;
create table sandbox.category
(
id serial primary key,
name text not null
);
insert into sandbox.category(name)
values ('sport'),('news'),('box office'),('music');
ROLLBACK;
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 11 / 49
Object Relational Mapping
The R in ORM stands for “Relation”. The result of a SQL query is a
relation. That’s what you should be mapping, not your base tables!
When mapping base tables, you end up trying to solve different complex
issues at the same time:
User Workflow
Consistent view of the whole world at all time
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 12 / 49
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 13 / 49
Basics of the Unix Philosophy: principles
Some design rules that apply to Unix and to database design too:
Rule of Clarity
Clarity is better than cleverness.
Rule of Simplicity
Design for simplicity; add complexity only where you must.
Rule of Transparency
Design for visibility to make inspection and debugging easier.
Rule of Robustness
Robustness is the child of transparency and simplicity.
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 14 / 49
Normal Forms
The Normal Forms are designed to avoid database anomalies, and they
help in following the listed rules seen before.
1st Normal Form, Codd, 1970
1 There are no duplicated rows in the table.
2 Each cell is single-valued (no repeating groups or arrays).
3 Entries in a column (field) are of the same kind.
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 15 / 49
Second Normal Form
2nd Normal Form, Codd, 1971
A table is in 2NF if it is in 1NF and if all non-key attributes are
dependent on all of the key. Since a partial dependency occurs when a
non-key attribute is dependent on only a part of the composite key, the
definition of 2NF is sometimes phrased as:
“A table is in 2NF if it is in 1NF and if it has no partial dependencies.”
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 16 / 49
Third Normal Form and Boyce-Codd Normal Form
3rd Normal Form (Codd, 1971)
and BCNF (Boyce and Codd, 1974)
3NF A table is in 3NF if it is in 2NF
and if it has no transitive
dependencies.
BCNF A table is in BCNF if it is in
3NF and if every determinant is a
candidate key.
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 17 / 49
More Normal Forms!
Each level builds on the previous one.
4NF A table is in 4NF if it is in BCNF and if it has no multi-valued
dependencies.
5NF A table is in 5NF, also called “Projection-join Normal Form”
(PJNF), if it is in 4NF and if every join dependency in the table is a
consequence of the candidate keys of the table.
DKNF A table is in DKNF if every constraint on the table is a
logical consequence of the definition of keys and domains.
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 18 / 49
Database Constraints
Primary Keys, Surrogate Keys, Foreign Keys, and more. . .
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 19 / 49
Primary Keys
First Normal Form requires no duplicated row. I know, let’s use a Primary
Key!
create table sandbox.article
(
id bigserial primary key,
category integer references sandbox.category(id),
pubdate timestamptz,
title text not null,
content text
);
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 20 / 49
Primary Keys, Surrogate Keys
Artificially generated key is named a surrogate key because it is a
substitute for natural key. A natural key would allow preventing
duplicate entries in our data set.
insert into sandbox.article (category, pubdate, title)
values (2, now(), 'Hot from the Press'),
(2, now(), 'Hot from the Press')
returning *;
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 21 / 49
Primary Keys, Surrogate Keys
Oops.
-[ RECORD 1 ]---------------------------
id | 3
category | 2
pubdate | 2018-03-12 15:15:02.384105+01
title | Hot from the Press
content |
-[ RECORD 2 ]---------------------------
id | 4
category | 2
pubdate | 2018-03-12 15:15:02.384105+01
title | Hot from the Press
content |
INSERT 0 2
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 22 / 49
Primary Keys, Surrogate Keys
Fixing the model is easy enough: implement a natural primary key.
create table sandboxpk.article
(
category integer references sandbox.category(id),
pubdate timestamptz,
title text not null,
content text,
primary key(category, pubdate, title)
);
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 23 / 49
Primary Keys, Foreign Keys
Now we have to reference the whole natural key everywhere:
create table sandboxpk.comment
(
a_category integer not null,
a_pubdate timestamptz not null,
a_title text not null,
pubdate timestamptz,
content text,
primary key(a_category, a_pubdate, a_title, pubdate, content),
foreign key(a_category, a_pubdate, a_title)
references sandboxpk.article(category, pubdate, title)
);
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 24 / 49
Primary Keys, Foreign Keys
One solution is to have both a surrogate and a natural key:
create table sandbox.article
(
id integer generated always as identity,
category integer not null references sandbox.category(id)
pubdate timestamptz not null,
title text not null,
content text,
primary key(category, pubdate, title),
unique(id)
);
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 25 / 49
Normalization Helpers: database constraints
To help you implement Normal Forms with strong guarantees even when
having to deal with concurrent access to the database, we have
constraints.
Primary Keys
Foreign Keys
Not Null
Check Constraints
Domains
Exclusion Constraints
1 create table rates
2 (
3 currency text,
4 validity daterange,
5 rate numeric,
6
7 exclude using gist
8 (
9 currency with =,
10 validity with &&
11 )
12 );
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 26 / 49
Denormalization
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 27 / 49
Denormalization
The first rule
of denormalization is that you
don’t
do denormalization.
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 28 / 49
Denormalization is an optimization technique
Programmers waste enormous amounts of time thinking about, or
worrying about, the speed of noncritical parts of their programs,
and these attempts at efficiency actually have a strong negative
impact when debugging and maintenance are considered. We
should forget about small efficiencies, say about 97% of the time:
premature optimization is the
root of all evil. Yet we should not pass up our
opportunities in that critical 3%.
Donald Knuth, "Structured Programming with Goto Statements".
Computing Surveys 6:4 (December 1974), pp. 261–301, §1.
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 29 / 49
Denormalization: cache data
The main trick: repeat data to make it locally available, breaking
functional dependency rules. You know have a cache.
Implement Cache Invalidation.
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 30 / 49
Denormalization example
set season 2017
select drivers.surname as driver,
constructors.name as constructor,
sum(points) as points
from results
join races using(raceid)
join drivers using(driverid)
join constructors using(constructorid)
where races.year = :season
group by grouping sets(drivers.surname, constructors.name)
having sum(points) > 150
order by drivers.surname is not null, points desc;
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 31 / 49
Denormalization example
create view v.season_points as
select year as season, driver, constructor, points
from seasons left join lateral
(
select drivers.surname as driver,
constructors.name as constructor,
sum(points) as points
from results
join races using(raceid)
join drivers using(driverid)
join constructors using(constructorid)
where races.year = seasons.year
group by grouping sets(drivers.surname, constructors.name
order by drivers.surname is not null, points desc
)
as points on true
order by year, driver is null, points desc;
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 32 / 49
Denormalization example
And now cache the results of the view into a durable relation:
create materialized view cache.season_points as
select * from v.season_points;
create index on cache.season_points(season);
When you need to invalidate the cache, just refresh the view:
refresh materialized view cache.season_points;
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 33 / 49
Denormalization example
And now rewrite your application’s query as:
select driver, constructor, points
from cache.season_points
where season = 2017
and points > 150;
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 34 / 49
Other denormalization use cases
Audit Trails
History Tables
Partitionning
Scaling Out
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 35 / 49
History tables and audit trails
Another case where you might have to denormalize your database model is
when keeping a history of all changes.
Foreign key references to other tables won’t be possible when those
reference changes and you want to keep a history that, by definition,
doesn’t change.
The schema of your main table evolves and the history table shouldn’t
rewrite the history for rows already written.
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 36 / 49
History tables with JSONB
JSONB is very flexible, and can host the archives for all your database
model versions in the same table, or for all your source tables at once even.
create schema if not exists archive;
create type archive.action_t
as enum('insert', 'update', 'delete');
create table archive.older_versions
(
table_name text,
date timestamptz default now(),
action archive.action_t,
data jsonb
);
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 37 / 49
Validity periods
A variant of the historic requirement is to keep track of data changes and
be able to use the value that were valid at a known time. Currency
exchange rates applied to invoices is an example:
create table rates
(
currency text,
validity daterange,
rate numeric,
exclude using gist (currency with =,
validity with &&)
);
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 38 / 49
Validity periods
Here’s how to use the data from a known time in the past:
select currency, validity, rate
from rates
where currency = 'Euro'
and validity @> date '2017-05-18';
-[ RECORD 1 ]---------------------
currency | Euro
validity | [2017-05-18,2017-05-19)
rate | 1.240740
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 39 / 49
Denormalization Helpers: advanced datatypes
Composite datatypes help with denormalization. It’s possible to keep
several values in the same column thanks to them. Spare matrix becomes
an extra field of jsonb type.
Composite Types
Arrays
JSONb
Enumerated Types
hstore
ltree
intarray
pg_trgm
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 40 / 49
Partitioning
Partitioning comes with demormalization trade-offs in PostgreSQL 10:
Index are managed at the partition level
No Primary Key, No Unique Index, No Exclusion Constraint
No Foreign Key pointing to a partitionned table
Lack of ON CONFLICT support
Lack of UPDATE support for re-balancing
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 41 / 49
Not Only SQL
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 42 / 49
Schemaless design
PostgreSQL includes several composite types (multi-value data). JSONb
allows the implementation of schemaless design right within PostgreSQL.
select jsonb_pretty(data)
from magic.cards
where data @> '{"type":"Enchantment",
"artist":"Jim Murray",
"colors":["White"]
}';
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 43 / 49
NoSQL and Durability Trade-Offs
PostgreSQL setup is made with GUC, or Great Unified Configuration. You
can edit values in the postgresql.conf file, or dynamically change it in
the session. Or in the transaction with SET LOCAL. Or have per-user or
per-database settings.
create role dbowner with login;
create role app with login;
create role critical with login in role app inherit;
create role notsomuch with login in role app inherit;
create role dontcare with login in role app inherit;
alter user critical set synchronous_commit to remote_apply;
alter user notsomuch set synchronous_commit to local;
alter user dontcare set synchronous_commit to off;
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 44 / 49
Automatic Per-Transaction Durability Setting
SET demo.threshold TO 1000;
CREATE OR REPLACE FUNCTION public.syncrep_important_delta()
RETURNS TRIGGER
LANGUAGE PLpgSQL
AS
$$ DECLARE
threshold integer := current_setting('demo.threshold')::int;
delta integer := NEW.abalance - OLD.abalance;
BEGIN
IF delta > threshold
THEN
SET LOCAL synchronous_commit TO on;
END IF;
RETURN NEW;
END;
$$;
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 45 / 49
Horizontal Scaling: Sharding
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 46 / 49
Five sharding data models and which is right?
If you were here this morning you’ve seen Craig’s talk, so that’s about it.
Sharding by geography
Sharding by entity id
Sharding a graph
Time partitioning
Depends. . .
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 47 / 49
Denormalization and Sharding
Adding the sharding key to every
table is another case of duplicating
information for maintaining a
cache. Beware of database
anomalies
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 48 / 49
Questions?
Now is the time to ask!
https://2018.nordicpgday.org/feedback
Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 49 / 49

Más contenido relacionado

La actualidad más candente

RDataMining slides-regression-classification
RDataMining slides-regression-classificationRDataMining slides-regression-classification
RDataMining slides-regression-classificationYanchang Zhao
 
Overview of query evaluation
Overview of query evaluationOverview of query evaluation
Overview of query evaluationavniS
 
Grouping & Summarizing Data in R
Grouping & Summarizing Data in RGrouping & Summarizing Data in R
Grouping & Summarizing Data in RJeffrey Breen
 
Frequent Pattern Mining with Serialization and De-Serialization
Frequent Pattern Mining with Serialization and De-SerializationFrequent Pattern Mining with Serialization and De-Serialization
Frequent Pattern Mining with Serialization and De-Serializationiosrjce
 
Introduction to Pandas and Time Series Analysis [PyCon DE]
Introduction to Pandas and Time Series Analysis [PyCon DE]Introduction to Pandas and Time Series Analysis [PyCon DE]
Introduction to Pandas and Time Series Analysis [PyCon DE]Alexander Hendorf
 
Sql on hadoop the secret presentation.3pptx
Sql on hadoop  the secret presentation.3pptxSql on hadoop  the secret presentation.3pptx
Sql on hadoop the secret presentation.3pptxPaulo Alonso
 
Presentation dual inversion-index
Presentation dual inversion-indexPresentation dual inversion-index
Presentation dual inversion-indexmahi_uta
 
SAS and R Code for Basic Statistics
SAS and R Code for Basic StatisticsSAS and R Code for Basic Statistics
SAS and R Code for Basic StatisticsAvjinder (Avi) Kaler
 
RDataMining slides-network-analysis-with-r
RDataMining slides-network-analysis-with-rRDataMining slides-network-analysis-with-r
RDataMining slides-network-analysis-with-rYanchang Zhao
 
Big Data Processing using Apache Spark and Clojure
Big Data Processing using Apache Spark and ClojureBig Data Processing using Apache Spark and Clojure
Big Data Processing using Apache Spark and ClojureDr. Christian Betz
 
R programming & Machine Learning
R programming & Machine LearningR programming & Machine Learning
R programming & Machine LearningAmanBhalla14
 

La actualidad más candente (19)

RDataMining slides-regression-classification
RDataMining slides-regression-classificationRDataMining slides-regression-classification
RDataMining slides-regression-classification
 
Overview of query evaluation
Overview of query evaluationOverview of query evaluation
Overview of query evaluation
 
R training3
R training3R training3
R training3
 
Grouping & Summarizing Data in R
Grouping & Summarizing Data in RGrouping & Summarizing Data in R
Grouping & Summarizing Data in R
 
Machine Learning in R
Machine Learning in RMachine Learning in R
Machine Learning in R
 
Frequent Pattern Mining with Serialization and De-Serialization
Frequent Pattern Mining with Serialization and De-SerializationFrequent Pattern Mining with Serialization and De-Serialization
Frequent Pattern Mining with Serialization and De-Serialization
 
Chapter15
Chapter15Chapter15
Chapter15
 
Introduction to Pandas and Time Series Analysis [PyCon DE]
Introduction to Pandas and Time Series Analysis [PyCon DE]Introduction to Pandas and Time Series Analysis [PyCon DE]
Introduction to Pandas and Time Series Analysis [PyCon DE]
 
R language introduction
R language introductionR language introduction
R language introduction
 
R programming by ganesh kavhar
R programming by ganesh kavharR programming by ganesh kavhar
R programming by ganesh kavhar
 
Sql on hadoop the secret presentation.3pptx
Sql on hadoop  the secret presentation.3pptxSql on hadoop  the secret presentation.3pptx
Sql on hadoop the secret presentation.3pptx
 
Presentation dual inversion-index
Presentation dual inversion-indexPresentation dual inversion-index
Presentation dual inversion-index
 
Chapter 5 ds
Chapter 5 dsChapter 5 ds
Chapter 5 ds
 
SAS and R Code for Basic Statistics
SAS and R Code for Basic StatisticsSAS and R Code for Basic Statistics
SAS and R Code for Basic Statistics
 
RDataMining slides-network-analysis-with-r
RDataMining slides-network-analysis-with-rRDataMining slides-network-analysis-with-r
RDataMining slides-network-analysis-with-r
 
Tree
TreeTree
Tree
 
Big Data Processing using Apache Spark and Clojure
Big Data Processing using Apache Spark and ClojureBig Data Processing using Apache Spark and Clojure
Big Data Processing using Apache Spark and Clojure
 
R programming & Machine Learning
R programming & Machine LearningR programming & Machine Learning
R programming & Machine Learning
 
Programming in R
Programming in RProgramming in R
Programming in R
 

Similar a Data Modeling, Normalization and Denormalization | Nordic PGDay 2018 | Dimitri Fontaine

Data Modeling, Normalization, and Denormalisation | PostgreSQL Conference Eur...
Data Modeling, Normalization, and Denormalisation | PostgreSQL Conference Eur...Data Modeling, Normalization, and Denormalisation | PostgreSQL Conference Eur...
Data Modeling, Normalization, and Denormalisation | PostgreSQL Conference Eur...Citus Data
 
Data Modeling, Normalization, and De-Normalization | PostgresOpen 2019 | Dimi...
Data Modeling, Normalization, and De-Normalization | PostgresOpen 2019 | Dimi...Data Modeling, Normalization, and De-Normalization | PostgresOpen 2019 | Dimi...
Data Modeling, Normalization, and De-Normalization | PostgresOpen 2019 | Dimi...Citus Data
 
1912204-big-data-analytics.pdf
1912204-big-data-analytics.pdf1912204-big-data-analytics.pdf
1912204-big-data-analytics.pdfVinothKumarM72
 
Logical Data Fabric: Architectural Components
Logical Data Fabric: Architectural ComponentsLogical Data Fabric: Architectural Components
Logical Data Fabric: Architectural ComponentsDenodo
 
From DBA to DE: Becoming a Data Engineer
From DBA to DE:  Becoming a Data Engineer From DBA to DE:  Becoming a Data Engineer
From DBA to DE: Becoming a Data Engineer Jim Czuprynski
 
Data Con LA 2022 - Open Source Large Knowledge Graph Factory
Data Con LA 2022 - Open Source Large Knowledge Graph FactoryData Con LA 2022 - Open Source Large Knowledge Graph Factory
Data Con LA 2022 - Open Source Large Knowledge Graph FactoryData Con LA
 
Microkernels in the Era of Data-Centric Computing
Microkernels in the Era of Data-Centric ComputingMicrokernels in the Era of Data-Centric Computing
Microkernels in the Era of Data-Centric ComputingMartin Děcký
 
Daeil Kim: Machine Learning at the New York Times
Daeil Kim: Machine Learning at the New York TimesDaeil Kim: Machine Learning at the New York Times
Daeil Kim: Machine Learning at the New York Timesmortardata
 
empirical software engineering, v2.0
empirical software engineering, v2.0empirical software engineering, v2.0
empirical software engineering, v2.0CS, NcState
 
How to design ai functions to the cloud native infra
How to design ai functions to the cloud native infraHow to design ai functions to the cloud native infra
How to design ai functions to the cloud native infraChun Myung Kyu
 
Data Structures for Statistical Computing in Python
Data Structures for Statistical Computing in PythonData Structures for Statistical Computing in Python
Data Structures for Statistical Computing in PythonWes McKinney
 
AIAA Future of Fluids 2018 Balaji
AIAA Future of Fluids 2018 BalajiAIAA Future of Fluids 2018 Balaji
AIAA Future of Fluids 2018 BalajiQiqi Wang
 
A short study on telecom information models & offerings
A short study on telecom information models & offeringsA short study on telecom information models & offerings
A short study on telecom information models & offeringsSayak Majumder
 
Smart Data Webinar: Choosing the Right Data Management Architecture for Cogni...
Smart Data Webinar: Choosing the Right Data Management Architecture for Cogni...Smart Data Webinar: Choosing the Right Data Management Architecture for Cogni...
Smart Data Webinar: Choosing the Right Data Management Architecture for Cogni...DATAVERSITY
 
Matthias Deeg - Bypassing an Enterprise-Grade Biometric Face Authentication S...
Matthias Deeg - Bypassing an Enterprise-Grade Biometric Face Authentication S...Matthias Deeg - Bypassing an Enterprise-Grade Biometric Face Authentication S...
Matthias Deeg - Bypassing an Enterprise-Grade Biometric Face Authentication S...hacktivity
 
Come diventare data scientist - Paolo Pellegrini
Come diventare data scientist - Paolo PellegriniCome diventare data scientist - Paolo Pellegrini
Come diventare data scientist - Paolo PellegriniDonatella Cambosu
 

Similar a Data Modeling, Normalization and Denormalization | Nordic PGDay 2018 | Dimitri Fontaine (20)

Data Modeling, Normalization, and Denormalisation | PostgreSQL Conference Eur...
Data Modeling, Normalization, and Denormalisation | PostgreSQL Conference Eur...Data Modeling, Normalization, and Denormalisation | PostgreSQL Conference Eur...
Data Modeling, Normalization, and Denormalisation | PostgreSQL Conference Eur...
 
Data Modeling, Normalization, and De-Normalization | PostgresOpen 2019 | Dimi...
Data Modeling, Normalization, and De-Normalization | PostgresOpen 2019 | Dimi...Data Modeling, Normalization, and De-Normalization | PostgresOpen 2019 | Dimi...
Data Modeling, Normalization, and De-Normalization | PostgresOpen 2019 | Dimi...
 
Preprocessing
PreprocessingPreprocessing
Preprocessing
 
1912204-big-data-analytics.pdf
1912204-big-data-analytics.pdf1912204-big-data-analytics.pdf
1912204-big-data-analytics.pdf
 
GA Project #4 Student Presentation - Platfora
GA Project #4 Student Presentation - PlatforaGA Project #4 Student Presentation - Platfora
GA Project #4 Student Presentation - Platfora
 
Logical Data Fabric: Architectural Components
Logical Data Fabric: Architectural ComponentsLogical Data Fabric: Architectural Components
Logical Data Fabric: Architectural Components
 
Database
DatabaseDatabase
Database
 
From DBA to DE: Becoming a Data Engineer
From DBA to DE:  Becoming a Data Engineer From DBA to DE:  Becoming a Data Engineer
From DBA to DE: Becoming a Data Engineer
 
Data Con LA 2022 - Open Source Large Knowledge Graph Factory
Data Con LA 2022 - Open Source Large Knowledge Graph FactoryData Con LA 2022 - Open Source Large Knowledge Graph Factory
Data Con LA 2022 - Open Source Large Knowledge Graph Factory
 
Microkernels in the Era of Data-Centric Computing
Microkernels in the Era of Data-Centric ComputingMicrokernels in the Era of Data-Centric Computing
Microkernels in the Era of Data-Centric Computing
 
Daeil Kim: Machine Learning at the New York Times
Daeil Kim: Machine Learning at the New York TimesDaeil Kim: Machine Learning at the New York Times
Daeil Kim: Machine Learning at the New York Times
 
empirical software engineering, v2.0
empirical software engineering, v2.0empirical software engineering, v2.0
empirical software engineering, v2.0
 
How to design ai functions to the cloud native infra
How to design ai functions to the cloud native infraHow to design ai functions to the cloud native infra
How to design ai functions to the cloud native infra
 
Data Structures for Statistical Computing in Python
Data Structures for Statistical Computing in PythonData Structures for Statistical Computing in Python
Data Structures for Statistical Computing in Python
 
AIAA Future of Fluids 2018 Balaji
AIAA Future of Fluids 2018 BalajiAIAA Future of Fluids 2018 Balaji
AIAA Future of Fluids 2018 Balaji
 
AQA Computer science easter revision
AQA Computer science easter revisionAQA Computer science easter revision
AQA Computer science easter revision
 
A short study on telecom information models & offerings
A short study on telecom information models & offeringsA short study on telecom information models & offerings
A short study on telecom information models & offerings
 
Smart Data Webinar: Choosing the Right Data Management Architecture for Cogni...
Smart Data Webinar: Choosing the Right Data Management Architecture for Cogni...Smart Data Webinar: Choosing the Right Data Management Architecture for Cogni...
Smart Data Webinar: Choosing the Right Data Management Architecture for Cogni...
 
Matthias Deeg - Bypassing an Enterprise-Grade Biometric Face Authentication S...
Matthias Deeg - Bypassing an Enterprise-Grade Biometric Face Authentication S...Matthias Deeg - Bypassing an Enterprise-Grade Biometric Face Authentication S...
Matthias Deeg - Bypassing an Enterprise-Grade Biometric Face Authentication S...
 
Come diventare data scientist - Paolo Pellegrini
Come diventare data scientist - Paolo PellegriniCome diventare data scientist - Paolo Pellegrini
Come diventare data scientist - Paolo Pellegrini
 

Más de Citus Data

Architecting peta-byte-scale analytics by scaling out Postgres on Azure with ...
Architecting peta-byte-scale analytics by scaling out Postgres on Azure with ...Architecting peta-byte-scale analytics by scaling out Postgres on Azure with ...
Architecting peta-byte-scale analytics by scaling out Postgres on Azure with ...Citus Data
 
JSONB Tricks: Operators, Indexes, and When (Not) to Use It | PostgresOpen 201...
JSONB Tricks: Operators, Indexes, and When (Not) to Use It | PostgresOpen 201...JSONB Tricks: Operators, Indexes, and When (Not) to Use It | PostgresOpen 201...
JSONB Tricks: Operators, Indexes, and When (Not) to Use It | PostgresOpen 201...Citus Data
 
Tutorial: Implementing your first Postgres extension | PGConf EU 2019 | Burak...
Tutorial: Implementing your first Postgres extension | PGConf EU 2019 | Burak...Tutorial: Implementing your first Postgres extension | PGConf EU 2019 | Burak...
Tutorial: Implementing your first Postgres extension | PGConf EU 2019 | Burak...Citus Data
 
Whats wrong with postgres | PGConf EU 2019 | Craig Kerstiens
Whats wrong with postgres | PGConf EU 2019 | Craig KerstiensWhats wrong with postgres | PGConf EU 2019 | Craig Kerstiens
Whats wrong with postgres | PGConf EU 2019 | Craig KerstiensCitus Data
 
When it all goes wrong | PGConf EU 2019 | Will Leinweber
When it all goes wrong | PGConf EU 2019 | Will LeinweberWhen it all goes wrong | PGConf EU 2019 | Will Leinweber
When it all goes wrong | PGConf EU 2019 | Will LeinweberCitus Data
 
Amazing SQL your ORM can (or can't) do | PGConf EU 2019 | Louise Grandjonc
Amazing SQL your ORM can (or can't) do | PGConf EU 2019 | Louise GrandjoncAmazing SQL your ORM can (or can't) do | PGConf EU 2019 | Louise Grandjonc
Amazing SQL your ORM can (or can't) do | PGConf EU 2019 | Louise GrandjoncCitus Data
 
What Microsoft is doing with Postgres & the Citus Data acquisition | PGConf E...
What Microsoft is doing with Postgres & the Citus Data acquisition | PGConf E...What Microsoft is doing with Postgres & the Citus Data acquisition | PGConf E...
What Microsoft is doing with Postgres & the Citus Data acquisition | PGConf E...Citus Data
 
Deep Postgres Extensions in Rust | PGCon 2019 | Jeff Davis
Deep Postgres Extensions in Rust | PGCon 2019 | Jeff DavisDeep Postgres Extensions in Rust | PGCon 2019 | Jeff Davis
Deep Postgres Extensions in Rust | PGCon 2019 | Jeff DavisCitus Data
 
Why Postgres Why This Database Why Now | SF Bay Area Postgres Meetup | Claire...
Why Postgres Why This Database Why Now | SF Bay Area Postgres Meetup | Claire...Why Postgres Why This Database Why Now | SF Bay Area Postgres Meetup | Claire...
Why Postgres Why This Database Why Now | SF Bay Area Postgres Meetup | Claire...Citus Data
 
A story on Postgres index types | PostgresLondon 2019 | Louise Grandjonc
A story on Postgres index types | PostgresLondon 2019 | Louise GrandjoncA story on Postgres index types | PostgresLondon 2019 | Louise Grandjonc
A story on Postgres index types | PostgresLondon 2019 | Louise GrandjoncCitus Data
 
Why developers need marketing now more than ever | GlueCon 2019 | Claire Gior...
Why developers need marketing now more than ever | GlueCon 2019 | Claire Gior...Why developers need marketing now more than ever | GlueCon 2019 | Claire Gior...
Why developers need marketing now more than ever | GlueCon 2019 | Claire Gior...Citus Data
 
The Art of PostgreSQL | PostgreSQL Ukraine | Dimitri Fontaine
The Art of PostgreSQL | PostgreSQL Ukraine | Dimitri FontaineThe Art of PostgreSQL | PostgreSQL Ukraine | Dimitri Fontaine
The Art of PostgreSQL | PostgreSQL Ukraine | Dimitri FontaineCitus Data
 
Optimizing your app by understanding your Postgres | RailsConf 2019 | Samay S...
Optimizing your app by understanding your Postgres | RailsConf 2019 | Samay S...Optimizing your app by understanding your Postgres | RailsConf 2019 | Samay S...
Optimizing your app by understanding your Postgres | RailsConf 2019 | Samay S...Citus Data
 
When it all goes wrong (with Postgres) | RailsConf 2019 | Will Leinweber
When it all goes wrong (with Postgres) | RailsConf 2019 | Will LeinweberWhen it all goes wrong (with Postgres) | RailsConf 2019 | Will Leinweber
When it all goes wrong (with Postgres) | RailsConf 2019 | Will LeinweberCitus Data
 
The Art of PostgreSQL | PostgreSQL Ukraine Meetup | Dimitri Fontaine
The Art of PostgreSQL | PostgreSQL Ukraine Meetup | Dimitri FontaineThe Art of PostgreSQL | PostgreSQL Ukraine Meetup | Dimitri Fontaine
The Art of PostgreSQL | PostgreSQL Ukraine Meetup | Dimitri FontaineCitus Data
 
Using Postgres and Citus for Lightning Fast Analytics, also ft. Rollups | Liv...
Using Postgres and Citus for Lightning Fast Analytics, also ft. Rollups | Liv...Using Postgres and Citus for Lightning Fast Analytics, also ft. Rollups | Liv...
Using Postgres and Citus for Lightning Fast Analytics, also ft. Rollups | Liv...Citus Data
 
How to write SQL queries | pgDay Paris 2019 | Dimitri Fontaine
How to write SQL queries | pgDay Paris 2019 | Dimitri FontaineHow to write SQL queries | pgDay Paris 2019 | Dimitri Fontaine
How to write SQL queries | pgDay Paris 2019 | Dimitri FontaineCitus Data
 
When it all Goes Wrong |Nordic PGDay 2019 | Will Leinweber
When it all Goes Wrong |Nordic PGDay 2019 | Will LeinweberWhen it all Goes Wrong |Nordic PGDay 2019 | Will Leinweber
When it all Goes Wrong |Nordic PGDay 2019 | Will LeinweberCitus Data
 
Why PostgreSQL Why This Database Why Now | Nordic PGDay 2019 | Claire Giordano
Why PostgreSQL Why This Database Why Now | Nordic PGDay 2019 | Claire GiordanoWhy PostgreSQL Why This Database Why Now | Nordic PGDay 2019 | Claire Giordano
Why PostgreSQL Why This Database Why Now | Nordic PGDay 2019 | Claire GiordanoCitus Data
 
Scaling Multi-Tenant Applications Using the Django ORM & Postgres | PyCaribbe...
Scaling Multi-Tenant Applications Using the Django ORM & Postgres | PyCaribbe...Scaling Multi-Tenant Applications Using the Django ORM & Postgres | PyCaribbe...
Scaling Multi-Tenant Applications Using the Django ORM & Postgres | PyCaribbe...Citus Data
 

Más de Citus Data (20)

Architecting peta-byte-scale analytics by scaling out Postgres on Azure with ...
Architecting peta-byte-scale analytics by scaling out Postgres on Azure with ...Architecting peta-byte-scale analytics by scaling out Postgres on Azure with ...
Architecting peta-byte-scale analytics by scaling out Postgres on Azure with ...
 
JSONB Tricks: Operators, Indexes, and When (Not) to Use It | PostgresOpen 201...
JSONB Tricks: Operators, Indexes, and When (Not) to Use It | PostgresOpen 201...JSONB Tricks: Operators, Indexes, and When (Not) to Use It | PostgresOpen 201...
JSONB Tricks: Operators, Indexes, and When (Not) to Use It | PostgresOpen 201...
 
Tutorial: Implementing your first Postgres extension | PGConf EU 2019 | Burak...
Tutorial: Implementing your first Postgres extension | PGConf EU 2019 | Burak...Tutorial: Implementing your first Postgres extension | PGConf EU 2019 | Burak...
Tutorial: Implementing your first Postgres extension | PGConf EU 2019 | Burak...
 
Whats wrong with postgres | PGConf EU 2019 | Craig Kerstiens
Whats wrong with postgres | PGConf EU 2019 | Craig KerstiensWhats wrong with postgres | PGConf EU 2019 | Craig Kerstiens
Whats wrong with postgres | PGConf EU 2019 | Craig Kerstiens
 
When it all goes wrong | PGConf EU 2019 | Will Leinweber
When it all goes wrong | PGConf EU 2019 | Will LeinweberWhen it all goes wrong | PGConf EU 2019 | Will Leinweber
When it all goes wrong | PGConf EU 2019 | Will Leinweber
 
Amazing SQL your ORM can (or can't) do | PGConf EU 2019 | Louise Grandjonc
Amazing SQL your ORM can (or can't) do | PGConf EU 2019 | Louise GrandjoncAmazing SQL your ORM can (or can't) do | PGConf EU 2019 | Louise Grandjonc
Amazing SQL your ORM can (or can't) do | PGConf EU 2019 | Louise Grandjonc
 
What Microsoft is doing with Postgres & the Citus Data acquisition | PGConf E...
What Microsoft is doing with Postgres & the Citus Data acquisition | PGConf E...What Microsoft is doing with Postgres & the Citus Data acquisition | PGConf E...
What Microsoft is doing with Postgres & the Citus Data acquisition | PGConf E...
 
Deep Postgres Extensions in Rust | PGCon 2019 | Jeff Davis
Deep Postgres Extensions in Rust | PGCon 2019 | Jeff DavisDeep Postgres Extensions in Rust | PGCon 2019 | Jeff Davis
Deep Postgres Extensions in Rust | PGCon 2019 | Jeff Davis
 
Why Postgres Why This Database Why Now | SF Bay Area Postgres Meetup | Claire...
Why Postgres Why This Database Why Now | SF Bay Area Postgres Meetup | Claire...Why Postgres Why This Database Why Now | SF Bay Area Postgres Meetup | Claire...
Why Postgres Why This Database Why Now | SF Bay Area Postgres Meetup | Claire...
 
A story on Postgres index types | PostgresLondon 2019 | Louise Grandjonc
A story on Postgres index types | PostgresLondon 2019 | Louise GrandjoncA story on Postgres index types | PostgresLondon 2019 | Louise Grandjonc
A story on Postgres index types | PostgresLondon 2019 | Louise Grandjonc
 
Why developers need marketing now more than ever | GlueCon 2019 | Claire Gior...
Why developers need marketing now more than ever | GlueCon 2019 | Claire Gior...Why developers need marketing now more than ever | GlueCon 2019 | Claire Gior...
Why developers need marketing now more than ever | GlueCon 2019 | Claire Gior...
 
The Art of PostgreSQL | PostgreSQL Ukraine | Dimitri Fontaine
The Art of PostgreSQL | PostgreSQL Ukraine | Dimitri FontaineThe Art of PostgreSQL | PostgreSQL Ukraine | Dimitri Fontaine
The Art of PostgreSQL | PostgreSQL Ukraine | Dimitri Fontaine
 
Optimizing your app by understanding your Postgres | RailsConf 2019 | Samay S...
Optimizing your app by understanding your Postgres | RailsConf 2019 | Samay S...Optimizing your app by understanding your Postgres | RailsConf 2019 | Samay S...
Optimizing your app by understanding your Postgres | RailsConf 2019 | Samay S...
 
When it all goes wrong (with Postgres) | RailsConf 2019 | Will Leinweber
When it all goes wrong (with Postgres) | RailsConf 2019 | Will LeinweberWhen it all goes wrong (with Postgres) | RailsConf 2019 | Will Leinweber
When it all goes wrong (with Postgres) | RailsConf 2019 | Will Leinweber
 
The Art of PostgreSQL | PostgreSQL Ukraine Meetup | Dimitri Fontaine
The Art of PostgreSQL | PostgreSQL Ukraine Meetup | Dimitri FontaineThe Art of PostgreSQL | PostgreSQL Ukraine Meetup | Dimitri Fontaine
The Art of PostgreSQL | PostgreSQL Ukraine Meetup | Dimitri Fontaine
 
Using Postgres and Citus for Lightning Fast Analytics, also ft. Rollups | Liv...
Using Postgres and Citus for Lightning Fast Analytics, also ft. Rollups | Liv...Using Postgres and Citus for Lightning Fast Analytics, also ft. Rollups | Liv...
Using Postgres and Citus for Lightning Fast Analytics, also ft. Rollups | Liv...
 
How to write SQL queries | pgDay Paris 2019 | Dimitri Fontaine
How to write SQL queries | pgDay Paris 2019 | Dimitri FontaineHow to write SQL queries | pgDay Paris 2019 | Dimitri Fontaine
How to write SQL queries | pgDay Paris 2019 | Dimitri Fontaine
 
When it all Goes Wrong |Nordic PGDay 2019 | Will Leinweber
When it all Goes Wrong |Nordic PGDay 2019 | Will LeinweberWhen it all Goes Wrong |Nordic PGDay 2019 | Will Leinweber
When it all Goes Wrong |Nordic PGDay 2019 | Will Leinweber
 
Why PostgreSQL Why This Database Why Now | Nordic PGDay 2019 | Claire Giordano
Why PostgreSQL Why This Database Why Now | Nordic PGDay 2019 | Claire GiordanoWhy PostgreSQL Why This Database Why Now | Nordic PGDay 2019 | Claire Giordano
Why PostgreSQL Why This Database Why Now | Nordic PGDay 2019 | Claire Giordano
 
Scaling Multi-Tenant Applications Using the Django ORM & Postgres | PyCaribbe...
Scaling Multi-Tenant Applications Using the Django ORM & Postgres | PyCaribbe...Scaling Multi-Tenant Applications Using the Django ORM & Postgres | PyCaribbe...
Scaling Multi-Tenant Applications Using the Django ORM & Postgres | PyCaribbe...
 

Último

Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...amitlee9823
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...SUHANI PANDEY
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteedamy56318795
 
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...amitlee9823
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangaloreamitlee9823
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...amitlee9823
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramMoniSankarHazra
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...only4webmaster01
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...amitlee9823
 
hybrid Seed Production In Chilli & Capsicum.pptx
hybrid Seed Production In Chilli & Capsicum.pptxhybrid Seed Production In Chilli & Capsicum.pptx
hybrid Seed Production In Chilli & Capsicum.pptx9to5mart
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Researchmichael115558
 
Detecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning ApproachDetecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning ApproachBoston Institute of Analytics
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...amitlee9823
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...karishmasinghjnh
 

Último (20)

Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
 
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics Program
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
hybrid Seed Production In Chilli & Capsicum.pptx
hybrid Seed Production In Chilli & Capsicum.pptxhybrid Seed Production In Chilli & Capsicum.pptx
hybrid Seed Production In Chilli & Capsicum.pptx
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Detecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning ApproachDetecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning Approach
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
 

Data Modeling, Normalization and Denormalization | Nordic PGDay 2018 | Dimitri Fontaine

  • 1. Data Modeling, Normalization and Denormalization Nordic PgDay 2018, Oslo Dimitri Fontaine CitusData March 13, 2018 Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 1 / 49
  • 2. Data Modeling, Normalization and Denormalization Dimitri Fontaine PostgreSQL Major Contributor pgloader CREATE EXTENSION CREATE EVENT TRIGGER Bi-Directional Réplication apt.postgresql.org Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 2 / 49
  • 3. Mastering PostgreSQL in Application Development I wrote a book! Mastering PostgreSQL in Application Development teaches SQL to devel- oppers: learn to replace thousands of lines of code with simple queries. http://MasteringPostgreSQL.com Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 3 / 49
  • 4. Rob Pike, Notes on Programming in C Rule 5. Data dominates. If you’ve chosen the right data structures and organized things well, the algorithms will almost always be self-evident. Data structures, not algorithms, are central to programming. (Brooks p. 102.) Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 4 / 49
  • 5. Database Anomalies We normalize a database model so as to avoid Database Anomalies. We also follow simple data structure design rules to make the data easy to understand, maintain and query. Database Anomalies Update anomaly Insertion anomaly Deletion anomaly Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 5 / 49
  • 6. Update Anomaly Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 6 / 49
  • 7. Insertion Anomaly Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 7 / 49
  • 8. Deletion Anomaly Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 8 / 49
  • 9. Database Design and User Workflow Show me your flowcharts and conceal your tables, and I shall continue to be mystified. Show me your tables, and I won’t usually need your flowcharts; they’ll be obvious. (Fred Brooks) Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 9 / 49
  • 10. Database Modeling & Tooling Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 10 / 49
  • 11. Tooling for Database Modeling We can use psql and SQL scripts to edit database schemas: BEGIN; create schema if not exists sandbox; create table sandbox.category ( id serial primary key, name text not null ); insert into sandbox.category(name) values ('sport'),('news'),('box office'),('music'); ROLLBACK; Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 11 / 49
  • 12. Object Relational Mapping The R in ORM stands for “Relation”. The result of a SQL query is a relation. That’s what you should be mapping, not your base tables! When mapping base tables, you end up trying to solve different complex issues at the same time: User Workflow Consistent view of the whole world at all time Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 12 / 49
  • 13. Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 13 / 49
  • 14. Basics of the Unix Philosophy: principles Some design rules that apply to Unix and to database design too: Rule of Clarity Clarity is better than cleverness. Rule of Simplicity Design for simplicity; add complexity only where you must. Rule of Transparency Design for visibility to make inspection and debugging easier. Rule of Robustness Robustness is the child of transparency and simplicity. Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 14 / 49
  • 15. Normal Forms The Normal Forms are designed to avoid database anomalies, and they help in following the listed rules seen before. 1st Normal Form, Codd, 1970 1 There are no duplicated rows in the table. 2 Each cell is single-valued (no repeating groups or arrays). 3 Entries in a column (field) are of the same kind. Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 15 / 49
  • 16. Second Normal Form 2nd Normal Form, Codd, 1971 A table is in 2NF if it is in 1NF and if all non-key attributes are dependent on all of the key. Since a partial dependency occurs when a non-key attribute is dependent on only a part of the composite key, the definition of 2NF is sometimes phrased as: “A table is in 2NF if it is in 1NF and if it has no partial dependencies.” Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 16 / 49
  • 17. Third Normal Form and Boyce-Codd Normal Form 3rd Normal Form (Codd, 1971) and BCNF (Boyce and Codd, 1974) 3NF A table is in 3NF if it is in 2NF and if it has no transitive dependencies. BCNF A table is in BCNF if it is in 3NF and if every determinant is a candidate key. Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 17 / 49
  • 18. More Normal Forms! Each level builds on the previous one. 4NF A table is in 4NF if it is in BCNF and if it has no multi-valued dependencies. 5NF A table is in 5NF, also called “Projection-join Normal Form” (PJNF), if it is in 4NF and if every join dependency in the table is a consequence of the candidate keys of the table. DKNF A table is in DKNF if every constraint on the table is a logical consequence of the definition of keys and domains. Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 18 / 49
  • 19. Database Constraints Primary Keys, Surrogate Keys, Foreign Keys, and more. . . Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 19 / 49
  • 20. Primary Keys First Normal Form requires no duplicated row. I know, let’s use a Primary Key! create table sandbox.article ( id bigserial primary key, category integer references sandbox.category(id), pubdate timestamptz, title text not null, content text ); Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 20 / 49
  • 21. Primary Keys, Surrogate Keys Artificially generated key is named a surrogate key because it is a substitute for natural key. A natural key would allow preventing duplicate entries in our data set. insert into sandbox.article (category, pubdate, title) values (2, now(), 'Hot from the Press'), (2, now(), 'Hot from the Press') returning *; Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 21 / 49
  • 22. Primary Keys, Surrogate Keys Oops. -[ RECORD 1 ]--------------------------- id | 3 category | 2 pubdate | 2018-03-12 15:15:02.384105+01 title | Hot from the Press content | -[ RECORD 2 ]--------------------------- id | 4 category | 2 pubdate | 2018-03-12 15:15:02.384105+01 title | Hot from the Press content | INSERT 0 2 Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 22 / 49
  • 23. Primary Keys, Surrogate Keys Fixing the model is easy enough: implement a natural primary key. create table sandboxpk.article ( category integer references sandbox.category(id), pubdate timestamptz, title text not null, content text, primary key(category, pubdate, title) ); Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 23 / 49
  • 24. Primary Keys, Foreign Keys Now we have to reference the whole natural key everywhere: create table sandboxpk.comment ( a_category integer not null, a_pubdate timestamptz not null, a_title text not null, pubdate timestamptz, content text, primary key(a_category, a_pubdate, a_title, pubdate, content), foreign key(a_category, a_pubdate, a_title) references sandboxpk.article(category, pubdate, title) ); Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 24 / 49
  • 25. Primary Keys, Foreign Keys One solution is to have both a surrogate and a natural key: create table sandbox.article ( id integer generated always as identity, category integer not null references sandbox.category(id) pubdate timestamptz not null, title text not null, content text, primary key(category, pubdate, title), unique(id) ); Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 25 / 49
  • 26. Normalization Helpers: database constraints To help you implement Normal Forms with strong guarantees even when having to deal with concurrent access to the database, we have constraints. Primary Keys Foreign Keys Not Null Check Constraints Domains Exclusion Constraints 1 create table rates 2 ( 3 currency text, 4 validity daterange, 5 rate numeric, 6 7 exclude using gist 8 ( 9 currency with =, 10 validity with && 11 ) 12 ); Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 26 / 49
  • 27. Denormalization Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 27 / 49
  • 28. Denormalization The first rule of denormalization is that you don’t do denormalization. Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 28 / 49
  • 29. Denormalization is an optimization technique Programmers waste enormous amounts of time thinking about, or worrying about, the speed of noncritical parts of their programs, and these attempts at efficiency actually have a strong negative impact when debugging and maintenance are considered. We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%. Donald Knuth, "Structured Programming with Goto Statements". Computing Surveys 6:4 (December 1974), pp. 261–301, §1. Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 29 / 49
  • 30. Denormalization: cache data The main trick: repeat data to make it locally available, breaking functional dependency rules. You know have a cache. Implement Cache Invalidation. Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 30 / 49
  • 31. Denormalization example set season 2017 select drivers.surname as driver, constructors.name as constructor, sum(points) as points from results join races using(raceid) join drivers using(driverid) join constructors using(constructorid) where races.year = :season group by grouping sets(drivers.surname, constructors.name) having sum(points) > 150 order by drivers.surname is not null, points desc; Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 31 / 49
  • 32. Denormalization example create view v.season_points as select year as season, driver, constructor, points from seasons left join lateral ( select drivers.surname as driver, constructors.name as constructor, sum(points) as points from results join races using(raceid) join drivers using(driverid) join constructors using(constructorid) where races.year = seasons.year group by grouping sets(drivers.surname, constructors.name order by drivers.surname is not null, points desc ) as points on true order by year, driver is null, points desc; Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 32 / 49
  • 33. Denormalization example And now cache the results of the view into a durable relation: create materialized view cache.season_points as select * from v.season_points; create index on cache.season_points(season); When you need to invalidate the cache, just refresh the view: refresh materialized view cache.season_points; Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 33 / 49
  • 34. Denormalization example And now rewrite your application’s query as: select driver, constructor, points from cache.season_points where season = 2017 and points > 150; Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 34 / 49
  • 35. Other denormalization use cases Audit Trails History Tables Partitionning Scaling Out Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 35 / 49
  • 36. History tables and audit trails Another case where you might have to denormalize your database model is when keeping a history of all changes. Foreign key references to other tables won’t be possible when those reference changes and you want to keep a history that, by definition, doesn’t change. The schema of your main table evolves and the history table shouldn’t rewrite the history for rows already written. Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 36 / 49
  • 37. History tables with JSONB JSONB is very flexible, and can host the archives for all your database model versions in the same table, or for all your source tables at once even. create schema if not exists archive; create type archive.action_t as enum('insert', 'update', 'delete'); create table archive.older_versions ( table_name text, date timestamptz default now(), action archive.action_t, data jsonb ); Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 37 / 49
  • 38. Validity periods A variant of the historic requirement is to keep track of data changes and be able to use the value that were valid at a known time. Currency exchange rates applied to invoices is an example: create table rates ( currency text, validity daterange, rate numeric, exclude using gist (currency with =, validity with &&) ); Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 38 / 49
  • 39. Validity periods Here’s how to use the data from a known time in the past: select currency, validity, rate from rates where currency = 'Euro' and validity @> date '2017-05-18'; -[ RECORD 1 ]--------------------- currency | Euro validity | [2017-05-18,2017-05-19) rate | 1.240740 Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 39 / 49
  • 40. Denormalization Helpers: advanced datatypes Composite datatypes help with denormalization. It’s possible to keep several values in the same column thanks to them. Spare matrix becomes an extra field of jsonb type. Composite Types Arrays JSONb Enumerated Types hstore ltree intarray pg_trgm Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 40 / 49
  • 41. Partitioning Partitioning comes with demormalization trade-offs in PostgreSQL 10: Index are managed at the partition level No Primary Key, No Unique Index, No Exclusion Constraint No Foreign Key pointing to a partitionned table Lack of ON CONFLICT support Lack of UPDATE support for re-balancing Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 41 / 49
  • 42. Not Only SQL Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 42 / 49
  • 43. Schemaless design PostgreSQL includes several composite types (multi-value data). JSONb allows the implementation of schemaless design right within PostgreSQL. select jsonb_pretty(data) from magic.cards where data @> '{"type":"Enchantment", "artist":"Jim Murray", "colors":["White"] }'; Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 43 / 49
  • 44. NoSQL and Durability Trade-Offs PostgreSQL setup is made with GUC, or Great Unified Configuration. You can edit values in the postgresql.conf file, or dynamically change it in the session. Or in the transaction with SET LOCAL. Or have per-user or per-database settings. create role dbowner with login; create role app with login; create role critical with login in role app inherit; create role notsomuch with login in role app inherit; create role dontcare with login in role app inherit; alter user critical set synchronous_commit to remote_apply; alter user notsomuch set synchronous_commit to local; alter user dontcare set synchronous_commit to off; Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 44 / 49
  • 45. Automatic Per-Transaction Durability Setting SET demo.threshold TO 1000; CREATE OR REPLACE FUNCTION public.syncrep_important_delta() RETURNS TRIGGER LANGUAGE PLpgSQL AS $$ DECLARE threshold integer := current_setting('demo.threshold')::int; delta integer := NEW.abalance - OLD.abalance; BEGIN IF delta > threshold THEN SET LOCAL synchronous_commit TO on; END IF; RETURN NEW; END; $$; Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 45 / 49
  • 46. Horizontal Scaling: Sharding Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 46 / 49
  • 47. Five sharding data models and which is right? If you were here this morning you’ve seen Craig’s talk, so that’s about it. Sharding by geography Sharding by entity id Sharding a graph Time partitioning Depends. . . Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 47 / 49
  • 48. Denormalization and Sharding Adding the sharding key to every table is another case of duplicating information for maintaining a cache. Beware of database anomalies Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 48 / 49
  • 49. Questions? Now is the time to ask! https://2018.nordicpgday.org/feedback Dimitri Fontaine (CitusData) Data Modeling, Normalization and Denormalization March 13, 2018 49 / 49