Find the latest and most relevant news, talks, and webinars in the Node.js ecosystem

maxresdefault (1).jpg
How To Deploy a Resilient Node.js Application on Kubernetes From Scratch

This post was first published in Digital Ocean blog post.


You may have heard the buzz around Kubernetes and noticed that many companies have been rapidly adopting it. Due to its many components and vast ecosystem it can be quite confusing to find where the path starts to learn it.

In this session, you will learn the basics of containers and Kubernetes. Step by step, we will go through the entire process of packaging a Node.js application into a Docker container image and then deploying it on Kubernetes. We will demonstrate scaling to multiple replicas for better performance. The end result will be a resilient and scalable Node.js deployment.

You will leave this session with sufficient knowledge of containerization, Kubernetes basics, and the ability to deploy highly available, performant, and scalable Node.js applications on Kubernetes.

Resources

View the slides for this talk

Transcript of The Commands and Manifests Used

Be sure to follow along with the recording for an explanation and replace kamaln7 with your own DockerHub username.

Node App

  1. Create an empty node package: npm init -y
  2. Install express as a dependency: npm install express
  3. index.js
const express = require('express')
const os = require('os')

const app = express()
app.get('/', (req, res) => {
        res.send(`Hi from ${os.hostname()}!`)
})

const port = 3000
app.listen(port, () => console.log(`listening on port ${port}`))

Docker

  1. Dockerfile
FROM node:13-alpine

WORKDIR /app

COPY package.json package-lock.json ./

RUN npm install --production

COPY . .

EXPOSE 3000

CMD node index.js
  1. Build the image: docker build -t kamaln7/node-hello-app .
  2. Edit index.js and replace the word Hi with Hello.
  3. Re-build the image and notice Docker re-using previous layers: docker build -t kamaln7/node-hello-app .
  4. Run a container to test it: docker run --rm -d -p 3000:3000 kamaln7/node-hello-app
  5. Look at the running containers: docker ps
  6. Stop the container: docker stop CONTAINER_ID
  7. Push the image to DockerHub: docker push kamaln7/node-hello-app

Kubernetes

  1. Get worker nodes: kubectl get nodes
  2. Create a deployment: kubectl create deployment --image kamaln7/node-hello-app node-app
  3. Scale up to 3 replicas: kubectl scale deployment node-app --replicas 3
  4. Expose the deployment as a NodePort replica: kubectl expose deployment node-app --port 3000
  5. Look at the newly created service (and the assigned port): kubectl get services
  6. Grab the public IP of one of the worker nodes: kubectl get nodes -o wide
  7. Browse to IP:port to test the service
  8. Edit the service: kubectl edit service node-app
  9. Replace port: 3000 with port: 80
  10. Replace type: NodePort with type: LoadBalancer
  11. Verify that the service was updated: kubectl get service
  12. Run the above command every few seconds until you get the external IP address of the Load Balancer
  13. Browse to the IP of the Load Balancerhhuy

Read More
maxresdefault.jpg
Webinar: The end of monoliths? A guide to backend architecture in 2020

You can’t build a stable backend without solid architecture. And without proper backend, you can’t develop a good application. But what does stable backend mean? How to keep up with all the architectural trends in an ever-changing, fast-paced reality of the modern development? 📈

Is monolithic architecture already dead? Should you or your team focus on practicing the use of microservices? Is following the trends a good approach or should you rather lean on some thoroughly tested solutions? 🤔

During our upcoming webinar, Adam Polak – Head of Node.js Team at The Software House, will guide you through the current backend architecture trends and solutions, indicating the most important (but not always obvious) issues that you should pay attention to. Here’s the excerpt from the extensive agenda:

  • analysis of some important elements of backend: architecture, infrastructure, environment, communication;
  • monolithic architecture – still a good idea?
  • modular monolith vs microservices;
  • why the most of the services is still monolithic-based?
  • what were the most significant changes in the architecture in the last few years?
  • REST API, BFF, GraphQL and the communication;
  • what does a stable backend mean in 2020?

Subjects discussed during our event will be 100% based on real-life cases and experiences. Also, Adam will answer your questions during a Q&A session after the webinar. The whole event will last for approximately an hour.

Read More
Screen Shot 2020-07-14 at 12.53.39 PM.png
Need to Node – Volume 68

In this volume of Need to Node, you can find the latest news on Node.js, our announcement of Node.dev and some information about our Open JS presentation ‘Behind the Scenes of NodeSource Node.js Binary Distributions'.

Need to Node is a weekly bulletin designed to keep you up-to-date with the latest news on the Node.js project, events and articles. You are always welcome to collaborate and participate. Please let us know if we missed a piece of content you think should be included!

What’s New in the Node.js Project

  • Node.js v.14.5 released The most notable change is an update to Node’s V8 engine to version 8.3, which is primarily a performance and bug-fix upgrade and an initial experimental implementation of EventTarget which provides a DOM-style API for objects in general.

Awesome Articles, Links, and Resources

One Last Thing...

If you find any Node.js or JavaScript related content over the next week (or beyond!), never hesitate to reach out to us on Twitter at @NodeSource to share and get it included in Need to Node - our DMs are open if you don’t want to share publicly!

Read More
Screen_Shot_2020-06-23_at_9.39.22_AM-min.png
Behind the Scenes of Node.js Distributions

If you are installing Node.js in Linux to use it in production, there is a big chance that you are using NodeSource Node.js Binary Distributions.

In this talk you can find the process in which NodeSource Node.js Binary Distributions is updated, how new versions are supported, the human and infrastructure process, and some limitations of maintaining the channel. Also and most importantly, how the community can get involved with this project.

Read More
1-min.png
Need to Node vol. 67

In this volume of Need to Node, you can find the latest news on Deno, a recording of our webinar ‘New and Exciting Features to Land in Node.js version 14’ and ‘JavaScript features to forget’.

Need to Node is a weekly bulletin designed to keep you up-to-date with the latest news on the Node.js project, events and articles. You are always welcome to collaborate and participate. Please let us know if we missed a piece of content you think should be included!

What’s New in the Node.js Project

Awesome Articles, Links, and Resources

  • Deno 1.0 Released. Some of the most important features include:

    • First Class TypeScript Support without additional tooling
    • Promises All The Way Down - When Node.js was created the concept of promises or async/await in JavaScript didn’t exist yet, but now and after a lot of work it is fully integrated. Deno was created taking promises into account from the beginning.
    • Rust APIs - Deno is built in rust.
    • Stability, npm-less, security-first, JavaScript runtime. For some applications Deno may be a good choice today, for others not yet. It all depends on the requirements.
  • TypeScript 3.9 Released including a variety of editor and performance improvements, also tweaks to inference and Promise.all.
  • Second-guessing the modern web. It is possible to solve things in a better way than single page applications? Find out in this article! By Tom MacWright
  • JavaScript features to forget. New features arrive all the time, replacing and improving old ones. The introduction of ...args in ES6 replaced the arguments object, we don’t use document.write() anymore or join() to concatenate strings and template literals are much better. Find out more here!
  • Build A REST Service With Fastify. Fastify is a high-performance HTTP framework for Node.js. Fastify focuses on speed, and it’s inspired by ExpressJS and HapiJS. Check out this article to find out how to build a restful service using fastify.
  • ES2020: Everything You Need to Know there are very cool new features like: String.prototype.matchAll, Dynamic import(), Promise.allSettled, Optional Chaining among others. Check it out!
  • Hardcore Functional Programming in JavaScript - by Brian Lonsdorf

One Last Thing...

If you find any Node.js or JavaScript related content over the next week (or beyond!), never hesitate to reach out to us on Twitter at @NodeSource to share and get it included in Need to Node - our DMs are open if you don’t want to share publicly!

Read More
1-min.png
New and Exciting Features to Land in Node.js Version 14

Node.js 14 has just been released. It comes with full of new features and enhancements. More importantly, it will be promoted to Long-Term Support in October, so now it's the moment to start testing our applications and try the new features to ensure a smooth transition.

In this webinar we will be showing the most relevant of these new features.

Read More
3-min.png
Need to Node – Volume 66

In this volume of Need to Node, you can find the latest news on Node.js’s version 14 Release, Diagnostics in Node.js and The Cost of JavaScript Frameworks

Need to Node is a weekly bulletin designed to keep you up-to-date with the latest news on the Node.js project, events and articles. You are always welcome to collaborate and participate. Please let us know if we missed a piece of content you think should be included!

What’s New in the Node.js Project

  • Node.js version 14 Released — Woo-hoo it’s finally here! Node.js v.14 now becomes the current release line with it becoming a LTS (Long Term Support) release in October. It’s recommended to keep using Node.js version 12 for now. Some of the most exciting features include:

    • Diagnostic Report goes Stable
    • V8 upgraded to V8 8.1
    • Experimental Async Local Storage API
    • Improvements to Streams.
    • Experimental WebAssembly System Interface (WASI) to support future WebAssembly use cases.
    • Removal of Experimental Modules Warning (but it still is experimental).

Awesome Articles, Links, and Resources

One Last Thing...

If you find any Node.js or JavaScript related content over the next week (or beyond!), never hesitate to reach out to us on Twitter at @NodeSource to share and get it included in Need to Node - our DMs are open if you don’t want to share publicly!

Read More
  • 1 / 2