Subscribe / Unsubscribe Enewsletters | Login | Register

Pencil Banner

MEAN vs. LAMP for the future of programming

Peter Wayner | June 23, 2015
LAMP diehards take note: The flexible simplicity of MongoDB, ExpressJS, AngularJS, and Node.js is no joke

MongoDB, on the other hand, offers a document structure that is far more flexible. Want to add a new bit of personal information to your user profiles? Simply add the field to your form, roll it up with the rest of the data in a JSON document, and shove it into your MongoDB collection. This is great for projects in flux and for dealing with data that may ultimately prove tricky to constrain in table form.

Disk space is cheap

Among the great revelations of relational databases was the JOIN command. With JOIN, we could save disk space by removing repeated fields like city, state, and ZIP code. By storing this frequently accessed and repeated data in separate tables that can be included in future results through a JOIN, we keep our database tidy and our disks slim.

But JOINs can be tricky for some and hard on RAM, and though it's still a good idea to isolate and access data in separate tables through JOINs, there's not as much need to save disk space now that disk drives are measured in multiple terabytes. The space is so cheap that some database designers end up denormalizing their data because the JOINs are too slow. Once you do that, you don't need a relational database as much. Why not use MongoDB instead?

Node.js simplifies the server layer

Navigating the various layers of the LAMP stack can be a difficult dance of many hats, one that has you shuffling through various config files with differing syntax. MEAN simplifies this through use of Node.js.

Want to change how your app routes requests? Sprinkle in some JavaScript and let Node.js do the rest. Want to change the logic used to answer queries? Use JavaScript there as well. If you want to rewrite URLs or construct an odd mapping, it's also in JavaScript. The MEAN stack's reliance on Node.js put this kind of pipework all in one place, all in one language, all in one pile of logic. You don't need to reread the man pages for PHP, Apache, and whatever else you add to the stack. While the LAMP generation has different config files for everything, Node.js avoids that issue altogether. Having everything in one layer means less confusion and less chance of strange bugs created by weird interactions between multiple layers.

MEAN makes code isomorphic

The simplicity doesn't stop with using JavaScript on the server. By going MEAN, you can enjoy that same JavaScript on the client, too, leaving behind the LAMP stack's client/server schizophrenia. If you write code for Node and decide it's better placed in AngularJS, you can move it over with ease, and it's almost certain to run the same way. This flexibility makes programming MEAN-based apps significantly easier. Plus, if you're staffing up a project, you don't need to look for a PHP expert and a JavaScript expert, or a front-end and a back-end specialist. Instead, it's all JavaScript across the stack.


Previous Page  1  2  3  4  Next Page 

Sign up for MIS Asia eNewsletters.