Angular JS Express JS MEAN Stack Mongo DB Node JS NPM

Introduction MEAN Stack Development [For Developers & Beginners]

How MEAN Stack Works
Written by VithalReddy.M.B

Mean Stack

 

Javscript – As They say “One language to Rule Them All”

 

mean stack images

MEAN Stack Technologies

MEAN stack is a collection of JavaScript-based technologies that includes MongoDB, ExpressJS, AngularJS, and NodeJS. Following image clearly, explains that how these technologies work together to develop an application or the web app. AngularJS or Angular.io (Powered by Google) being client makes AJAX calls to ExpressJS returning a response in JSON format. ExpressJS that is running on NodeJS  (JavaScript runtime built on Chrome’s V8 JavaScript engine.) The server further communicates with MongoDB as persistent medium (a NoSQL database).

 

How MEAN Stack Works

 

On top of all that NodeJS Developers or MEAN Stack Developers Community is Powered by NPM(Node Package Manager – which requires no introduction ). It is a package manager for JavaScript and the world’s largest software registry (as they claim). Discover packages of reusable code — and assemble them in powerful new ways. So You can Find, Discover, and Build .

Now coming to important question, So here it is.

Why use MEAN Stack and How Fast is NodeJS actually?

The acronym “MEAN” stands for “MongoDB,  Express.js, AngularJS, and  Node.js”  which are known to synergize well together to achieve amazing speed. The Top benefit of the MEAN Stack is that it’s extremely quick to prototype with. Node.js allows you to use Javascript on the backend as well as the frontend which can save you from having to learn a separate language(A big PLUS). In addition, the NoSQL nature of MongoDB allows you to quickly change data in a very big database and alter the data layer without having to worry about migrations, which is a very valuable attribute when you’re trying to build a product without clear specifications. Finally, these technologies have a lot of community support behind them so finding answers to questions or hiring help is going to be much easier using these technologies.

and

Finally, if u want to know how fast nodeJS is we will explain in NodeJS section below.

Now, Let’s look into Individual technologies one by one.

MONGODB (king of NoSQL databases)

When we say king of NoSQL databases, you obviously want to know why Here is the article on GigaOM check out:

MongoDB proves it’s king of NoSQL databases with $150M in new funding

MongoDB is a cross-platform, document-oriented database that provides, high performance, high availability, and easy scalability. It works on the concept of collection and document which is very handy when working with large databases.

READ  Fix node is not recognized as an internal or external command Error

MongoDB is, a kind of NoSQL database. As a NoSQL database, MongoDB shuns the relational database’s table-based structure to adapt JSON-like documents that have dynamic schemas which it calls BSON. This makes data integration for certain types of applications faster and easier.

Go through MongoDB Official Website and proceed to its Great Manual, which should help you understand NoSQL and MongoDB better in every possible way.

 

EXPRESS.JS (Fast, unopinionated, minimalist web framework for Node.js)

$ npm install express –save

It is powered by Node.Js Foundation. Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and also mobile applications. Express.js and Node.js gave JavaScript newfound back-end functionality — allowing developers to build software with JavaScript on the server side for the first time (Every frontend developer’s DREAM). Together, they make it possible to build an entire site with JavaScript: You can develop server-side applications with Node.js and then publish those Node.js apps as websites with ExpressJS (Isn’t it Interesting?). With inbuilt HTTP utility methods and middlewares at your disposal, creating a robust API is quick and easy using ExpressJS.

The best way to understand express is through its Official Website, particularly The Express Guide; you can also go through  StackOverflow threads for more resources and examples.

ANGULARJS (Superheroic JavaScript MVW Framework)

AngularJS is a JavaScript framework. It can be added to an HTML page with a <script> tag.

AngularJS extends HTML attributes with Directives and binds data to HTML with Expressions.

AngularJS is distributed as a JavaScript file, and can be added to a web page with a script tag:

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>

AngularJS is a structural (MVW) framework for dynamic modern web apps. It lets you use HTML as your template language and lets you extend HTML’s syntax to express your application’s components clearly and easily. AngularJS’s data binding and dependency injection eliminate much of the code you would otherwise have to write. And it all happens within the browser, making it an ideal partner with any server technology.

Some of the amazing features of AngularJS:

  • CROSS PLATFORM
  • SPEED AND PERFORMANCE
  • PRODUCTIVITY
  • Inbuilt Testing, Animation, and Accessibility.

Angular’s Official Website is a great starting point. CodeSchool created a great tutorial for beginner and the angular videos by Egghead and You can also check out official documentation for AngularJS 1+  and for Angular 2+ (Latest).

NODE.JS(JavaScript runtime built on Chrome’s V8 JavaScript engine)

Node.js is very popular nowadays because of it’s feature like:

  • JavaScript runtime built on Chrome’s V8 JavaScript engine
  • Node.js uses an event-driven, non-blocking I/O model
  • Which makes it lightweight and efficient
  • Node.js’ package ecosystem, npm, is the largest ecosystem of open source libraries in the world.

Because of these features, Node.Js because very popular in no time and Now its developer’s favorite language for developing Rest APIs and Building high scaling apps.

READ  How-To find the version of an installed NodeJS or NPM Package

src:  How to Update Node.JS to Latest Version (Linux, Ubuntu, OSX, Windows, Others)

Node.js is a cross-platform runtime environment and has also the library for running JavaScript applications outside the browser. Node is used for creating server-side and networking web applications. It is open source and free to use powered By NodeJS Foundation and  Linux Foundation Collaborative projects.

Start by going through Node.js Official Website and the documentation page as well as the many StackOverflow threads, which should get you going with the Node.js platform in no time.

So Now coming to the very interesting point, How fast is NODEJS?

Node.js uses asynchronous handling of events by default. Java and Python use threading by default. *

This may not seem important, but prior to the Apache Web server being converted to support an async event model, it would tend to fall down at anywhere from 1000-5000 concurrent connections, and many of those connections would have extremely long latencies.

Then other servers came along like Nginx and Lighttpd that run on an async event model. Instead of topping out at serving 5000 connections badly, you could suddenly support 70,000 concurrent connections on the same server, and those connections respond with much better latency.

Back to Node.js: If you’re not doing a huge amount of processing in JavaScript, the speed of Java vs JavaScript is mostly irrelevant. The biggest difference will be in the event model. And the event model in Node is the current best practice. Given that, NodeJS is de facto faster, unless you can write your Java code with an async event model.

Python, on the other hand, is so much slower than V8, the JIT compiler used in NodeJS, that even when attempting async development I would expect NodeJS to be faster.

Finally, Go, Google’s system language, compiles down to speed on the same order as C (so faster than Java), but its default event model is async. So for your most performance critical microservices, Go is a good option. But JavaScript should be fine for most things.

* You can write code that uses an async event model in Java, but I’ve never seen anyone do it, and it doesn’t seem to be the standard way to approach problems in Java. I’ve at least encountered people who use an async model in Python, but the language and ecosystem aren’t set up to support it. In NodeJS, the support is baked in.

src: https://www.quora.com/How-fast-is-node-js

Enjoyed reading, Don’t forget to share.

 

Now as you know one or two things about MEAN stack, Go and Build something amazing and share it with the community.

About the author

VithalReddy.M.B

Vithalreddy.M.B is the Editor of VMRworld.com & stackFame.com with a focus on startups, Startup News, Business, and Technology.He is also an Electrical & Electronics Engineer, Technology Lover, and Entrepreneur by choice.Started His first startup at 21.