4 ms·
What I find missing here and in aws lambda or google function is the notion of "state". I believe it would really be a game changer if we could open and mainta
by siscia 9y ago
What I find missing here and in aws lambda or google function is the notion of "state".
I believe it would really be a game changer if we could open and maintain an open connection with a database.
- ryanworl 9y agoIn Lambda and Cloud Functions you can open a connection with a database (or anything else) and it will stay alive across invocations of the same underlying container. Not sure how Cloudflare workers behaves here, but from their docs they recommend global variables a way to persist state, so perhaps an outbound TCP connection will stay alive across invocations of the same V8 "process".
- kentonv 9y agoWorkers only support HTTP requests, not raw TCP. So, no, at present you can't hold a database connection open, though you can make requests to HTTP-based storage APIs available from any number of providers.
- kentonv 9y agoIndeed, we want to provide storage, but easy-to-use storage that can scale to 100+ (or 1000+) nodes is tricky. We're working on it. :) PS. If you're a distributed storage expert and want to work on this, we're hiring!
- siscia 9y agoFlattering, but I don't think I will fit ;) You definitely know this world better than myself, but as first approximation I wouldn't try to provide storage, which we know how messy it can be. Just keep a TCP connection open can go a very long way and it will get costumer to hook to redis or basically any other database.
- mr_luc 9y agoI'm not an expert, but I've gotten used to CRDTs being available in Elixir-land (Phoenix.Tracker, in phoenix_pubsub). But I don't believe >40 or so nodes has never been Erlang's strong point. Edit: with the conclusion being of course that you wouldn't want to strongly connect the edge nodes, so instead it'd be something more traditional, where if people pay for a storage add-on, you folks are automating the schlep of spinning them up a long-lived storage cluster, and networking it so that only their edge nodes can access it. At which point you could be building on anything, maybe even something that already exists like Redis or etcd. Hmm, though for hello-world purposes I might still see what could be put together in beam-land, where everything is more at your fingertips ...