More About MEAN Stack You Want to Know!

A latest technology to the old-fashioned LAMP/WAMP stack for building professional websites and real-time applications is MEAN (MongoDB, Express, AngularJS, Node.js) stack, which is an open-source software.

MEAN is nothing but a rearrangement of code and technology upgrades switching the base platform from Linux OS to a JavaScript run-time which brings Node.js. Node.js allows to work on Windows as well as Linux. It acts as a web server which replaces Apache in LAMP stack. It allows the developer to deploy the application directly to the server instead of deploying to a stand-alone server. Deployment is easier and simpler as such the required version of the web server is clearly defined along with the rest of run-time dependencies. In short, Node.js is far more than a simple server.

Compared to traditional web-serving techniques where each connection (request) generate a new thread, taking up system RAM and eventually maxing-out at the amount of RAM available, Node.js operates on a single-thread, using non-blocking I/O calls, allowing it to support tens of thousands of concurrent connections (held in the event loop). Additionally, it is all based on the open web stack (HTML,CSS and JS) running over the standard port 80. In simple, it is really scalable.

It is very important to think that Node.js is especially suited for applications that require persistent connection from the browser back to the server such as chat programs, interactive games, real-time applications etc. If one is just building an application that does not necessarily need user/server COMMUNICATION, developing with other frameworks would be just fine and will take much less time. Node.js is well suited for applications that have a lot of concurrent connections and each request only needs very few CPU cycles, because the event loop (with all the other clients) is blocked during execution of a function.

Instead of writing more SQL commands, MongoDB gives more time writing map/reduce functions in JavaScript. MongoDB, a NoSQL which is schemaless, document oriented persistence represents a fundamental shift in steadfastness strategy. It will also reduce the complexity of transformation logic, because MongoDB release JavaScript Object Notation (JSON) natively. Consequently, writing RESTful web services is easier than ever.

But the biggest shift from LAMP to MEAN is the move from traditional server-side page generation to a client-side single-page application (SPA) orientation. It runs JavaScript, so you can use the same language on server and client, and even share some code between them (e.g. for form validation, or to render views at either end.)

With Express, you can still handle server-side routing and page generation, but the emphasis is now on client-side views, courtesy of AngularJS. This change involves more than simply shifting your Model-View-Controller (MVC) artifacts from the server to the client. And perhaps most important, you’ll move from a page-centric view of your application to one that is component-oriented. MEAN stack isn’t mobile-centric. AngularJS runs equally well on desktops and laptops, smartphones and tablets, and even smart TVs. And as the MEAN stack is growing in adoption, a variety of testing strategies have developed and available. With world-class testing frameworks such as MochaJS, JasmineJS, and KarmaJS, you can write thorough, comprehensive test suites for your MEAN app.

The single-threaded event-driven system is fast and simple, compared to traditional Java or ROR frameworks, when handling lots of requests at once. Knowing more about MEAN helps you to play around with the technology!

Leave a comment

Your email address will not be published.