👻

Jamstackについて調べてみた

2021/07/12に公開

公式サイトは以下。

https://jamstack.org/

ざっくり概要

Jamstack is an architecture designed to make the web faster, more secure, and easier to scale. It builds on many of the tools and workflows which developers love, and which bring maximum productivity.
The core principles of pre-rendering, and decoupling, enable sites and applications to be delivered with greater confidence and resilience than ever before.

  • webをより高速に、セキュアに、スケーリングしやすくするもの
  • 開発者にとっては生産性が上がる
  • pre-renderingdecouplingを使う。

Core principles

pre-renderingは、リクエスト以前に予め(=事前に)、HTMLを生成しておくこと。

To generate the markup which represents a view in advance of when it is required. This happens during a build rather than on-demand so that web servers do not need to perform this activity for each request received.

decouplingは、システムを疎結合にすること。

Decoupling is the process of creating a clean separation between systems or services. By decoupling the services needed to operate a site, each component part can become easier to reason about, can be independently swapped out or upgraded, and can be designated the purview of dedicated specialists either within an organization, or as a third party.

わかりやすい日本語のまとめのサイト

一方で例えばFacebookやTwitterのようなログインをして一人ひとり異なるコンテンツを表示する場合にはJamstackは不向きです。
事前に決まったページを生成することができず、アクセスがされた時点でほぼ全ての表示コンテンツが定まるためです。

静的サイトジェネレーターとは

Static Site Generatorとは?

https://www.netlify.com/blog/2020/04/14/what-is-a-static-site-generator-and-3-ways-to-find-the-best-one/

This has a number of valuable effects, but most important is that it shifts this work away from “request time” (when users ask for the view) to “build time” which is unrelated to when users ask for the view of a page. This “decoupled” architecture breaks the relationship between the number of visits to a site and the overhead of generating the views to service all of those visits.

この辺は、JamstackのCore Principlesそのまま。

「何に対してSSGを使うか」であるが、

  1. What are you building?

の段落に書いてある。

参考

Discussion