Re:The data model behind Notion's flexibility
by jitl on Tuesday May 18, 2021 @05:57PM
(#27201809)
We don't use JOIN for the content tree; I don't think I've seen one in any of our queries.
[ Parent
| on HN ]
Re:The data model behind Notion's flexibility
by RyanGoosling on Tuesday May 18, 2021 @06:26PM
(#27202091)
What do your queries look like? Are you using an ORM?
We don't use an ORM. Notion's codebase on the back-end is much more functional than object-oriented, in the sense that we have many more code that looks like `transformTheData(theData, theChangeToMake): ResultingData` than we have classes or methods.
We do lean very heavily on the TypeScript type system and try to make invalid states unrepresentable.
Re:The data model behind Notion's flexibility
by bionhoward on Wednesday May 19, 2021 @08:56AM
(#27207904)
have you tried "data last" FP like `transformTheData(theChangeToMake, theData): ResultingData` instead? I learned this from Ramda.JS, makes it way easier to leverage currying, ex `change = transformTheData(theChangeToMake); change(theData)`