Hi !
I’m designing a system to track Entities (e.g., projects, locations) and Elements (e.g., equipment, tools), where the same Element can be linked to multiple Entities—but each link needs to store custom attributes (e.g., a unique image, notes, or status for each Entity-Element pair).
Current Approach
I’m using a “join object” (inspired by relational databases) to represent the relationship:
-
Entity type: Represents the main object (e.g., “Project A”).
-
Element type: Represents shared items (e.g., “Tool X”).
-
EntityElement type: Acts as a junction with:
-
A relation to Entity (
LinkedEntity). -
A relation to Element (
LinkedElement). -
Custom fields like
Image,Notes, orStatusfor the specific pair.
-
Example:
-
Entity A + Element E → Image1, Notes1
-
Entity B + Element E → Image2, Notes2
Questions for the Community
-
Is this the recommended way to handle many-to-many relationships with custom attributes in Anytype, or is there a more native/efficient method?
-
Are there pitfalls or limitations to this approach (e.g., performance, usability) that I should anticipate?
-
How would you display these relationships on an Entity/Element page? I’m currently using relation blocks, but I’m open to better UX patterns (e.g., inline objects, sets, or templates).
-
Are there alternative setups (e.g., using sets, nested objects, or formulas) that could simplify this?
-
If Anytype adds native junction tables in the future, would this design still be compatible for migration?
Context
-
I need to avoid duplicating Elements or Entities.
-
The custom attributes (like images) are critical and unique to each pair.
Why I’m Asking: I want to ensure scalability and maintainability as my database grows. I’d love to hear how others have solved similar challenges or if there’s a feature I’m overlooking!
Thanks in advance for your insights
This question was drafted with the assistance of a language model to ensure clarity, as English is not my first language. All ideas and use cases are my own!