TL;DR — An entity is really just an (UU)ID and don’t let anyone tell you different!
Part of a series
Previous article: Trust me bro.
Next article: Standing on business
Before we can continue on our journey of making sh!+ up, it’d be good to re-examine the central idea: entities.
In a regular database design course, we are introduced to relational databases. We learn that relational databases are composed of tables. What is a table? A table is a collection of rows and columns. What are columns? A column is an attribute that describes some aspect of a row. What is a row? A row is a collection of values.

A table which holds information about users in a system. Taken from here
This looks oddly familiar, if we were to represent it as a type it would look something like:
interface User {
id: number;
username: string;
role: string;
createdAt: Date;
}
So a row is kind of like an object, columns are the keys of the object and a single row in a table are the values of the object. What about entities? Entities are tables in DBA speak. Kind of makes sense. The higher powers who came up with the idea of relational databases tell us that to be able to access rows efficiently, we should also have a unique identifier we can point to so that we can find the row without searching through the entire table. Kind of like an index in a book, we look up a word and go straight to the page. In the case of the users table, that unique identifier is the id column of the table, every user gets a unique id which we can use to quickly grab their details. id is known as the primary key of the table users.
We also learn that tables in a database can have relationships to each other. A user might be able to create posts in a system:

Each user can create one to many posts. Taken from here
We see an id column in the posts table, users also has an id column… could it be? If you guessed: id is the primary key of posts and it uniquely identifies each row in the table, you would be right! We also see another row in posts: user_id . user_id is a reference to the user who created the post in users. It is known as a foreign key and it cannot uniquely identify a row in the table since the relationship between users and posts is one-to-many.