What does Entity means?
As Merriam Webster mentioned:
Definition of entity
1 a : being, existence; especially : independent, separate, or self-contained existence
b : the existence of a thing as contrasted with its attributes
2 : something that has separate and distinct existence and objective or conceptual reality
3 : an organization (such as a business or governmental unit) that has an identity separate from those of its members
By this definition try to imagine a world made of Entities. As we know:
- Artificial Neural Network is made of neurons
- All of humans, animals and plants is made of cells
- All of thing in this universe that categorized as matter, is made of atoms
Every thing that could be visualized as a thing, it can be defined as small units that I call it Unit or Cell. but when we add independence characteristic to this definition, I call it Entity.
When we think Entity as a unit for all of things, we should design it expandable to make it more scale-able for extending and developing software architecture. As you can see in figure 1 this unit is made of 6 tables:
- Entity Meta
- Entity Relation
- Entity Relation Meta
- Entity Status
- Entity Type
Now the question is how to define relation between these Entities?
In this model I prefer to use Entity structure for Joined Entities (Entities Relations).
Entity Relation Structure is made of a single Entity that includes some extra fields (as Foreign Key).
A Joined Table (Relation1 in figure3) for messaging service includes 3 extra fields added to Entity structure.
|Message||User (From)||User (To)|
The Entity structure of Table Relation, make it easy to take a role like Entity and be able to be joined with another Entity or Joined Table.
Another Authentication example with more detailed information: