Skip to main content
NOTICE

Jamstack architecture

Ontario.ca Frontend enables developers to build applications powered by the Jamstack, a modern architecture that uses JavaScript, APIs and markup without requiring the use of a database or server-side programming language.

Overview of the Jamstack architecture

Jamstack is a modern way of constructing websites and applications. The Jam in Jamstack stands for JavaScript, APIs, and markup.

In traditional setups like those found in WordPress or Drupal, content is stored in a database. This content is then combined with HTML templates that define how it should look on a user's screen.

A server is needed to make this happen. It fetches content from the database, fits it into the template, and sends the final result to the user's web browser. This process repeats each time someone asks for a specific URL.

This approach links the frontend of an application (what users see) with its backend (the database and server). It's often called a "monolithic architecture," where content and its presentation are part of the same codebase. Content is only accessible as HTML and can be consumed only by clients that understand HTML, like web browsers.

What makes Jamstack different

Jamstack takes a different route, where the frontend and backend are "decoupled." The frontend is made up of JavaScript, HTML, and CSS. These files are created during a build process, where an application is pre-rendered into a static set of files that can be directly served to users.

By pre-rendering the site, there's no need for a server to dynamically generate content for every request. Without the server in the mix, Jamstack applications can be quickly and securely delivered to users directly from a content delivery network.

Advantages of a Jamstack architecture

Jamstack applications, such as those created with Ontario.ca Frontend, offer five key advantages over other website architectures.

  • Performance: Jamstack apps eliminate the overhead caused by servers and database layers. As a result, they render and load faster than sites constructed with monolithic architectures.
  • Flexibility: Apps can source content from any API that return JSON data. They can even connect to multiple content sources simultaneously, including several common Ontario Public Service systems.
  • Scalability: Teams have full control over their frontends and can expand or modify their backend services over time without the need to update their frontend systems. The Jamstack architecture can save teams time and money as their systems age.
  • Security: Transitioning to a Jamstack architecture reduces or eliminates many common attack vectors. Since pages are pre-rendered and directly served to users, they are not susceptible to numerous typical server-side attacks and remain resilient against denials of service.
  • Developer experience: Jamstack is based on common web development tools and patterns, and doesn't rely on proprietary technology or frameworks. This means that frontend developers can focus on the frontend and work in parallel with backend teams, allowing each to focus on what they do best.

Learn more about Jamstack architecture