Skip to main content

Command Palette

Search for a command to run...

Data Modelling & Optimisation

Updated
5 min readView as Markdown

Ever wondered how apps like Zomato know your favourite cuisine, or how Netflix recommends shows you actually like? Behind the scenes, it’s all about how data is modelled, stored, and optimised. Let’s break it down.


What Is Data Modelling?

Imagine you're designing a city. You need to decide:

  • What buildings exist (entities),

  • What each building contains (attributes),

  • How roads connect them (relationships).

Data modelling is like city planning for information systems. It’s the art of visually organising data so developers, analysts, and business teams speak the same language.

Why It Matters?

  • Ensures clarity in how data flows.

  • Reduces errors in software and database design.

  • Improves performance and communication across teams.


Types of Data Models

Model TypeWhat It DoesReal-World Analogy
ConceptualBig-picture view of entities and rulesWhiteboard sketch of your app idea
LogicalAdds detail, no tech constraintsBlueprint with room sizes, no furniture
PhysicalFinal schema for database implementationActual house plan with plumbing and wiring

The Data Modelling Process

Let’s say you’re building a student portal:

  1. Identify entities → Student, Course, Instructor

  2. Define attributes → Student has Name, Roll No., Email

  3. Map relationships → Student enrols in Course

  4. Assign keys → Roll No. as primary key

  5. Normalise → Avoid storing the same email twice

  6. Iterate & validate → Review with devs and stakeholders


Types of Data Modelling Techniques

TechniqueDescriptionExample
HierarchicalOne-to-many tree structureCompany → Departments → Employees
RelationalTables joined via keysOrders table linked to Customers
ER ModelsDiagrams showing entity relationshipsVisualising a school database
Object-OrientedComplex relationships with inheritanceSocial media app with Posts, Comments, Likes
DimensionalOptimised for analyticsSales dashboard with Time, Product, and Region dimensions

Optimisation Tips

🔹 On the Data Side

  • Pull only what you need → Don’t fetch entire tables for one report.

  • Use correct data types → Avoid storing numbers as strings.

  • Clean the trash → Remove nulls, duplicates, and outdated entries.

  • Cache smartly → Speed up repeated queries.

🔹 On Refresh Schedules

  • Time it right → Refresh during low-traffic hours.

  • Let users trigger refreshes → Avoid unnecessary auto-updates.

  • Watch heavy datasets → Split or archive when needed.


Modelling Uncertainty and Risk

What Is Uncertainty and Risk?

Imagine you're planning a picnic. You check the weather forecast, but it says there's a 40% chance of rain. You’re unsure whether to go ahead or postpone. That feeling of not knowing what will happen? That’s uncertainty. If you decide to go and it rains, ruining your food and mood, that’s risk.

In technical terms:

  • Uncertainty is about unknowns; things we can't predict with full confidence.

  • Risk is about the chance of something going wrong and the impact it might have.

Understanding and modelling these concepts helps us make smarter choices; whether you're a doctor, investor, engineer, or simply someone planning a weekend getaway.


Types of Uncertainty

There are two flavours of uncertainty:

TypeDescriptionReal-Life Example
AleatoryRandomness that can't be eliminatedTossing a coin or rolling dice
EpistemicLack of knowledge that can be reducedNot knowing how a new medicine will affect you until more trials are done

Risk vs. Uncertainty: What’s the Difference?

Think of driving in fog:

  • Uncertainty is not knowing if there’s a car ahead.

  • Risk is the possibility of crashing into it.

Risk is quantified uncertainty; we try to measure how bad things could get and how likely they are.


Techniques to Model Uncertainty and Risk

Let’s explore some powerful tools that help us deal with unpredictability:

1. Probability Theory

This is the math behind chance. It helps us assign numbers to outcomes.

Example: If there's a 30% chance of rain tomorrow, you might carry an umbrella just in case.

2. Bayesian Models

These models learn and adapt. They update predictions as new information comes in.

Example: A doctor starts with a general idea of what illness you might have, but adjusts the diagnosis as test results come in.

Bayes’ Theorem: P(A|B) = (P(B|A)*P(A))/P(B)

This formula helps update beliefs based on evidence.

3. Monte Carlo Simulation

This technique runs thousands of random scenarios to see what might happen.

Example: A financial planner simulates different market conditions to estimate how your investments might perform over 10 years.

4. Decision Trees

These are like flowcharts that map out decisions and their possible outcomes.

Example: Should you take a job offer in another city? A decision tree can help you weigh salary, relocation costs, and career growth.

5. Scenario Analysis

This method explores best-case, worst-case, and most likely outcomes.

Example: A company planning a product launch might prepare for booming sales, average interest, or total flop and plan accordingly.


Where Is This Used?

Modelling uncertainty and risk isn’t just for scientists; it’s everywhere:

  • Finance: Predicting stock returns, managing investment risks.

  • Supply Chain: Handling demand spikes, avoiding overstock or shortages.

  • Healthcare: Forecasting patient flow, planning emergency resources.

  • Environment: Predicting floods, earthquakes, and climate shifts.


Whether you're choosing a career path, investing money, or managing a hospital, uncertainty is part of life. But with the right tools like probability theory, Bayesian models, Monte Carlo simulations, and decision trees, we can turn unpredictability into informed action.