Welcome!

@DevOpsSummit Authors: Pat Romanski, Elizabeth White, Yeshim Deniz, Liz McMillan, Zakia Bouachraoui

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
In his session at 20th Cloud Expo, Mike Johnston, an infrastructure engineer at Supergiant.io, discussed how to use Kubernetes to set up a SaaS infrastructure for your business. Mike Johnston is an infrastructure engineer at Supergiant.io with over 12 years of experience designing, deploying, and maintaining server and workstation infrastructure at all scales. He has experience with brick and mortar data centers as well as cloud providers like Digital Ocean, Amazon Web Services, and Rackspace. His expertise is in automating deployment, management, and problem resolution in these environments, allowing his teams to run large transactional applications with high availability and the speed the consumer demands.
SYS-CON Events announced today that DatacenterDynamics has been named “Media Sponsor” of SYS-CON's 18th International Cloud Expo, which will take place on June 7–9, 2016, at the Javits Center in New York City, NY. DatacenterDynamics is a brand of DCD Group, a global B2B media and publishing company that develops products to help senior professionals in the world's most ICT dependent organizations make risk-based infrastructure and capacity decisions.
Most DevOps journeys involve several phases of maturity. Research shows that the inflection point where organizations begin to see maximum value is when they implement tight integration deploying their code to their infrastructure. Success at this level is the last barrier to at-will deployment. Storage, for instance, is more capable than where we read and write data. In his session at @DevOpsSummit at 20th Cloud Expo, Josh Atwell, a Developer Advocate for NetApp, will discuss the role and value extensible storage infrastructure has in accelerating software development activities, improve code quality, reveal multiple deployment options through automated testing, and support continuous integration efforts. All this will be described using tools common in DevOps organizations.
Andi Mann, Chief Technology Advocate at Splunk, is an accomplished digital business executive with extensive global expertise as a strategist, technologist, innovator, marketer, and communicator. For over 30 years across five continents, he has built success with Fortune 500 corporations, vendors, governments, and as a leading research analyst and consultant.
A valuable conference experience generates new contacts, sales leads, potential strategic partners and potential investors; helps gather competitive intelligence and even provides inspiration for new products and services. Conference Guru works with conference organizers to pass great deals to great conferences, helping you discover new conferences and increase your return on investment.