DEV Community

Pacharapol Withayasakpunt
Pacharapol Withayasakpunt

Posted on

Please ELI5 how Stateless deployment works

If there is only HTML/CSS/JS, I might go for Netlify, but if it goes beyond that? Docker that only expose ports?

When do I need Kubernetes? Why is it "Starting at $10/mo" on DigitalOcean?

When I host it somewhere, isn't every computer / server supposed to be mutable somehow?

Also, what about geographical location and can it be duplicated for performance?

Top comments (3)

Collapse
 
louy2 profile image
Yufan Lou

Stateless means your server does not generate different frontend depending on state, so your frontend is an independent client, and all dynamic content is loaded via ajax. Which if you are using Vue, you probably are already doing.

You can deploy your frontend app on Netlify, and deploy your backend somewhere else, and configure your frontend app to make ajax requests to your backend for dynamic contents. You frontend will automatically get cached to CDNs across the world for fast loading, but your need to manage your backend still.

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

Actually, I might want to use non-JavaScript, e.g. OpenCV.

Collapse
 
louy2 profile image
Yufan Lou

Two ways. First, you can use OpenCV on your backend and use ajax as an remote procedure call (RPC) channel. Second, you can compile OpenCV to WebAssembly and use JavaScript still.