DEV Community

Pacharapol Withayasakpunt
Pacharapol Withayasakpunt

Posted on

JAMStack, but you need an API anyway? Which hosting to choose?

  • Netlify vs Zeit.co if I don't want to touch AWS vs GCP vs Azure directly?
    • Startup time, i.e. first API call? I think Zeit.co has good serverless experience. No need to compile TypeScript / webpack first, but what about the startup time? I think it is somewhat slow.
  • AWS vs GCP vs Azure might be cheaper, as I already have free credits.
    • But what about securing the endpoints. Will it be secure enough?
  • Or, is monolith on Docker or VM an option?

Top comments (15)

Collapse
 
amorpheuz profile image
Yash Dave

Azure recently launched a service meant for JAMStack called Static Web Apps in Preview! It provides tight integration with Functions and since you already have credits lying around, it would be great once it comes out fully and becomes chargeable.

I did notice you mention switching to Next.js but if Gatsby is your thing, Gatsby Builds has insanely fast build times as outlined here willit.build/

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

As for SSG, I am not sure if I need incremental builds...

Collapse
 
bayuangora profile image
Bayu Angora

I usually posting my content right on GitHub repo. But Gatsby build is faster with CMS than plain markdown.

Collapse
 
amorpheuz profile image
Yash Dave

True, they have outlined the reason for that in their FAQs willit.build/faq#markdown-mdx-builds I'm in a comparable situation where my blog posts are stored in MDX files too, but I have been happy with the build times until now, as they are still significantly faster than a GitHub action I have configured for my repo.

Collapse
 
therealdakotal profile image
Dakota Lewallen

I would say it depends. If it's small or something that is really common (blog) probably go with a headless CMS. Only if it's something REALLY unique would I say roll your own backend. If you do decide to roll your own backend, probably start with whatever your most comfortable with. If it gets popular and you aren't meeting the scale, then do some hard evaluations. Don't overcomplicate it before you ship it.

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

Actually, I shipped it -- polv.cc but,

  • I feel it won't scale.
  • It is hard to manage a self created CMS
  • I want to apply the same architecture to creating a new website.

I'd probably go with Netlify and Netlify Lambda (just for a search engine that is not on client side). It seems to be fast enough. Not sure about costs...

Related,

I am currently using Nuxt, but I also considering moving to Next.js with MDX support.

I feel like I was wrong in thinking that I need a CMS, whether headful or headless. I can simulate the search function with a serverless function, anyway.

Also, I was wrong in thinking that Jekyll is putting too many files in a folder. The truth is, one folder and 10k files would still not hurt the performance. Also, it is possible build a flat file CMS on top of the single flat folder, anyway.

In the end, Jekyll isn't so bad, but I just want

  • JavaScript support
  • MDX support

That's way I might go Next.js.

Collapse
 
therealdakotal profile image
Dakota Lewallen

A from scratch CMS is probably overkill. I would look at migrating to a managed service. This coming from someone who made the same mistake lol. I also do agree with the next.js move because I'm probably going to be doing the same, but from plain react.

Collapse
 
bayuangora profile image
Bayu Angora • Edited

I don't use AWS, GCP, Azure. They're too complicated. If there's a simple way, then why choose to complicate life?

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

Price and free credits in the first year.

Collapse
 
bayuangora profile image
Bayu Angora

Even Vercel and Netlify give it for free every year without complicate life.

Collapse
 
souksyp profile image
Souk Syp.

Cloud Run ?

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

It's just a fully managed Docker runner. Not sure if I will be as performant as fully static hosting on a [PUT_YOUR_CLOUD_HERE] Storage, or using CDN?

Collapse
 
souksyp profile image
Souk Syp.

Okay maybe Vercel Server Pre Rendering is what you need...
vercel.com/blog/serverless-pre-ren...

Thread Thread
 
patarapolw profile image
Pacharapol Withayasakpunt

Can I use a full REST API, or do I have to use their serverless functions (which IMO is very very easier to use than Netlify)?

Thread Thread
 
souksyp profile image
Souk Syp.

I think you can use any endpoints. They use Notion api for querying documents in their example.
I am happy with Vercel with my WIP sapper ecommerce site.