Welcome!

@DevOpsSummit Authors: Destiny Bertucci, Pat Romanski, Yeshim Deniz, Dalibor Siroky, Liz McMillan

Related Topics: @DevOpsSummit, Java IoT, Microservices Expo

@DevOpsSummit: Blog Feed Post

Node.js ABC’s - K Is for Koa By @JoePruitt | @DevOpsSummit #API #DevOps #Microservices

Frameworks are code libraries that are created to save people a lot of time and unnecessary work for repetitive tasks

Node.js is an open source runtime environment for server-side and network based applications.  Node.js contains all the components needed to build a functioning website.  But, you need to think of Node.js as a big tool box.  As with any other art form, going to the tool box over and over to perform the same task is not productive.  The concept of tool reuse is used in all forms of artistry and development is no exception.

What Is a Web Framework
In general, frameworks are code libraries that are created to save people a lot of time and unnecessary work for repetitive tasks.  A framework is a universal environment that has several key features that distinguish it from a regular library:

  • Inversion of control - The control flow of the application is dictated by the framework, not the code using the framework.
  • Default behavior - Provide a default set of behaviors yielding a consistent outcomes.
  • Extensibility - Provides a layer of extensibility where the user can selectively override the default behaviors of the framework.
  • A non-modifiable framework - The core framework software is not intended to be modified.

Frameworks can allow you to create a server in just a few lines of code and make creating a REST API very simple.

KoaTreeKoa
Koa
is a web framework that is being worked on by the team that wrote the Express Node.js framework.  Koa differentiates itself by not using any middleware within the core of the framework.  From Koa's website

Koa is a new web framework designed by the team behind Express, which aims to be a smaller, more expressive, and more robust foundation for web applications and APIs. Through leveraging generators Koa allows you to ditch callbacks and greatly increase error-handling. Koa does not bundle any middleware within core, and provides an elegant suite of methods that make writing servers fast and enjoyable.

When building an application on top of Koa, you are creating generator functions that are composed and executed upon request.  Koa is similar to other middleware systems like Rack for Ruby.

Koa Hello World
It can't finish up talking about a framework without presenting the obligatory "Hello World" example.  So, here it is in Koa:

var koa = require('koa');
var application = koa();

application.use(function *() {
  this.body = "Hello world!!!"
});

var server = application.listen(8080, function() {
  console.log("Koa is listening on http://localhost:8080");
});

Summary
Koa is a fairly small set of code so it does not cause unnecessary bloat to your application.  It is basically a bare-boned framework where the developer can decide on the middleware they want to run instead of relying on that of the framework.  The current state of Koa right now is that it's pretty early on in development so if you decide to investigate it, I'd avoid being bleeding edge and stick with the latest stable release.

Other Popular Frameworks
The benefit of the open source community is that there are always alternatives to choose from.  Here is a list of some of the more popular Node.js frameworks out there:

Read the original blog entry...

More Stories By Joe Pruitt

Joe Pruitt is a Principal Strategic Architect at F5 Networks working with Network and Software Architects to allow them to build network intelligence into their applications.

@DevOpsSummit Stories
ChatOps is an emerging topic that has led to the wide availability of integrations between group chat and various other tools/platforms. Currently, HipChat is an extremely powerful collaboration platform due to the various ChatOps integrations that are available. However, DevOps automation can involve orchestration and complex workflows. In his session at @DevOpsSummit at 20th Cloud Expo, Himanshu Chhetri, CTO at Addteq, will cover practical examples and use cases such as self-provisioning infrastructure/applications, self-remediation workflows, integrating monitoring and complimenting integrations between Atlassian tools and other top tools in the industry.
A strange thing is happening along the way to the Internet of Things, namely far too many devices to work with and manage. It has become clear that we'll need much higher efficiency user experiences that can allow us to more easily and scalably work with the thousands of devices that will soon be in each of our lives. Enter the conversational interface revolution, combining bots we can literally talk with, gesture to, and even direct with our thoughts, with embedded artificial intelligence, which can process our conversational commands and orchestrate the outcomes we request across our personal and professional realm of connected devices.
The need for greater agility and scalability necessitated the digital transformation in the form of following equation: monolithic to microservices to serverless architecture (FaaS). To keep up with the cut-throat competition, the organisations need to update their technology stack to make software development their differentiating factor. Thus microservices architecture emerged as a potential method to provide development teams with greater flexibility and other advantages, such as the ability to deliver applications at warp speed using infrastructure as a service (IaaS) and platform as a service (PaaS) environments.
The use of containers by developers -- and now increasingly IT operators -- has grown from infatuation to deep and abiding love. But as with any long-term affair, the honeymoon soon leads to needing to live well together ... and maybe even getting some relationship help along the way. And so it goes with container orchestration and automation solutions, which are rapidly emerging as the means to maintain the bliss between rapid container adoption and broad container use among multiple cloud hosts. This BriefingsDirect cloud services maturity discussion focuses on new ways to gain container orchestration, to better use serverless computing models, and employ inclusive management to keep the container love alive.
While some developers care passionately about how data centers and clouds are architected, for most, it is only the end result that matters. To the majority of companies, technology exists to solve a business problem, and only delivers value when it is solving that problem. 2017 brings the mainstream adoption of containers for production workloads. In his session at 21st Cloud Expo, Ben McCormack, VP of Operations at Evernote, discussed how data centers of the future will be managed, how the public cloud best suits your organization, and what the future holds for operations and infrastructure engineers in a post-container world. Is a serverless world inevitable?