Skip to main content

MEAN 101: MongoDB, Express.js, Angular.js, Node.js

Are you a MEAN person? If you answered no, that’s good. If you answered yes, even better. Part 1 of 2.

A hand reaches out from a body in a suit and above it, there is a spinning blue globe. It's surrounded by various blue icons and darker blue boxes.

Are you a MEAN person? If you answered no, that’s good. If you answered yes, even better. Regardless of your answer, you will become well versed in MEAN after reading this article.

A technology that has garnered a lot of attention in the software industry is the MEAN stack: MongoDB, Express, Angular, and Node. Several years ago, the software industry proposed a standard called “LAMP” for developing web based applications. LAMP stack includes Linux, Apache, MySQL and PHP (or Python/Perl). Since then, the software industry has come up with the next generation stack called MEAN. The MEAN stack simplifies development by allowing applications to be written and maintained entirely in JavaScript, on both the front and back ends. Thus, the MEAN stack provides a robust platform to create advanced, high performing web applications in a short span of time with minimal server side resources. In this article series, we will discuss MEAN and how to deal with the legacy

The MEAN Stack

1. MongoDB

MongoDB is the leading NoSQL database, which is different from the traditional “Relational” databases like DB2, Oracle, SQL Server, etc. What is NoSQL? Why NoSQL? Think about the change the IT world has gone through in the last 10 years. Today’s requirements were not present in ‘90s. With the emergence of social media, Cloud computing, and agile concepts, the needs and demands of the software systems have drastically changed. What is industry’s answer to those demands? The “NoSQL” database is the industry’s answer since it can:

  • Store data in the distributed systems to make the Cloud work
  • Handle the unstructured data for social networking sites to work
  • Change database schemas rapidly as demands evolve while adopting Agile model

2. Express

Express is a node framework that makes the developer’s job much easier in creating Node projects. It comes with very useful out of box solutions, hiding complex coding from the developers. Express and Node go hand in hand. Express code is typically part of the Node code.

3. Angular

Angular is a front-end component that implements single page application (SPA). SPA is a very important and hot concept in the web development industry. While NoSQL took the place of “Relational” databases, SPA is taking the place of the “Traditional” web development. SPA gives the ability to run the most of the application in the client browser. The latest version “Angular 2” was released in September 2016.

4. Node.js

Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine for easily building fast, scalable network applications. While Node has become a popular choice among developers to build powerful web applications, it is also poised to replace Java, PHP, Ruby, etc. Typically Node runs in the server as the back end.

NPM – Public Repository

The open source projects/modules/utilities and its documentation are kept in the NPM “Node.js package manager”. NPM is the largest ecosystem of open source libraries in the world. It is used to install/share code, manage dependencies in your projects, and share/receive feedback with others. Any time a Node project is used, the common code base will be downloaded from NPM.

 

NPM is closely linked to Github, the largest open source community in the world. There are millions of open source projects on GitHub. GitHub is mostly used for code. In addition to source code, GitHub also supports many other features including:

  1. Documentation
  2. Issue tracking

Most of the NPM codes are stored in the Github.

IBM’s Commitment to Node.js

In September 2015, IBM acquired StrongLoop, Inc., a software provider, to help developers connect enterprise applications to mobile, Internet of Things (IoT), and web applications in the cloud. StrongLoop was a leading provider of Node.js, enabling software developers to build applications using APIs.

IBM is a platinum corporate member of the Node.js Foundation, whose mission is to enable widespread adoption and help accelerate development of Node.js and other related modules through an open governance model.

IBM’s involvement and contributions also include:

  1. “IBM SDK for Node.js" provides a compatible solution for IBM Power, Intel, and z Systems products that require Node.js functionality and package management.
  2. Node.js Tools for Eclipse
  3. Bluemix cloud platform provides high performance runtime environments for Node.js
  4. Node-RED, a tool for wiring together hardware devices, APIs and online services in new and interesting ways.

Programming Language – JavaScript

Some of you may be wondering why all of MEAN programming is done using JavaScript. It’s a language that no one cared about during the ‘90s and even the early 2000s. The story is different today, however. How different is it? One IBM press release states “JavaScript ranked #1 language for discussion and usage followed closely by Java”. Other reasons include:

  1. Relatively easy to learn and comprises of syntax that is close to English.
  2. Essential part of the JSON and NoSQL database integration.
  3. Key web technology in addition to HTML and CSS, as most browsers implement JavaScript.

Data Layer

When it comes to data, JSON is the way the industry is transmitting, consuming, and storing. JSON has proved to be a better solution than XML in terms of

  1. Lightweight data-interchange format
  2. Ease for machines to parse and generate
  3. Ease for humans to read and write

MEAN stack fits perfectly with JSON since it can read, process, communicate, and store in JSON very easily.

Legacy Systems

For most of the legacy enterprise software systems not currently using MongoDB, the "M" in MEAN is not possible. In reality, corporations cannot get rid of the existing databases. If that is the case, what is the solution for legacy applications like IBM DB2 users and applications? This article helps users to retain DB2, and still use most of the MEAN stack technology. As we make progress in this article, we will walk users through some of the fundamentals of this technology: DB2, Express, Angular and Node. That gives us the equation DEAN = MEAN – M + D(b2).

Conclusion

Now that we have learned the key concepts, our next step would be to delve deeper into Node, Express, and Angular to create and execute our first programs, which will be covered in future editions of this article series.

Related Links

MongoDB: https://www.mongodb.com/

Express: https://expressjs.com/

Angular: https://angular.io/

Node.js: https://nodejs.org/

NPM: https://www.npmjs.com/

GitHub: https://github.com/

IBM StrongLoop: https://www-03.ibm.com/press/us/en/pressrelease/47577.wss

Node.js Foundation: https://nodejs.org/en/foundation/members/

IBM Node.js SDK for Power, Intel and z: https://developer.ibm.com/node/sdk/

IBM Node.js Tools for Eclipse: https://marketplace.eclipse.org/content/ibm-nodejs-tools-eclipse (link not active)

IBM Bluemix: https://www.ibm.com/cloud-computing/bluemix/application-services

IBM Node-RED: http://nodered.org/

IBM Systems Webinar Icon

View upcoming and on-demand (IBM Z, IBM i, AIX, Power Systems) webinars.
Register now →