Arrow icon
Ness Labs: Make the most of your mind
Learn more about Joggo

A Summary of

Architecting an Intuitive and Powerful Offline Experience in Notejoy

by
Sachin Rekhi
View original

Collaborative Note Taking and Online and Offline Services

Most services are either online-first or offline-first. - Online-first services provide incredible features online, but offline usage is often a chore  - Offline-first services work smoothly offline but syncing/merging is a headache and they have limited online features

Notejoy

Notejoy is a collaborative note-taking app designed for individuals and teams. - When adding offline support, Notejoy aimed to develop a compelling offline experience without compromising on the features that online-first provides, and with the aim of developing offline support such that it speeds up online experience

Seamless Online/Offline Experience

  • Online/offline seamlessness is facilitated in browser mode through service workers, which allows Notejoy to get network resources from the web when online and from a local cache when offline
  • Notejoy uses a combination of API and web socket calls to check whether the user is online
  • A minimalistic notification is provided when a user goes offline in an effort to not interrupt their experience

Accessing and Editing Notes Offline and Online

Notejoy stores data in three locations: in memory, in a local database, and on its servers. - The in-memory state and local database storage are managed independently to ensure a minimal memory footprint and superior load performance - Due to variable local database access times, Notejoy first checks in memory when loading a note and then asynchronously checks the local database and server

Merge Conflicts

Notejoy also has to deal with different types of merge conflicts since multiple people could be working on the same note. - For edits that have yet to be loaded from the server, the version number is used to load the most up-to-date version automatically - If there are pending local changes, these are automatically pushed to the local database and server if they do not have a newer version - Offline edits to notes are updated in memory and in database immediately - Whenever the user goes online, pending in-memory changes are sent - If there are pending local changes and the version in the database or server is newer, a flag is displayed to the user to tell them that a newer version of the note is available

Related content
See all posts
Arrow icon