Comment

Comment by TekMol

Let me try to understand this "Edge" thing:

    - The user sends an HTTP request to somesite.com
    - Their DNS query for somesite.com gets resolved to some datacenter near them
    - The HTTP request arrives at the datacenter where the PHP in WebAssembly is executed at half the speed of native PHP
    - The PHP in Webassembly sends database queries to a central DB server over the internet
    - The PHP in Webassembly templates the data and sends it back to the user
How is that faster than resolving somesite.com to the central server, sending the HTTP query to the central server where PHP runs at full speed and talks to the DB on the same machine (or over the LAN)? Even if PHP ran at full speed at the "Edge", won't the two requests over the internet

    user --1--> edge PHP server --2--> central Db server
take longer than the one http request when the user connects to the central server directly?

   user --1--> central PHP+DB server
In reality, the PHP script on the "Edge" server probably makes not one but multiple queries to the DB server. Won't that make it super slow compared to having it all happening on one machine or one LAN?
parent TekMol 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton