So we have decided to embrace the MEAN stack as the official development stack for all Newicon projects going forward, and where possible update and upgrade projects to use these technologies where appropriate. what is MEAN? MEAN stands for MongoDB, Express, AngularJs and Node.js. The most important technological change for us however is the official […]
So we have decided to embrace the MEAN stack as the official development stack for all Newicon projects going forward, and where possible update and upgrade projects to use these technologies where appropriate.
MEAN stands for MongoDB, Express, AngularJs and Node.js. The most important technological change for us however is the official adoption of Node.js as our server side programming language and general tool of choice when building apps, servers, background workers, processes, build tools, test tools and other widgets and wonders. PHP is a great language and very ubiquitous throughout the web, but it is starting to sigh and moan when we try and squeeze it into non-PHP-sized holes. Developing easy to scale real time applications in PHP, though not impossible, does become difficult. Node makes this very easy.
Node allows you to write server side applications using javascript. It releases javascript from the shackles of the web browser. Due to its non-blocking architecture it is generally faster and more scalable than a lot of other server side technologies. You can find out more on the Node.js website. I could quite easily go off on a tangent here comparing all the pros and cons of Node development over a more traditional approach but I think we should leave that for another blog post.
AngularJs is an open source client side javascript framework developed and maintained by some smart people at Google. This framework has been creeping into our projects for a little while now and quite a few of our projects have front end parts powered by AngularJs. Angular have solved a lot of the development issues when creating reusable, maintainable and testable client side applications powered by javascript. The additional commitment here is to embrace Angular as our framework of choice for building client side applications. One of the great things about Angular is its powerful directives that evolve into domain specific language keeping things highly reusable, testable and awesome.
MongoDB is a document oriented database. It enables you to store documents (comparable to database records) in JSON format (actually BJSON, which stands for Binary JSON). JSON stands for JavaScript Object Notation. It is a format that JavaScript natively understands. With our server side code written in javascript (powered by Node), and our client side applications also in javascript, it makes sense to use a database with a JavaScript flavour. Furthermore often the response of the server is desired to be in JSON too, cutting down unnecessary data manipulation code.
Again we could easily talk all day about Mongo and fill another few blog posts. The important thing here is to note that while we will be (and have been) using Mongo for some of our projects, we are not making a huge blanket commitment to throw out our old databases. Relational databases such as MySQL have been around for more than 30 years and they certainly have their place. Really it’s just a matter of the goals the application is trying to achieve. Some times it may be better to use Mongo, sometimes it may still make sense to use MySQL, but luckily for us this doesn’t effect our acronym! So the “M” in “MEAN”, for us, really stands for (Mongo/MySQL).
…and finally…
Express is a light weight framework built in Node.js that makes it easy to build web apps and simple http servers. This is nice because during development you don’t have to worry about an additional server technology, as is true with the LAMP stack where you must have the Apache server running. I certainly see a trend for us phasing out Apache in favour of pure Node.js implementations and a move towards Nginx as a lightweight fast server to route to different node processes and serve static content, but again this is probably a post for another time.
So what does all this really mean (I couldn’t resist)?
Ignoring the actually nitty gritty tools and frameworks this really marks a step change in how web applications are built, and we have decided to start actively pushing this approach.
“don’t concern the server with the boring details of building the user interface”
It is up to the connecting application (the client application that subscribes to data the server produces) to render the appropriate visual representations. This is especially true when considering all the various devices and content we are beginning to expect. The data from our application could be shaped onto huge dashboard screens, or surface touch screens, or tablets, or mobile phones, or desktop computers, or even internet enabled devices in the home. Additional clients could be other servers listening in and aggregating the data for use in search feeds, or pattern recognition and predication engines, or merging with other tools. Essentially, a potentially unlimited plethora of devices so it does make sense to abstract at the common intersection they all share, the internet.
Basically, and simply, because of browser limitations. Browser limitations have prevented serious client side applications in the main stream for a long time. But we are travelling out of this miserable tunnel of doom and basking in the full radiance of shiny powerful and modern browsers.
With Microsoft dropping support for Windows XP in April this year discouraging the use of IE6 and IE7 we have probably gone past the tipping point. No doubt we will likely be burdened with IE8 for months to come but Microsoft are onboard and promoting upgrading to latest IE browser versions to keep up with Chrome and Firefox, and to support their movement into the cloud with Office 365 and their other cloud offerings. This means a wide spread adoption of javascript and HTML5 technologies, essential client side web technologies. Everything is racing towards Javascript and HTML5.
Of course full feature client side applications may still not suit every project however we aim to make this the de facto standard way to build apps.
People talk about lots of different methodologies, and I want to avoid going off on a big rant that could fill a book. However separating web based application development into a server side application component and a client side application, means the natural flow of development starts with developing the API first. This becomes a much more streamlined way of building applications.
This is an exciting time, especially with Google and Microsoft all embracing the cloud and the essential technologies that this involves, particularly javascript. So whether you love the language or not, it is certainly here to stay and will continue to become more and more prominent as things inevitably continue their march into the cloud creating an ever more connected world. Javascript we salute, and embrace you!
Subscribe to get our best content. No spam, ever. Unsubscribe at any time.
Send us a message for more information about how we can help you