Where is our application deployed?
We will see the different elements where our application is saved and executed on the network.
It is essential to know this to have a global vision of the network where our application will be running and being served. With this knowledge, we can make better decisions when choosing how to render or what infrastructures to select in a project.
Many people must learn this when they go to front-end programming and miss out on relevant information about the entire web landscape.
The pillars of the network
We would have the following elements:
-Origin Servers
-Content Delivery Network
-The Edge
Origin Servers
They are the places where our application's code is hosted initially and executed.
A request arrives at these, is processed, and generates data. This data, in turn, can then be stored on CDNs.
Content Delivery Network
They are data servers geographically distributed worldwide, where static data (such as Html or CSS files) are stored.
Instead of the client's request going directly to the origin servers, causing them to become congested, it goes to these CDNs that store cached data and are located closer to the clients, reducing the latency in the delivery of the data.
The Edge
They are similar to CDNs in their main characteristics, with the peculiarity that they can run small code snippets.
They are beneficial since, instead of doing computations on the client side or the original server, they are done at The Edge, reducing the sending of data between far away locations and reducing the computational load in both places, reducing latency in the delivery of data and improving the end-user experience.
Conclusion
We have to use Content Delivery Networks and The Edge to improve the experience for end users and not overload origin servers. Most websites have been using CDNs for years.
Here, I share 6 helpful resources that also talk about this topic. I highly recommend them:
https://nextjs.org/learn/foundations/how-nextjs-works/cdns-and-edge
https://www.rtinsights.com/content-delivery-networks-versus-edge-computing/#:~:text=Differences%20between%20edge%20networks%20and%20CDNs&text=Processing%3A%20CDNs%20typically%20only%20store,to%20IoT%20sensors%20and%20smartphones.
https://jamstack.consulting/posts/nextjs-ssr
https://nextjs.org/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes
https://nextjs.org/learn/foundations/how-nextjs-works/buildtime-and-runtime
I hope you enjoyed the article.
Join my weekly newsletter, where I share articles to help you become a better front-end developer. You'll receive them directly to your inbox.
If you have any questions, feel free to contact me on LinkedIn, Edi Rodriguez, or leave a comment in the post.
See you in the next post.
Have a great day!