Closed gedw99 closed 5 months ago
First of all this is really cool to know that this exists. Thanks for taking the time to look at this little project of mine. There sure are some super smart people in this space.
I agree with you that this is the way to go for scaling and loadbalancing pocketbase but I feel that this falls outside of the scope of this package. I primarily use Pocketbase for vertical scaling as most of the work I do with Pocketbase isn't time sensitive therefore I wouldn't need to use something like Marmot.
That being said I am very interested in exploring and building a solution like this should the need arise and would love to work with you to build it just probably not in the scope of this repo. I feel like it may need its own. What do you think?
Yeah I am open to working on it in another repo. I think it will be pretty easy.
Might be best to have a chat first ? You can see my telegram link on my profile ?
I’m in Melbourne Australia :)
https://fly.io/blog/event-driven-machines/
Is a decent reference for doing serverless
I use pocketbase a fair bit and I feel like a web hook from stripe should be received by a scalable broker like nats .
Marmot is one that’s used to scale out pb and inside it use nats Jetstream which is 100% golang.
So the nats server would have a simple http handler for the web hook , and then the pb server (s) would then subscribe to any stripe messages from nats.
this will allow the pocketbase servers to be able to be upgraded without missing any stripe web hooks , no matter what happens.
Nats can be upgraded btw with zero downtime, by design.
Fly-io is great for this and can even run nats and on serverless !! So you can scale to zero and it will startup when stripe sends the message .
https://github.com/maxpert/marmot/tree/master?tab=readme-ov-file#out-in-wild
Marmot allows to scale out pocketbase using NATS Jetstream. NATS is designed to be clustered and globally scalable and so will never miss any stripe web hook.
I can probably help with this if I get time or I am happy to guide things.
You can see my main GitHub profile for a Telegram chat link
https://www.synadia.com/screencasts/micro-services-with-auto-discovery-observability-and-load-balancing Shows the web hook receiver concepts. A video is a good way to get up to speed