432
submitted 9 months ago* (last edited 9 months ago) by zef@lemmy.world to c/selfhosted@lemmy.world
you are viewing a single comment's thread
view the rest of the comments
[-] Nibodhika@lemmy.world 2 points 9 months ago

This looks awesome and exactly what I have been looking for.

One question about implementation just out of curiosity, is there any database? I'm worried that when it gets to hundreds or thousands of pages querying things becomes slow if it's just scanning files.

[-] zef@lemmy.world 5 points 9 months ago

Yes, it’s using SQLite under the hood in Online mode and IndexedDB in the browser in Sync mode.

[-] Nibodhika@lemmy.world 1 points 9 months ago

SQLite should be more than enough, I can't find the file on the space folder though, is it created inside the docker container on server startup? Is there a reason not to store it in space so it doesn't need to be regenerated each time?

[-] zef@lemmy.world 2 points 9 months ago

It’s .silverbullet.db in the root of your space folder. Note that because there’s no schemas in SB, SQLite is used as a fancy key-value store and many queries become somewhat (but not very) optimized table scans. In this SQLite file you’ll see a “kv” table that contains everything.

[-] Nibodhika@lemmy.world 1 points 9 months ago

I feel like facepalming myself to death for having asked such a stupid question before running an ls -a on the folder.

One last question, I've been reading on Plugs because there's one thing that I use regularly that I think doesn't exist and want to know if it would be possible for me to implement, it's called plantuml. Essentially it's a plug that would act on a specific block of code, like the latex one, and would use POST the code to a configurable url, get an image as return and display that instead.

[-] zef@lemmy.world 1 points 9 months ago

Yes this is doable, with the caveat that I have not invested a lot of time in documenting all the plug APIs etc. You can have a look at the mermaid plug to get a sense of how this can be done, it will be similar except that you — indeed — may end up having to post something to a URL somewhere rather than render the thing on-the-fly with a JavaScript library you load externally: https://github.com/silverbulletmd/silverbullet-mermaid

[-] Nibodhika@lemmy.world 1 points 9 months ago

Actually mermaid seems to be able to do all I'm doing with plantuml and syntax is very similar, might give that a try before since that one would also work in offline mode.

[-] zef@lemmy.world 3 points 9 months ago

That said, I have not tested this with hundreds of thousands of notes (I have close to a thousand myself). No performance issues there, but…

[-] Nibodhika@lemmy.world 2 points 9 months ago

I said hundreds or thousands, I don't expect to be creating hundreds of thousands of pages, but from your reply on the other thread SQLite should be more than capable of handling this scale.

Nice knowing that you have close to a thousand and it's still fine. It will take me a long time to get to that amount of pages, but if I can get started with this it seems like an awesome way of storing knowledge bases, so I expect it will grow quite rapidly as I migrate all of my different things into it.

this post was submitted on 11 Feb 2024
432 points (97.8% liked)

Selfhosted

40383 readers
363 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS