SQLite3 implementation of CertMagic

Hi folks,

I’m learning more about Caddy and I saw an opportunity to build a SQLite Storage Backend.

I’d love some feedback or suggestions.

TODOS:

  • I still need to implement Lock and Unlock(yay, distributed locks).
  • I want to implement a docker build
  • I want to make the path configuration standard. (Default to ~/certmagic.db)
2 Likes

Hey, thanks for sharing Chrismar!

What is your use case for sqlite as a storage backend?

I don’t have a use case. I have used SQLite before and thought it would be a good challenge to learn how to build modules.

1 Like

Ooh exciting!! SQLite is the :honeybee:s knees :partying_face:

There are two things to consider:

  • Without WAL, SQLite supports single-writer-multi-reader. I believe locking might be able to leverage this.

  • Locks on NFS is broken, so that might impact any locking mechanism. It’s documented in SQLite’s FAQ:

https://www.sqlite.org/faq.html#q5

That said, I wonder how Litestream or LiteFS can affect this implementation :thinking:

1 Like

I had a look at the FAQ and you’re right about single writer. I dare say it could work in WAL mode as the FAQ doesn’t say otherwise.

I’ll look into LiteFS as it seems like they already did the heavy lifting of making distributed stuff work.

Thanks for the feedback!

2 Likes

This topic was automatically closed after 30 days. New replies are no longer allowed.