Wai Hon's Blog

Denote vs Org-roam

2022-11-27 #emacs #org-mode #pkm


Denote is getting quite popular in the Emacs community recently. I decided to give it a shot, learn how it works and see if I should migrate from Org-roam to it. I am writing this blog post to compares Denote with Org-roam.

In essence, Denote is a note-taking package for Emacs based on its file-naming scheme, which works for all kinds of files. Org-roam is a note-taking package for Org-mode, utilizing a database indexing org files.

Key Differences

Identifier and Linking

Denote uses the timestamp in its file-naming scheme as the identifier and uses its link type denote: for linking. This approach allows notes to be taken in other formats (.md and .txt).

Org-roam uses the ID properties as the identifier and the built-in link type id: for linking. It sticks with the Org-mode ecosystem. It utilizes an external database to indexes note metadata, like titles, tags, and locations and searching notes efficiently without parsing any org files. When working on multiple computers, the user might need to re-index the org files.

This is the biggest architectural difference between Denote and Org-roam. If all notes are written in Org-mode, I find Org-roam provides cleaner org files because it does not introduce a new link type.

Supported Formats

Denote works for all files. Not only can the user take notes in Org-mode, Markdown, or Txt, but also name a PDF file so that it could be identified, linked, searched and tagged.

Org-roam works for only Org-mode files. It leverages the mature Org-mode ecosystem. For example, the user can use org-attach to associate a PDF file with a note.

Frankly speaking, Denote is designed for Emacs users. Org-roam is designed for Org-mode users.

File-naming Scheme

In a file-based note system, it is inevitable to have coupling between the filename and the content (e.g., keeping #+TITLE: and file name in Org-mode).

Denote answers with its file-naming scheme and need to keep filename consistent and update-to-date so that search results remain valid after changing title or tags. Maintaining the naming scheme could become a burden without any automation. Denote provides denote-rename-* and denote-dired-rename-* for the job.

Org-roam does not enforce any file-naming scheme. The default org-roam-capture-templates uses the creation timestamp and title slug as the filename, and that is all.

Note that the Denote file-naming scheme has a limitation: cannot define a tag with multiple words. For example, the tag “note-taking” becomes two tags “note” and “taking” unless combining them to “notetaking”.

Searching Mechanism

Utilizing its file-naming scheme, Denote can efficiently search for a note by filename without parsing the content of the file. Users can search notes with titles and tags by prefix - and _ respectively. The out-of-the-box experience does not fit my need. Users need to write some emacs lisp or learn Dired to search efficiently.

Org-roam provides better out-of-the-box searching experience. With a little customization, I can search notes by folder name, title, and tags, recursively across sub-folders, sorted by the last modification time. This suits most of my needs.

It is nice to eradicate the dependency on a database with Denote. However, I found it hard to replicate the Org-roam searching experience with Denote, especially sorting notes by last modification time within subdirectories. Note that full-text search could be achieved by counsel-rg for both.

Denote Comparison to Org-roam



My Choice

It is tempting to eradicate the dependency on a database with a simple file-naming scheme. However, I am hesitant to introduce denote: to my org files and want to develop a searching experience that on is par with Org-roam first.

I decided to stick with Org-roam but keep exploring Denote in the next couple of weeks. Stay tune :-)