Hello.

My name is Stephen.

I like to write and tweet.

I work, code and photograph.

Learn more about me and my blog.

The Beauty of Notion

I researched thoroughly how Notion works behind the scene, and put together this report into Notion's data model that powers its impressive functionalities and intuitive UX.

You can also view this report in a nicer format, with examples, in Notion itself.

Introduction

This guide is a culmination of 4 weeks of research I did after falling in love with Notion. As a software engineer, I'm always curious about how an app works. Notion's impressive functionalities and intuitive UX captivated me, so I decided to learn it from first principles and document it publicly.

This guide assumes you know Notion's functionalities and are curious about how they work. This guide also assumes you have a basic understanding of a data structure.

Let's get started.

Blocks

The core foundation of Notion is built on the block model. If there's one thing to take away from this guide, it's how the block model works.

Text, headings, bullet list items, pages, embeds, a row in a database, an item in a Kanban board, etc. are all blocks. Blocks can contain other blocks, which form a hierarchy. Let's illustrate with examples.

Block attributes

Block operations

Styled text

Rich text

Block ID

Block types

Block hierarchy

Block types & attributes

Media

Embed

Code

Table of content

Collections and Views

Collections and views give blocks superpowers. They allow you to create and see blocks in a structured way.

When you add a database, a collection is created. The chosen view is also created. A collection provides the schema for the blocks. A view defines how to query and display the blocks.

Let's again illustrate with examples. We will first look at the data structure of a collection. Then we will examine the data structure for a page in the collection (hint: it's just like any other page blocks.) Lastly, we will take a look at the data structure for the five different types of views.

Collection

Block in collection

Table collection view

Board collection view

Calendar collection view

List collection view

Conclusion

Hopefully, this guide gave you a glimpse into how Notion works, why its data model is so elegant and flexible, and how some the impressive functionalities and intuitive UX get built.

The flexibility does come with its downsides. Because you have so much freedom, you may end up spending more time optimizing their setup better rather than doing actual work. Often times, constraints are a good thing. Additionally, because there are so many things you can do to its data model, Notion relies on the client code not to break things. This is why releasing an API can be hard because such safeguards need to be in place.

With that said, I have not been so excited about a piece of software since Slack came out. Let's see where Notion heads next.

Future Works

I've only scratched the surface of what Notion can do. The fact that there is plenty more to cover shows how powerful Notion is. Future additions:

Feature Suggestions

In my opinion, there are two types of blocks that will make Notion even more powerful - a form block and a backlink block.

A form block can be used for surveys, applications, and polls. Notion already has the building blocks for this. Each form will connect to a collection, so the type of each field can be inferred automatically. A user can choose the order, visibility, and required-ness of each field. Submission turns into a page in the collection, with an additional Submitter person field. I can see many potential use cases - a survey for customer research, an application for job applicants, a poll for Q&A, etc.

A backlink block can be used to see a list of pages that link to the current page. This is powerful because you can view all related knowledge to the current page. Backlink is why a lot of people switch to Roam. Technically, this requires storing back links to the current page, which I don't think Notion does right now. This can be achieved by creating a map from page ID to a list of block IDs that link to page ID. When a user links block A to page B, add block A's ID to page B's list. To render the backlinks for a page, simply grab the backlink block IDs and display the title as well as the closest parent page block for context.