Learning Anytype: Database comparison

I’m just getting started with Anytype – coming from an outliner called Workflowy that I’ve used for about 10 years and with some understanding of databases.

I’m struggling to understand Anytype’s data model. I’m trying to compare Anytype’s glossary of terms to my understanding of a basic database. Is it fair (or useful) analog to understand the underlying structure?

Using databases as a form of reference, and using Anytype’s vocabulary, what are the Anytype terms describing the data base terms below:

Database Term = Anytype term?

Database = my entire Anytype file??
Table = ??
Record = ??
Field = ??
Relationship =
?? = “Block”

If this isn’t correct, it would help me learn Anytype if I could see a visual representation of the hierarchy of the Anytype model.

Apologies for such a basic question but understanding the data model as it compares to a database would help me learn Anytype faster.

Thanks for any help.

ScottC

1 Like

This is somewhat tricky but we can find some relations.

A table corresponds to a type. Just like tables with schemas in SQL.

And a record in a certain table would correspond to an object of that certain type.

Fields are every thing you put in the type template.

So for example. You created a type student with template containing 2 relations: Birthday and gpa.
Then created 2 objects of type student.

The type student itself is the table, while the 2 object are records in that table. Birthday and gpa are the fields in that table (also note any thing you write in the object itself is saved in it. As if all object have a field called body).

Relationships is a vague word. In Anytype you can call/refrence any object from any object. But Anytype relations can restrict this and only allow one object of a certain type(somewhat similar to foreign keys).

And I didn’t get what you meant by Blocks maybe you can elaborate it more?

Hope this helped.

1 Like

Thank you, Ahmed.

I think your reply will help. Check me below to see if I understand:

  • A table is a Type
  • A record in a Table is an Object in Anytype?
  • A field or attribute is a Relation. These are customize for the Type. The “relations” for a Human Type would be different that the ‘relations’ for a Book Type
  • In addition to these custom “relations”, all Objects have an invisible relation (a “body” relation that can store any free form text not specifically defined as a relation.
  • Tables can be linked to each other if they share “relations.” Is that correct?
  • Anytype documentation refers to “blocks”. How does that fit in with the database analogy — if at all?

I realize that some, probably most, people have little or no database experience but some verbal or graphic representation of the relationships would make it so much easier to learn how to use the product.

FWIW, in my opinion, even something as simple as a a collection of index cards would be a helpful analogy for non-techies and people trying to learn Anytype.

Thank you again for your thoughtful reply.

ScottC

1 Like

It’s how the body is created. the body is just a bunch of blocks.


No, types having the same relations are not linked. But a type can have a relation that only accepts objects of a certain type.
for example:

  • 2 types having the relation Birthday are not linked in any way(it’s just a date)*.

  • But imagine a type Job Application that has a relation Company that only accepts Objects of type Company this is similar to a 0 to 1 relation in a database context(A job Application can be linked to no companies or one company at max).


there is another way of linking that is not related to databases in any way. In the Body of a type you can press @ to open a menu that contains all objects in anytype and reference a one there. you will have a link to it from the body and they will be connected in the graph.


* = I lied a small lie: it’s true that 2 types having Birthday as one of their relations are not linked in any way, and their object will not be linked.
But, If you go to the relations section in the library in Anytype you will find that all relations have a record of what objects contains them, But again this is just a list and does not imply actual connection between Objects.

There is a topic that discusses terminology: Terminology and Concepts

I replied my interpretation of it in this reply:

Thanks to both Ahmed and Joeoen.

Just for fun, I think I’m going to see if I can compare AnyType’s terminology and data structure to a simple Index Card system. I think it would help me and possibly others like me who are struggling to organize Anytype’s vocabulary into a mental model that tells me / us how to do what we want to do in Anytype.

I’m sure that this would explain a lot of Anytype’s features / functions AND also show Anytype features that make if much better than an old-fashioned Index Card system.

I’m asking about the data model but I think I should be asking how to do specific tasks. Generally, I think a lot of the PKM systems spend too little time explaining how to do things people might want to do with the software and too much time explaining their data model which leaves the new user wondering how to do what they want it to do.

Thanks again for your replies.

2 Likes