Skip to content
All projects

Big Data

healthcare data warehouse

A data warehouse for a fictional hospital group, fed from a care database and public files. Its storage is designed around the questions it has to answer.

  • 25

    million death records integrated

    A file of nearly two gigabytes, read by an automated job: no surname or first name comes out of it.

  • 9

    sources brought together

    Three tables from the care database and six files, written to HDFS by a single Talend job.

  • 7

    analysis needs tied to a job

    Out of the 8 needs set by the brief, according to the second deliverable.

Setting
Academic, CESI, Big Data module
Period
April 2024
Team
Four
Client
Fictional: a hospital group
ChapterProblemContents
  1. Problem
  2. Constraints
  3. Architecture
  4. Decisions
  5. Deliverables
  6. Limitations and lessons learned

Problem

Monitoring care activity

The group wants to track its consultations, its hospital stays, patient satisfaction and mortality. All it has are separate sources: a care database, national registries, surveys, a death registry.

The brief sets eight analysis needs, from the consultation rate per facility to satisfaction by region. None of them can be met without combining several sources: it takes a warehouse that brings them together.

Constraints

Sources that look nothing alike

  • Different formats and identifiers. A PostgreSQL database of 13 tables for care; the national registries of facilities and practitioners; the death registry; satisfaction surveys from 2014 to 2020, as CSV files and spreadsheets.
  • A volume no spreadsheet can take. 28.4M rows of source data, 2.12 GB in all.
  • Personal data. The death registry holds surname, first name, date and place of birth, and the module requires processing that takes GDPR into account.
  • An imposed environment. One Cloudera virtual machine per student.

Architecture

The path of a record

Talend jobs write the sources to HDFS, and Hive exposes them as a star around the consultations. Follow one record.

Two records written for illustration

A consultation from the care database. Stored in its diagnosis partition, ready for the query.

The sourcesSort and storeServe the needsfirst, last nameplaceof death“a consultation”“the deceased's name”Partition Hive
The sourcesSort and storeServe the needsPartition Hive

PartitionHive

The fact table is rebuilt partitioned by diagnosis, with its patients spread across five buckets.

Example written for the illustration.

From needs to jobs

The eight needs are those of the brief; the link to the jobs is the one in the second deliverable.

  • Consultation rate per facility, over a period: consultations, patients, facilities.
  • Consultation rate per diagnosis, over a period: consultations, diagnoses, patients; fact table partition.
  • Overall hospitalization rate, over a period: patients.
  • Hospitalization rate per diagnosis: diagnoses, patients.
  • Hospitalization rate by sex and age: no job tied to it explicitly in the deliverable.
  • Consultation rate per practitioner: consultations.
  • Number of deaths by region, in 2019: deaths, then the join to municipalities.
  • Overall satisfaction by region, in 2020: satisfaction.

Decisions

Storage designed around the questions

Five decisions and what settled them
DecisionOption ruled outWhat settled it
A data warehouseA data lakeThe sources are already structured. Compared on performance, security and cost, the warehouse serves analytical queries better.
A star schemaSnowflake; constellationA query goes through fewer joins, and the model stays easy to maintain. The storage redundancy is accepted.
Partition by diagnosis, bucket by patientA flat fact tableThe layout follows a named need: consultations by diagnosis, over a period.
Processing inside the Talend jobsProcessing inside the visualization toolA change of course between the two deliverables: each job is tied to the needs it serves.
Managed Hive tablesExternal tablesHive then controls the data lifecycle.

Deliverables

What was delivered, from modeling to tables

The project has no measurement that proves a gain: what is established is what was delivered.

  • Reference model Data dictionary, conceptual model following Merise, then a logical star schema.
  • Jobs A main job that writes the sources to HDFS, and a job that joins deaths to municipalities.
  • Physical model A Hive database loaded from HDFS and checked with a query on the diagnosis table.
  • Optimization The fact table rebuilt with partitions and buckets, then queried in Hue and monitored in Cloudera Manager.

Limitations and lessons learned

Change one thing at a time when measuring

The deliverable's measurement, and why it proves nothing

Times read off Cloudera Manager graphs, one run per query, loaded volume not documented.

  • Full read, same query on both sides, over 3.5 s flat and over 3 s partitioned. These are two lower bounds, and no gap is shown.
  • Filtered read, two different queries: over 1.8 s flat, filtered on patient and practitioner; 0.4 s partitioned, filtered on patient only. Not comparable.

Those two times do not measure the effect of partitioning: I publish no gain from them. It would have taken the same query on both sides, filtered on diagnosis (the partition key), with the number of rows loaded recorded alongside each measurement.

The main jobs select columns, with no cleaning or deduplication. The practitioners file stops at 1,048,576 rows, the limit of an Excel sheet: it was most likely truncated on its way through a spreadsheet, and nobody noticed. A row count at every step would have shown it.