Ok, then the promised context to this question. As you know I’m always on the hunt to remove features and simplify SilverBullet to keep the project manageable in terms of scope. Those who have been long-time SilverBullet users may remember that the first version had a two modes (similar to what we have now), then a second iteration which completely removed the “Online” mode: that is, it always synced all your content locally and operated fully in-client without much use of the server (beyond syncing content). Then, later, the pendulum swung back and I added an Online mode again. We’re getting closer to SilverBullet 3 year anniversary, so perhaps it’s time to swing the other way again
I’m now investigating what the impact would be to remove Online mode, so let me lay what we would lose and what we would gain.
What we would lose
The “in-and-out” edit use case
Beside being an interesting technical challenge to solve, one reason to (re) introduce Online mode was to better support the use case of “Oh, let me just quickly login to my notes on this foreign device to make a quick edit.”
With Sync mode only, this could be quite painful, because basically any new client first needs to perform a full sync to become fully operable. If you have thousands of pages, or lots of attachments, this could take a lot of time. There’s some optimizations to consider here, like not syncing attachment, or lazy syncing them. However page content always would need to be synced to make sure the indexes (and with that query results) are going to be complete.
The question is: do people actually do/need this? In practice, I never do. I access my SB on my phone, on my Chromebook/tablet and on my desktop. All in Sync mode. The initial sync takes some time, but after that I’m all good.
Support for huge spaces
Related to the previous point: if you have a massive space, think many tens of thousands or more pages, sync mode may not scale. I have 1400 pages in my space and everything works perfectly fine for me, but I’ve heard people who try to use spaces with tens or hundreds of thousands of pages, syncing all that content to every client may not be practical.
The solution? People would have to trim down their space, or split them into multiple.
Server-side indexing
The second advantage that I can think of (although it’s not heavily used) is that if indexing of your space becomes a heavy-weight operation (like for instance, when you try to do things like generating embeddings for retrieval with LLMs, like @justyns is doing) you’d have to redo that embedding generation for every single client, whereas when you’d use (only) Online mode, that indexing happens once on the server and that’s it. Note that currently this point is moot if you use some clients in Sync mode, those clients would also need to perform this expensive indexing on their own.
Custom HTTP endpoints (niche)
The third thing we’d lose, although I also don’t think this is heavily used, is server-side custom endpoints, see: Space Script
What we would gain
No more client modes
The existence of two client modes is a common source of confusion and it’s hard to explain the trade-offs between the modes. It also adds UX overhead in that there’s this ever-present Sync button up top.
By removing Online mode, this would be simpler: you login to SB, your content syncs and everything is available, also offline. No need to think about it.
I suspect that a lot of people don’t use Sync mode because they don’t know it’s there or understand what it is, or simply forget to hit that button. The result is that they will actually get worse performance, because Sync mode is actually significantly faster in day-to-day operation (because there’s far fewer round-trips to the server). The effect would be that those users would just get a faster experience, because they’d be forced into Sync mode.
Technical simplicity
This may not affect you all, but it does those who work on SilverBullet, its plugs, and those who use more advanced features like Space Script. It’s often not super obvious where code will run: on the server? On the client? Will it work the same? Why is this syscall available here, but not there? By removing Online mode, the answer would be simpler: everything runs in the browser, you always have access to all syscalls. Done.
It also reduces QA effort. I spend a fair amount of time testing changes ensuring they work both in Online and Sync mode, and although it’s pretty rare there are inconsistencies, I still need to do that testing every time.
There is a fair amount of infrastructure and code that enables the flexibility of having logic be able to run both in the browser and on the server. As a technical feat I’m actually quite proud of how well this works, and doesn’t require all that much maintenance, but every line of code is another source of bugs.
If we eliminate Online mode, the server component would become super simple: basically a dumb data store, all it will do is serve up and store files, all the interesting stuff happens in the client.
This also opens the door to perhaps rewriting the server to run on node.js again. I’m fairly happy with Deno, but for many people it’s a bit of a barrier to contribute because it’s a bit of a niche JS runtime.
What would become easier
There are a few areas that I haven’t really pushed into, because they would be quite hard to tackle. By eliminating Online mode these doors would re-open:
- End-to-end encryption. With this feature, you would no longer have to assume a trustworthy server. The server would just store encrypted binary blobs. Even if your server gets hacked, nobody would be able to decrypt your content without knowing the key. This would always be an optional mode, because it would limit certain features.
- Multi-tenant and SaaS hosting options. Right now you can only host a single space on a single SilverBullet instance. I spent some time in the past trying to make SB multi-space and multi-tenant capable, but would run into issues of security, especially if people would start to host plugs and space scripts outside their direct control. However, since removing Online mode would make the server more of a “dumb block storage” it would actually be way easier to scale. Even offering SilverBullet as a hosted SaaS would be on the table.
Opinions?