I remember the first time I purchased items from an e-commerce website - A 32GB flash drive, a boombox and a tripod - I did it with my phone. Pop-ups, redirects, eternally loading pages, having to type my card details and all those triggering experiences. However, nothing trumps the anxiety of waiting for the items to be delivered immediately after payment. I know you can relate. π
I didn't quite understand the process, but the website was functional. I got my items delivered as scheduled. They looked nothing like what I paid for on the website. Yes, you are right! The no return, no refund policy. I couldn't return the items or get a refund. Moreso, replacing them would have been such a drag. I just had to keep them. π€·π½ββοΈ
I'm a junior backend engineer now, and I appreciate the thought and work put into creating these applications.
Apps have complex systems that comprise different entities interacting with one another.
Think about how your favourite e-commerce platforms process millions of orders from millions of people around the world by the second. Crazy, right?! These operations are so effective that users trust and recommend them to others.
Software engineers have to visualize the entities involved using an Entity Relationship Diagram or Model to implement these complex features.
What is an Entity Relationship Diagram?
ER Diagrams are used for relational database design to illustrate how entities and their attributes interact within a system.
How it Started
Many principles we apply today can be traced back to the works of Aristotle. Nevertheless, some brilliant minds have made their marks in the world of technology.
In 1976, Peter Pin-Shan Chen published a seminal paper titled "The Entity-Relationship Model: Toward a Unified View of Data." He is renowned for creating entity relationship modelling for database design. James Martin, the Father of CASE, added ERD refinements.
The Computer-Aided Software Engineering (CASE) process helped automate defining a data dictionary directly from the description of a business process. This automation marked a milestone in modern business software engineering.
Components of an Entity Relationship Diagram
- Entity: This includes anything that you can define. Think of nouns like people, products, events or anything with data.
Entities can be in types, sets, or categories. For example, electronic appliances would be an entity type. Entity sets are like entity types but also include an element of time. An example could be the iPhones ordered yesterday.
- Relationship: This refers to how entities interact with one another. Think of relationships as a verb. Take for instance, users signup for newsletters.
- Attribute: This refers to the data that qualifies the entities. For example, name, age and phone number. Think of attributes as adjectives.
- Cardinality: This represents the numerical attributes of the relationships between entities or entity sets.
How To Draw a Basic Entity Relationship Diagram
1. Purpose
Understand the purpose and scope of the system you intend to design.
2. Entities
Enumerate the entities involved. Map them out in different rectangles as you see fit.
3. Attributes
Factor in more details by adding attributes of the entities.
4. Relationships
Consider the relationships within your system. One way to do this is by answering this question, what does the ___ do with the ___? The customer purchases the car. The student signs up for the newsletter, and so on.
5. Cardinalities
The notations help your ERD reader to understand the interactions between the entities. At a glance, they will know if there are zero, one, many, or some combination of those interactions.
Image Source
6. Save
You can save and export the file.
Image Source
Now, I am beginning to understand what happens when I use applications. I am most definitely less critical. π
Happy coding! π€
Top comments (4)
Great article! ERDs are often neglected but can be so useful for new developers working on a project. There are tools out there to automate their generation from your database or schema definitions!
Thank you, Adam. π
Yes, there are tools to do just that. Great times we live in. π―
Really great write-up.π
Thank you, Z