Technical note

Data Modeling Fundamentals

The building blocks of data modeling — subjects, attributes, relationships, and business rules — and why the blueprint matters before the database does.

One of the first steps when working on any project that handles a large amount of data is deciding the structure and flow of that data. A good data model is a means to a good foundation for any project, whereas a badly structured data model can lead to a lot of chaos. Data modeling is the blueprint of any database — one doesn't build a house before finalizing the blueprint. Although a data model doesn't store any actual data, it provides insight into a project's data requirements, while also abstracting away from the database implementation.

History & Need of Data Modeling

Peter Chen, in 1976, published his paper "The Entity-Relationship Model — Toward a Unified View of Data," which marked the start of data modeling. This paper was published at a time when relational database management systems (RDBMS) didn't yet exist, which explains the need of the hour. Most data at the time was stored in mainframe and minicomputer file systems, and was often cryptic. Many files existed on tapes and punch cards as well, and data definitions were buried deep under layers of programs.

The Building Blocks of Data Modeling

There are four pillars on which data models are defined:

  • Major data subjects
  • Attributes of the data subjects
  • Relationships among data subjects
  • Business rules for the data

Although the blocks are self-explanatory, let's go over them.

Data Subjects — synonymous with "entities," "objects," or "classes," data subjects are the main characters of the database. For instance, "Student," "Teacher," and "Staff" are the data subjects of a school management data model.

Attributes — typically associated with data subjects, attributes define the qualities of the data subject. For instance, "Student ID," "Name," and "Class" are attributes that can be associated with a student data subject. There's also a multi-valued attribute in data modeling, used when a specific entity needs to store more than one instance of an attribute — for example, a student can have multiple email IDs that need to be stored. We generally use a double-circle representation in an ER model to represent this.

Relationships — as the name suggests, relationships define the connection between two data subjects. A teacher "teaches" a student is one such relationship. Interestingly, there are multiple kinds of relationships: unidirectional, like "teaches"; bidirectional, like "classmate of"; or even hierarchical, like the one between the principal, HOD, professors, and assistant professors. Multiple relationships can also exist between two data subjects — for example, a teacher can have both a "teaches" and an "is HOD for" relationship with a student.

Business Rules for Data — last but not least, there are different business aspects, rules, and guidelines to set for a data model. There are a number of questions to keep in mind while data modeling:

  • What will be the cardinality of the data model?
  • Is defining a relationship between data subjects mandatory or optional?
  • What permissible attribute values will be allowed?
  • What will the "data change dynamics" policy be?

Architectural Options

The classic ER model was an enhanced and extended version of Chen's paper on the entity-relationship model. The post-classic ER model, on the other hand, used Crow's Foot notation instead of the traditional ovals and diamonds. Although they differ in presentation, both data modeling specifications are semantically similar.

Overall systems modeling also has a category called semantic data modeling, partially developed by the US Air Force with the goal of a single, unified data modeling methodology. On the other side of the systems modeling equation, we have UML — Unified Modeling Language — with its roots in object-oriented systems, adopted by the Object Management Group (OMG). It's a general-purpose modeling language and notation for software engineering.

Notations to Keep in Mind

What we're trying to conclude here is that we want to get data modeling as close as possible to the real-world case, and avoid being constrained by things like the rules of relational database management systems.


Follow along on my journey as a tech enthusiast on Instagram.

← All writing