JAM stack modern approach to faster, more secure websites

  • Posted By: Jay Tiwary
/static/7448f1ca71d354beaa979843ee1d7729/fd46c33a9d11801b472f7959c7778c01.jpeg

We have covered a long journey from static sites to dynamic websites but we still love static sites. The speed & performance of the static content can never be matched with on the fly dynamically generated websites. Many of the businesses still use static HTML sites if the content doesn't need frequent data changes. But when we have a huge content base, frequent changes, and a large number of pages it becomes difficult for editing & maintaining static files. Therefore we switch to CMS or custom developed solutions and lose the unmatched speed and performance. The use of web servers and web technologies to generate on the fly dynamic pages may take a couple of seconds to many more depending on the complexity of the data.

JAM stack an architecture decoupling the frontend from the backend

JAM stack abbreviated a Javascript, API's and Markup, separates the development of pages to hosting and delivery. This needs a headless (no frontend) CMS and a static page generator engine that pre-compiled static files to be deployed and delivered over the network. Sounds good? Interestingly, yes it's interesting as it sounds like back to HTML static files. The headless CMS solves the problem to manage large data and pages, easy editing, adding new data and the site generator generates the pages during the compilation process. Once the pages are generated there is no connection with headless CMS and only the precompiled files are deployed. Here are some benefits of JAM stack:

Faster website

As the files are pre-compiled it doesn't need any server-side coming & rendering process and can even remove the use of web servers and directly delivering from CDN.

More secure less vulnerable

As the files are pre-compiled and the CMS is decoupled from the stack thereafter, the site is less prone to cyber-attacks wherein most of the cases attackers hack the program and inject their own to change the content of the site.

Cost-effective and easy scaling

Since there is no need for a database and server-side logic to be executed on the server to generate the content, you can omit the use of API and database hosting and can use the static files hosting or a CDN. Both these solutions are cheaper than having a set of web server infrastructure. The scaling will be cheaper if you have more and more space needed depending on the size of the website.

Better development experience

Its a better development experience as we know once the static files are generated there could be no runtime errors, test case, or any possibility of failure of the business logic applied. If anything has to fail will fail during compilation. This separates the two environments and makes it more stable.

Strapi a headless CMS on NodeJs framework and Gatsby a static site generator on ReactJS a perfect JAM stack

Strapi a headless CMS built on top of Nodejs using expressjs framework. Strapi is becoming very popular, works as a great tool for JAM stack. Gatsby is one of the most popular JAM stack site generators based on the creat React app. With the use of GraphQL, the combination becomes more powerful and easy to use. Gatsby has a lot of middlewares/plugins to support various features like SEO support, commenting, social sharing, and many more.

Great but what if I need to make content changes or I have a dynamic website

With the use of DevOps, we can trigger out pipeline whenever any content changes in Strapi which trigger the next pipeline to run gatsby build and deploy to the server. Gatsby is not only for static sites but you can develop a full-fledged dynamic website use react helmet and gatsby tools.

Conclusion:

JAM stack is a great way to generate static pages and develop dynamic websites that use a lot of content. The stack can deliver a website with blazing fast speed, performance, and a highly maintainable site.

...

Subscribe

To get latest posts update

Hire JAM stack developers for blazing fast websites