Earlier quoted context omitted.
I guess if you have a use case with higly cacheable data on edge, it might work great. For example, a form builder like typeform could cache form definitions on edge and render them close to users. Submissions would require db communication but the entire experience could be better. Otherwise it is just not worth it. BTW, I don’t even think PHP running slower in wasm would be that important. These things generally de…
> WASM is also pretty fast these days so.. ironically everything is petty fast and everyone waste that speed adding things that allow for a cheaper labour. wasm included. it went from a "have some expertly optimized code in the browser" to "just compile this hide cpp thing and ship as a react component" to then "it allows our servers to run any crap without knowledgeable staff in each language" we added so many Layer…
Running PHP fast at the edge with WebAssembly
91–98 of 98 posts
Re: Running PHP fast at the edge with WebAssembly
#92Earlier quoted context omitted.
“Containers are not a sandboxing mechanism”, I hear reasonably often (although that seems surmountable at least in theory?). VMs are cheap, but not “let’s run thousands of them on ‘the edge’ in case we get a request for any of them!” cheap.
On kraft.cloud we can (done internal stress tests for this) run thousands of specialized VMs (aka unikernels) scaled to zero, meaning that when a request for one of them arrives we can wake it up and respond within the timescales of an RTT. You can take it out for a spin, just use the -0 flag when deploying to do scale to 0 ( https://docs.kraft.cloud/guides/features/scaletozero/ ).
Re: Running PHP fast at the edge with WebAssembly
#93Earlier quoted context omitted.
> WASM is also pretty fast these days so.. ironically everything is petty fast and everyone waste that speed adding things that allow for a cheaper labour. wasm included. it went from a "have some expertly optimized code in the browser" to "just compile this hide cpp thing and ship as a react component" to then "it allows our servers to run any crap without knowledgeable staff in each language" we added so many Layer…
Ok hear this, I was toying with zig last week and compiled a quickjs wrapper that can run React and compiled that to wasm. So I have a JS runtime running wasm which runs quickjs runtime via zig and that runs React. Just trying to learn zig though but not much different than running PHP in WASM haha. Layers and layers of shit pressed together.
Re: Running PHP fast at the edge with WebAssembly
#94I think this will face the same problems as Next.js edge runtime: your database cannot be moved to the edge
Also, not everything requires a database.
Re: Running PHP fast at the edge with WebAssembly
#95I think this will face the same problems as Next.js edge runtime: your database cannot be moved to the edge
There are already edge databases. Also, not everything requires a database.
Re: Running PHP fast at the edge with WebAssembly
#96Please stop calling it "at the edge." You have seven locations all in highly developed Equinix datacenters. Edge means getting embedded into ISP networks, cell towers, smaller metros, etc.
Actually it means both, in an unfortunate case of term overload. Though I can understand the embedded/IoT world being frustrated by this, as the term existed first within that context.
This is like the owner of a restaurant with two locations in the same city calling themselves a nationwide chain. It is just a flat out fabrication.
Re: Running PHP fast at the edge with WebAssembly
#97Earlier quoted context omitted.
There are already edge databases. Also, not everything requires a database.
Honest question, what kind of requests are you thinking of? In my projects I’m always fetching or changing data in a database on each request and if I’m not then I’m probably moving that logic to the frontend.
Re: Running PHP fast at the edge with WebAssembly
#98Earlier quoted context omitted.
Honest question, what kind of requests are you thinking of? In my projects I’m always fetching or changing data in a database on each request and if I’m not then I’m probably moving that logic to the frontend.
A basic example is some compute service, say image transformation. You just run computations where all the input is in the request, and all the output goes to the response.
I'm intrigued by edge computing but the DB always seems like the bottleneck so thank you for the example.