TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The data model behind Notion's flexibility

338 pointsby pspeter3about 4 years ago

22 comments

gumbyabout 4 years ago
Not sure how &quot;unique&quot; this model is; for example Claris Works was built out of an even more powerful block model (they called them frames) back in the late 1980s:<p>&gt; We came up with a frame-based approach. Most of the functionality particular to the various application types was packaged up into &quot;frames&quot;: word processing frames, graphics frames, etc. These frames were then used as building blocks to make documents of the appropriate types, in a unified programming framework. E.g., a word processing document was essentially a bunch of text frames, one per page, linked together. (Doing this neatly was a big challenge - many subsequent efforts at building a component-based architecture (e.g. OpenDoc) have failed to take into account the top-level user interface requirements.) The result was that not only was most of the code shared across the document types, but the application was also truly integrated - the frames could be embedded in each other. E.g., you could plop a spreadsheet frame right into your word processing document. Text objects in a graphics document had a full-featured word processing engine behind them. The database form editor used the built-in graphics environment. Etc.<p>&gt; One related cool thing we had was a &quot;shared graphical context&quot; mechanism: sometimes, stuff would wind up being displayed in multiple frames at once. E.g., maybe you&#x27;re dragging an object across a page break in a document with multiple pages (like this). We developed a general architecture for displaying actions live in multiple contexts. Of course, a lot of this kind of stuff is old hat today, but it was new and exciting in 1989. Some creative programming was required to do these things efficiently on the hardware of the time.<p>&gt; There were some cool features that didn&#x27;t make it into the shipping product. For example, originally spreadsheet formulas were much more powerful: you could relate, e.g., graphical object positions and document properties to spreadsheet cells. So you could have the result of a calculation move objects around graphically, or vice-versa. (Further work in this direction led to a novel constraint-based programming paradigm called MOOSE, which I may resurrect some day...)<p>(From <a href="http:&#x2F;&#x2F;groups.csail.mit.edu&#x2F;mac&#x2F;users&#x2F;bob&#x2F;clarisworks.php#onourown" rel="nofollow">http:&#x2F;&#x2F;groups.csail.mit.edu&#x2F;mac&#x2F;users&#x2F;bob&#x2F;clarisworks.php#on...</a> )<p>I&#x27;ve been kicking around the idea of writing a CRDT-based editor using this model.
评论 #27202694 未加载
评论 #27205752 未加载
评论 #27204211 未加载
评论 #27206854 未加载
评论 #27206684 未加载
fellowniusmonkabout 4 years ago
I&#x27;ve not used notion before and this is a great write up...<p>Having built my own private-ish collaborative editor&#x2F;note&#x2F;todo&#x2F;sharing&#x2F;pm tool back in 2012 (that uses indent level permissions) I don&#x27;t see how you could have a non &quot;block&quot; implementation?<p>I also don&#x27;t see how they are having so much performance difficulty moving up the inheritance tree at the client level?<p>Does anyone else who has worked on these kinds of problems take a different approach? This being HN and a space I develop in I am actively curious if any other architecture are in use generally?<p>Are there approaches outside of blocks for tools with this level of granularity?<p>Really cool of Notion to share these kinds of &quot;inside ball&quot; deep dives.
评论 #27201000 未加载
评论 #27201190 未加载
评论 #27203591 未加载
评论 #27204248 未加载
poloteabout 4 years ago
Notion is clearly a feat of engineering. The first time that you modify a link name, and it is automatically modified in all others connected users whether it is in the menu, inside a document or wherever it is. You are just impressed. You can also drag and drop links from a document to a menu.<p>I&#x27;m just worried that so much engineering complexity is going to make things slow to move. We will see in a few years if that was a good idea or not
评论 #27202549 未加载
georgewfraserabout 4 years ago
Salesforce and JIRA both did something similar: their underlying database schema is very generic, basically keys and values, allowing arbitrary logical schemas to be defined at runtime. Yet in both cases, they ended up not really taking advantage of this flexibility. The logical schema of both systems is a very ordinary relational schema that could have been implemented directly on the database, with much better performance. I wonder if the Notion developers made a serious attempt to build on top of a more conventional structured schema, and found it really was unworkable?
评论 #27203016 未加载
mattwadabout 4 years ago
Been working with multiple document API&#x27;s recently for my start-up. It&#x27;s been a real challenge to understand how different document stores compare -- Confluence uses undocumented XML markup that &quot;mostly&quot; mirrors HTML, Google Docs gives you sometimes semantically-incorrect HTML with lots of inline styles, Slack has its own funny Markdown, etc. Then there&#x27;s Notion blocks. I had to write my own HTML-to-Notion block parser, but I think I prefer working with it over everything else because structured data is just easier. One interesting gotcha: if you want to completely overwrite a page you currently have to remove every content block one at a time, and then add each new line one at a time. This is using their undocumented API, but the new API doesn&#x27;t even offer deleting content yet. I&#x27;m eager to switch over but it may be a while...
评论 #27203527 未加载
jonpurdyabout 4 years ago
This is a great explainer on how and why Notion is so powerful, and certainly helps explain why it doesn&#x27;t feel like the fastest tool (because it&#x27;s inherently more complicated and more powerful than most).<p>I&#x27;ve tried using it for personal notes but it&#x27;s speed and lack of offline prevented me from migrating to it. But I think it&#x27;s the best choice for any organization that needs a collaborative docuement&#x2F;wiki&#x2F;Confluence-esque tool.<p>Not to mention that I think it has the best default fonts, spacing, and general aesthetic of any tool I can think of.
评论 #27201182 未加载
rkangelabout 4 years ago
Notion clicked for me when I realised that everything is a &quot;page with some attributes&quot;. Blocks are interesting at the engineering level, but as a user I found I was normally thinking at the level of pages.<p>Each page is some content (optional) with a set of arbitrary attributes of different types, e.g. date, string, number etc. When you create a table and populate it, you are creating a set of pages all of whom have the same attributes and the table is just a view of those pages. You can then create a calendar that&#x27;s a different way of presenting those same pages. You can also deal with those pages directly and put content in, and reference them from elsewhere.<p>It&#x27;s a really simple data model, and it&#x27;s pretty flexible. We built all our processes on Notion initially and then moved them off when they got to an appropriate scale. I&#x27;m glad the API exist now, because then that approach can be incremental rather than a wholesale move. All the ways of displaying things - tables, calendars etc. are just displaying collections of pages.
评论 #27201907 未加载
jerrygoyalabout 4 years ago
As author of a Notion browser extension, &quot;everything is block&quot; concept made it significantly easy to understand the notion doc structure and tweak the UI to add multiple customisations on top of it. For instance showing a fixed static ToC, etc.<p><a href="https:&#x2F;&#x2F;gourav.io&#x2F;notion-boost" rel="nofollow">https:&#x2F;&#x2F;gourav.io&#x2F;notion-boost</a>
fredleyabout 4 years ago
I think the power of Notion became apparent to me when I created a Page, accidentally changed it to some other type, then ctrl+z-ed it back to a Page, with all its contents intact. Seriously impressive. I wish search wasn&#x27;t so crap though.
评论 #27202006 未加载
jitlabout 4 years ago
Author here. I&#x27;m happy to answer any questions you might have.
评论 #27201207 未加载
评论 #27203584 未加载
评论 #27204261 未加载
评论 #27201013 未加载
评论 #27201441 未加载
评论 #27200985 未加载
评论 #27200946 未加载
paulsutterabout 4 years ago
Notion is great for about a month, then the glacial performance and forced-hierarchical structure really start to grate. But by that time you’ve already bought it
throayobviouslabout 4 years ago
Notion is cool but I went back to trello because its so damn slow. The ios app would refresh all the time and fail to sync. The web app was generally buggy.
posharmaabout 4 years ago
Am I the only one who thinks the data model is very complex? How does it compare to a document based data model? What are the pros and cons of each?
评论 #27202578 未加载
renke1about 4 years ago
It&#x27;s always nice to learn how tools implement this. Especially interesting to me, because I am currently working on a similar tool, although more focused on the plain text aspect (think Markdown + widgets). I am facing slightly different challenges because widgets have to live in a plain text context. For instance, having a widget (say interactive diagram) as part of a Markdown blockquote. On the other hand I don&#x27;t have to deal with nested blocks (yet), because regular Markdown elements are just text (with fancy styling though). Another challenge is something like $a+b=c$ where it is shown as rendered LaTeX when the user&#x27;s caret is not touching that part of the document. Also, contenteditable is hard.
abraxazabout 4 years ago
Is there a reason why you did not use rdf for representation and some rdf aware encoding like jsonld for serialization?<p>Would be significantly easier for others to work with, could easily query it with SPARQL.
评论 #27202742 未加载
wdbabout 4 years ago
I used a similar approach when working on an editor&#x2F;notes taker in Flash. Worked quite nicely but even back (early 2000s) then it wasn&#x27;t really a new idea.
victor106about 4 years ago
Great write up.<p>I have a requirement to allow users to create adhoc tables within a web application. I was wohoe beat to represent this on database. Any thoughts?
评论 #27204624 未加载
hayriabout 4 years ago
A graph is so natural for pages, web pages are graphs too. So they choose a well fitting model for the problem, congrats
julienreszkaabout 4 years ago
The webpage crashed as soon as I opened it. No idea what happened exactly.
m_muellerabout 4 years ago
you start a blog post with Engelbart, Nelson &amp; Kay and you have my attention. At last someone who understands where the whole field of digital HID was started.
louisvgchiabout 4 years ago
I liked the part where they talked about the blocks with the blocks and the block blocks and how they all block together.<p>I thought the reference to field pioneers was a bit much, I wouldn’t have the blocks to do that with a straight face. I wish these app makers (see also Figma, AirTable) would refrain from making their self-aggrandizing “we’re bringing computing to the masses”; what a load of blocks. What you’re doing is creating a product (another silo in waiting) serving a market that presently is interested. This block model is also not unique (see WordPress and Drupal): Notion may be refining some of that in a more seamless experience, but this is a different kind of statement. Perhaps “we added collaboration to blocks” would be a possible claim for uniqueness.<p>Aside from this, I found the technical decisions interesting and worth a read.
评论 #27201814 未加载
评论 #27202078 未加载
ano88888about 4 years ago
I tried notion several times and gave up. It is not as good as excel or google sheet. I want the data table view to be as powerful and efficient as google sheet or excel plus other notion views. Right now, it is very difficult to even style the the cells with different colors. I think it will be much better for existing google sheet to add other notion functions. Don&#x27;t know why google stops innovating.
评论 #27204341 未加载