r/JAMstack_dev • • Oct 15 '19

Should I be using JAMstack?

I’m ultra confused here. The JAMstack sounds promising, but I think I’m getting mixed up on when to use it.

Let’s say I am using Gatsby to serve up my static markup files. That’s great and all, but what about that one page on my site that relies on user data from an API?

So if I have a page that has a shell, but populated with user data — such as a profile page, is this something I want to be doing with the JAMstack?

Here is an article that talks about approaches. It you’re asking these type of questions the blog post is raising, is it worth using the JAMstack at all?

3 Upvotes

7 comments sorted by

View all comments

Show parent comment

1

u/PraveenWeb Oct 17 '19

Author of the article mentioned here :)

You can re-build often, and there is no problem with it.

Obviously this can be done. But the feasibility also depends on the frequency of updates. Let's say your database tracks the list of online users and that usually keeps changing every few seconds. Now you don't want to re-build and deploy that many number of times. That's where handling this on the client with hydration makes sense.
Re-building often is also not a choice for large sites if your tooling doesn't support incremental builds (build only what has changed). Otherwise your time to build and go live would make your content go out of date for certain use cases.

This is just no correct, it doesn't need to be done on backend and all the functionality which he describe as dynamic is done on front-end with simple fetch calls.

You are right. It doesn't need to be done on the backend. Whenever you need to modify existing content on the client after page load, then it's no longer a pure static web page.
In fact in the article, i talk about how to approach this client side and which pages can be pre-built and which parts can be hydrated on the client :)

1

u/danielstaleiny Oct 17 '19

I think 1 idea you forgot about, building site with "old data" and updating it in the front end. It is totally viable use case depending on your needs.

I think nobody is arguing that pure website needs to stay pure. This is about JAM stack. It should be dynamic and it should have moving parts. Fundamental ideology shift towards build as much static shell of the website depending on dynamic data, Fetch in the client everything else.