0% found this document useful (0 votes)
19 views14 pages

Mongodb Mern Jam

Uploaded by

Jonatas Gouveia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views14 pages

Mongodb Mern Jam

Uploaded by

Jonatas Gouveia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

MERN, JAM,

and the Evolution


of the Web Stack
MERN, JAM, and the
Evolution of the Web Stack

MERN, JAM,
and the Evolution
of the Web Stack

The web application development stack is undergoing a fundamental


change. The lion’s share of newly developed systems today are using
some form of microservice architecture, while the cutting edge of
the market is trying out fully managed “serverless” systems.
End-to-end JavaScript development has given rise to the mature and
wildly popular MERN Stack (Mongo, Express, React, Node) for full-stack
service and application development, while pressure to deliver low-latency,
highly interactive content to high-speed mobile connections created the
perfect environment for JAM (JavaScript, APIs, Markup) to emerge as a
complementary technology for building and delivering simple static sites,
and complex client-side web applications alike.

2
The pendulum continues to swing
Technological innovation constantly bounces between the two poles of
consolidation and expansion. As a technological field reaches a certain level
of maturity, the market typically consolidates into a handful of elite products.
Once mature, technologies, much like companies, tend to remain powerful
until a new disruptive option emerges to challenge their dominance, usually
by changing the fundamental economics, or usability, of the category.
Web technology has been in an expansion phase. After Java and the
J2EE ruled supreme for years, Ruby’s Rails, Python’s Django, JavaScript’s
Express.js (built on Node.js), and more became more popular. The web
was wide open, and unprecedented growth in software developers
meant every combination of language and programming style has its own
vibrant open source communities built around Rails-like frameworks with
integrated Object Relational Mapping (ORM), HTTP request and response
handling, and opinionated HTML templating system.
With the rise of MongoDB and Node.js and any number of client-side
JavaScript rendering libraries, the most intrepid JS hackers started
envisioning a full JavaScript/JSON stack. The lure of being able to use
one programming language and data representation from database to
application code all the way up to client-side rendering was just too much.
At the same time that the underlying technologies of the JavaScript stack
matured, the demands of scale and latency have skyrocketed. Mobile
phone users demand that applications, whether running natively or through
the browser, be lightning fast to first render, even over relatively slow data
connections. With attention spans dropping, the fastest draw (rendering
pun intended) got the user, and the advertising dollar.
In this environment of rising user expectations, faster market cycles,
and global scale, simpler has started to look pretty darn good.
Let’s go over two different fast-growing approaches to full-stack
JavaScript development in the age of the high-performance web.

3
MERN, JAM, and the
Evolution of the Web Stack

The MERN full-stack


JavaScript solution

4
If you’re looking for the power-stack for server-side development
today, you should be taking a long, hard look at MERN.
The MERN stack – MongoDB, Express, React, Node
– is a state-of-the-art, truly full-stack JavaScript web development.

Browser

React Express

Node
MongoDB Atlas

The MERN stack.

Node.js (the web server component) is fast, lean, and offers great library
support (through NPM) and tooling, making it an ideal option for running
today’s stripped-down microservices. Whether you’re building a JSON-
driven HTTP API, a client-side rendered single-page application, or a more
traditional server-side application layer, the Express.js server framework
turns Node.js into a powerful HTTP, HTML, and JSON machine.
Meanwhile, React, an open source client-side rendering library
maintained by Facebook, has dramatically improved the experience
of developing complex data-driven applications that run in a browser.

5
MERN, JAM, and the
Evolution of the Web Stack

By using JavaScript and JSON all the way through,


MERN simplifies development and collaboration,
allowing teams of developers to quickly build full-stack
applications, rapidly accumulate reusable expertise,
and easily debug issues at any level of the stack.
There are multiple benefits to standardizing on JSON
throughout the stack: it reduces the impedance mismatch
between code-level data structure, and its consumption by
services or display code, is much simpler to work with than
ORM objects (especially in JavaScript), and fits well with
horizontally-scalable database technology. While MongoDB’s
BSON is more strictly thought of as a superset of JSON,

One language. Powerful tools. Great scale characteristics.


Fast, flexible, and mature. Easy to code in and deploy. MERN
certainly feels like the pinnacle of the era of the web stack.

But there’s something else happening in web


development right now. Fast static content delivery
techniques, combined with microservices and serverless
platforms are making a whole different approach
possible. And it’s starting to get very interesting.

6
MERN, JAM, and the
Evolution of the Web Stack

JAM distributed
application
front-end stack

7
The rise of JAM is proof that marketing works. What
had been seen as a niche technique for building static
websites and simple blogs, when combined with
microservices and serverless functions, was restyled
“JAM,” which stands for JavaScript, APIs, and Markup.
The idea is to fully render and compress your HTML and JavaScript
files that power your front-end, and put them on a Content Delivery
Network (CDN).

Today, JAM is starting to take off, and shows signs of growing into
a full-fledged movement. JAM sites load super fast because there’s
no need to talk to your origin server, which might not be located
geographically near your customer, in order to get the core files
and lay out the page. CDNs specialize in distributing these kinds of
assets and delivering them blazingly fast. They also allow for complex
client-side processing and rich single-page applications to be built
on top of JSON APIs, no matter how the back-end is built.

CDN

Browser

Javascript
Serverless platforms Static Site
Generator

Markup

MongoDB Database Templates Data

The JAM front-end deployment architecture.

8
MERN, JAM, and the
Evolution of the Web Stack

JAM takes advantage of many of the same underlying


technologies as MERN – like Node.js, and even React
– but uses them to pre-render static files, in addition
to dealing with client-side updates and interactions.
JAM is also jumping one cycle ahead in technology evolution by
standardizing web stacks to the point where they can be seen as
commodities and by making JSON APIs the norm.

This has enabled a new domain of exploration: Static Site Generators


(SSGs), which use the isomorphic properties of rendering libraries
like React to take dynamically rendered pages and turn them into
static assets that can be easily loaded into a CDN. Most static
content is served via Content Management Systems (CMS), but JAM
deployments use the CMS in “headless” mode to generate HTML
that is then deployed directly to the CDN. This means that browser
clients become super-fast, local, and have constant-uptime. On
top of that, deployment is atomic, provided your CDN allows you to
upload a new set of assets and mass-invalidate caches.

The logical conclusion of the microservices trend toward smaller


and more easily managed services, serverless platforms allow
developers to deploy individual functions that are bound to HTTP
endpoints. Combined with database-as-a-service (DaaS) offerings
like MongoDB Atlas, serverless platforms allow developers to easily
deploy JSON endpoints to implement functionality supporting JAM
client-side applications. This, in turn, creates a natural boundary
between the computation and presentation layers of the stack.
In a way, JAM is less of a “stack” and more of an architecture.

9
As the MERN stack has arisen alongside
microservice architectures, the JAM stack
seems destined to grow alongside serverless
functions, AKA Functions-as-a-Service (FaaS).
Building for JAM is primarily about having the right
tool belt and build process. With that in place, it’s as
simple as pushing static files to a CDN — even for highly
dynamic, interactive, and data-driven experiences.

If this model wins out, the “stack” can be thought


of as the document database, the (increasingly
serverless) API layer, and the statically served, client-
side-rendered display layer. With a clean separation
of concerns and consistent data and programming
paradigms, JAM feels like a welcome simplification
and a fascinating domain to keep on watch.

10
MERN, JAM, and the
Evolution of the Web Stack

Where is
the web
going next?

Whatever the dominant paradigm of the next


decade, it’s clear that the web is changing.
Serverless application development platforms are
ready to challenge the traditional server stack, JSON
is unquestionably the lingua franca of the day, and
managed, horizontal scale-out databases have
changed how products are designed, built, and grown.

11
Node

Browser

MongoDB
Atlas
CDN

API SSG

Both MERN and JAM are built for MongoDB.

Today, deciding what to build new systems on comes down


to whether you’re willing to trade the simplicity of JAM for
the power and flexibility of full-stack MERN development.
There’s no fundamental reason that you can’t use both MERN and
JAM together – which would really amount to the R(eact.js) part
being served up as part of a JAM application. As it becomes less
relevant what serves up the APIs that a JAM application consumes,
serverless platforms that simplify API development without requiring
service deployment at all start to become more and more tempting.

12
MERN, JAM, and the
Evolution of the Web Stack

Keep in mind that JAM is a less mature architecture, so


it’s too early to say whether it’s a trend with staying power,
or a fad that inevitably gets replaced by something else.
Either way, the inexorable rise of serverless function platforms is
here to stay. If you’re building custom full-stack web applications,
your own services, or need to do server-side dynamic rendering,
then the MERN stack is hard to beat.

No matter what tomorrow’s web development environment looks like,


new opportunities are opening up because of the simplifying power
of MERN and JAM. The reality is that people have always been our
most prized and constrained asset, and both of these technologies
create human leverage and improve developer productivity.

Cloud infrastructures and advanced automations are allowing


developers to move faster, scale more easily, and have greater
impact than ever before throughout the stack. By leveraging
database platforms like MongoDB Atlas, developers can now
build, deploy, and scale applications with incredible ease in any
organization, while keeping data in a globally accessible system,
opening up new horizons.

This maturation is certain to lead to innovation in user experience


and new categories of applications and a simpler technological
landscape. In an industry where sometimes it feels like there’s
a new language, framework, or technology to learn every week,
consolidation and simplification in the web stack can be a genuinely
welcome respite from the constant change. At least until the next
swing of the pendulum.

13
Learn more about
MongoDB, the
database that powers
the JavaScript stack

Are you ready to


Learn more today
open your horizons?

Still have questions? Contact us

14

You might also like