Hi there.
I have an interesting question that in one form or another has already been asked here, but as far as I know there is no definitive resolution that is accessible as a standard Joplin feature, that does not requires the user to rely on the OS-specific hacks or some Joplin-specific workaround, but feel free to correct me if I'm wrong.
In the interest of full disclosure, I am a Windows-OneNote user who is considering switching to Joplin and at least partially to Linux. I have not migrated yet, I'm only trying things out to see whether Joplin fits my needs and workflow.
My issue starts with something that many people are familiar with: I have a partition/SSD that I use for OS and applications, and then I have multiple other partitions, external disks and network drives where I store the data, so that at any point in time I could just drop the entire OS, format the disk and start with a fresh OS install, but with all of the data still being preserved. This particular concern can be somewhat addressed with backups or creating a Joplin profile that is not on a system partition, so it is not the most critical aspect that I want to focus on.
The other issue, and the primary reason I am asking this question, is the fact that I have few TBs worth of notes/data that simply cannot fit on a single SDD, and I have to split it apart. In my case, I have notebooks with lots of various media attachments (photos, videos, 3D models, diagrams, sketches, concept arts), so much so that a single notebook could be 10-50 GB in size, and 99% of that data are various attachments. And since I have few of such notebooks, my total notebook consumed space is about ~1.5 TB.
Since I am currently using OneNote, which is a file system based note-taking application, it is not that much of an issue for me, since I can store different notebooks and their attachments in different places.
- I have some notebooks that are stored on the secondary drive of my PC.
- I have some notes stored on an external drive that I carry with myself when I need to travel on work related trips.
- I have some notes that are stored on my home network drive (yes, I know it makes things slower, but the performance so far was more than satisfactory for my use-case).
This workflow, of course, runs into a problem when considering the fact that Joplin stores everything, both database with notes/metadata and resources/attachments in the same profile folder, which by default is located on a system/OS partition.
I have done a bit of a research, and there were a few questions/feature requests related to this already, like the few links below:
- Can you change the default Resources folder and move it to another partition?
- Choose where to store attachments - #4 by CalebJohn
- Can I Change the Database Location on Windows?
The problem that I have and want to address though is not particularly answered in any of these threads.
The suggestion of using a backup works, well, for disaster recovery and OS re-install cases, but it does not address the fact that I cannot fit all of my data on a single partition, nor the fact that I do want to keep most of the data in different places for performance/access/convenience/organization reasons.
The suggestion of using profiles with different locations introduces an inconvenience of having to switch between profiles, something that I would like to avoid, since I often have to lookup things stored in one notebook while I am working on something in another notebook. Using different profiles just to workaround the space limitations of a single partition seems like a very iffy hack, which I imagine would quickly turn into an annoyance, if only because I will not be able to run search queries across multiple notebooks stored in different profiles at the same time.
The suggestion of using soft links/junctions is too OS-specific, and since I'm slowly trying to partially (but not fully) switch from Windows to Linux, I would like to avoid using something that depends on OS features, and would prefer to have something that is a Joplin application feature that works both on Windows and Linux without having to keep playing with the file system or OS flags and settings.
So here is my question to the Joplin community. I am a developer, and one of the reasons as to why I am looking into Joplin as a potential replacement for OneNote, is the fact that it is an open source project and I get the ability to add the features that are missing in Joplin, as well as features that I never even had in OneNote in the first place, but I always wanted to. So I was wondering whether this is something that I can start with, and perhaps even contribute back to the community as well.
My thought was that while a fully-fledged solution for my particular problem might be quite a sizeable amount of development work, I could start with a simple solution first, that addresses some of the use-cases, and then slowly, over time, improve it so as to have enough flexibility for people to be able to tweak it to their own needs.
So my initial idea was to implement a feature (plugin or what not), that allows the user to specify a secondary location for resource files on a per-notebook level.
The idea is that by default, if nothing is specified, then the application will use the current default behaviour and look for resources/attachment in the profile folder.
If a notebook has a resource location specified, then the application will first look for a resource in that location first (in essence acting like an overwrite for a profile path), and if the resource is not found in that location, then it will look for it in the default profile folder.
If the notebook is a child of another notebook itself, then a recursive lookup could be done:
- First, look for the resource in the folder of specified by the child notebook
- Then look in the folders of the respective parent notebooks, using bottom-up approach through the parent-child hierarchy
- Then look in the default profile resource folder
This way the feature will not change anything in the current behaviour of the application for those who are not interested in this specific feature, but those who want to use it can opt-in into it.
I have not contemplated yet how this would work with sync across multiple devices, since I haven't investigate yet how sync works in Joplin (hence one of the reasons for asking this question so that more knowledgeable members of the community could chip-in with their thoughts). But the most immediate options that come to my mind are:
- Only notebook Resource Path is synched, so that an external resource location, such as a network drive, would be a singular storage for resources, and then all of the devices can access it, provided they have access to the same network.
- Allow the user to specify a different Resource Path for each notebook per device, so that you could have a notebook that, for example, uses an external drive for storing resource on one device, while the same notebook could store its resources locally when on a mobile device.
- Provide support for all of the above, and let each user decide which one of these two options he would prefer.
To a certain degree, this feature could be extended with an abstraction level, so that the external resource location does not necessarily has to be a traditional file system, and could also be something like an AWS S3 bucket or similar cloud storage, provided the necessary API exists to support what Joplin needs for its operations. And since we are on the subject, it might be possible to implement support of multiple external resource paths per notebook, and let the user mix his local drive, network drive and an S3 bucket for reads, and one of them for writes.
There are certain limitations to this implementation and the problem I am trying to solve with it.
It only addresses the location/size of resources and not the notebooks/database, which I think is fine for the initial implementation, and might be more than enough for some people to find it useful, in particular for cases when the attachments are the primary reason for the bloat in the size of the notebook. Based on the experience of implementing this version of a feature, and the feedback that might result from it, a more refined version could be implemented.
The loading of resources could be slower when they are not stored locally and are located somewhere remotely, be it a network drive or some cloud-based storage/bucket. But for some users the performance hit might be very well within their limits of what is tolerable and usable.
I do intend it to be an opt-in feature, meaning that if you do not need it, then you do not have to use it nor pay the size/performance/complexity price for it, everything will work as it did up until this point without you having to do anything, and you will not be affected by its implementation.
On the API level, there would be a need to implement an abstraction layer for resource operations, that would allow the entire Joplin codebase to be indifferent to this change as much as possible.
So what would the Joplin community thinks about such a feature? Any comments, suggestions, issues that you see?