What is Next.js?

Next.js is a javascript framework built with react js, webpack, and babel. Next.js helps developers quickly create static generation (SSG) and server-side rendering (SSR) websites. ZEIT builds…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




7 tips for static web applications in 2018

Combined with the proliferation of single page websites, and serving content dynamically via API calls, static website development has made somewhat of a comeback. While initially this might feel as step backwards, significant advantages can be obtained if this new approach is used for the right job. Recent developments in web technology have increased the potential of the concept.

The essential part of this approach is not even very complex. The main idea is to use modern automation tools to, effectively build, a static version of an otherwise traditionally dynamic website. First I will discuss what tools and components are used in the creation of such a website. Then I will briefly discuss in what way they are used to provide the elements needed for a standard web application. In the third and final part of this post I will look at the challenges and the advantages of this approach. Finally I will briefly discuss what this means for contemporary web development.

So what does a simple setup look like? I will start by addressing the obvious and necessary components. From there I will address optional and more advanced components that can be added to the setup.

However, every approach has drawbacks. Let’s look at some of the negative sides of this specific setup. Afterwards I will discuss the advantages and finally I will conclude which type of application is best suited for development along these lines.

Drawbacks
The most obvious drawback of this approach is the fact that it can be complex to manage this environment. For starters even the simplest setup (static html pages based on templates) can be difficult to manage for people who lack experience with HTML and/or templating languages. Moreover setting up an environment like this requires some trial and error at a bare minimum. Finally every additional step will increase the complexity more than the previous. CI/CD, FaaS and Cloud Databases are currently advanced solutions that require the skill of a DevOps expert. If you are not familiar with elements that are needed for this setup it can take quite some time to get started. If you just want to bootstrap a simple application this setup might not be for you.

In upcoming posts we might look to into other ways of creating a static version of such an application. Angular has the Angular Universal package but this relies on isomorphic rendering which is technically server side rendering of a webpage so this does not fit the JAMStack approach.

Advantages
However by now the advantages should be sufficiently clear. First, as promised, this setup should be lightning fast. Second, every component in this setup scales extremely well. Third, it is easier to keep this setup safe as the attack surface is reduced to the API endpoints that you use. Moreover the attack surface is reduced even further because the need to provide a separate CMS stack can be eliminated. Finally it is comparatively cheap. Static storage is cheap, with FaaS you only pay when a call is made to your function and the same applies for cloud databases. This means when your application is not used, you will not pay. This eliminates overhead that usually occurs when you need to pay a periodical fee for a VPS.

Conclusion
The final question that remains is for what type of projects this stack we described is best suited. By now it should be clear that this approach is most suitable for comparatively simple applications that have to scale well in high traffic environments. However, I can see this technique proliferating to more complex webapplications sooner than later. That brings me to what this means for web development in 2018. In general I feel like these developments will lead to a further decline of traditional backend languages such as PHP and Ruby.

Follow our channel or give me a clap if you enjoyed reading this (lengthy) post :)

Add a comment

Related posts:

Guilty by ASSOCIATION

When a Country has to pay for its president’s sins, thats when Passports need become an (optional) boarding requirement. What more is there to say, if the president is not committing some kind of Law…