Welcome to Node.js: Part 0 – Intro to LAMP and MEAN
June 10, 2014
My name is Nate, and I’m a Node.js newb. I’ve been asked to dive into Node.js and it’s surrounding environment of technologies, and to give an ant’s eye view of the learning process. I’ve heard the rumors, and witnessed a demonstration or two. This is the Next Big Thing in web development.
While I hack away at the task before me, I will invariably make mistakes, run off into tangential topics, and generally make a mess. I’ll do my best to clean it all up and share the most important bits with you here on the blog. Comments, complaints, and constructive criticism are always welcomed and appreciated.
Before we dive into the bigger and better, we need to review the tried and true. Here, I will summarize the current, predominant environment and tools used in web development, known as the LAMP stack. Once we know what groundwork exists, we can look at what exactly Node.js will be building upon and/or changing.
LAMP is an acronym for a suite of open source (free) software components: Linux, Apache, MySQL, and Perl (and/or PHP, Python, etc.):
- Linux is, of course, the open source operating system available for free and used dominantly in all manner of business “work,” such as servers, mainframe computers, and supercomputers. Even Android, the increasingly popular operating system for mobile (and other) devices, is built around the Linux kernel. Obviously, the rest of the items in the acronym run in Linux.
- Apache is a web server application that played a monumental role in the development of the modern World Wide Web. It is still used to serve the lion’s share of all active websites.
- MySQL Relational Database Management System (RDBMS) is basically used to construct and access databases, from the small to the almost incalculably large.
- Perl, PHP, and Python were successively developed programming languages, each offering a different benefit in the communication between a user’s browser and the external application running on the server. By various, often complicated methods, these languages allowed for interactive or dynamic components on a given web page.
The LAMP stack has been effectively used to build database driven, dynamic websites like WordPress and Wikipedia. Using a database (MySQL) run on a Web server (Apache) and accessed through methods available with dynamic software components (Perl, Python, PHP), a large amount of data can be parsed quickly and precisely, and can be displayed in a useful manner.
Of course, not discussed here are a few million more details, nuances, quirks, and other tools involved in the rise of the modern Web and still used with great success today. But there is one more development to understand before addressing Node.js.
A complicated set of translations must be made for every instruction passed between client and server, and for every data element returned from server to client. This constant halting and translation of the “conversation” between server and client is not only slow, but often introduces unforeseeable errors and further complicates the process with bugs. And once the responsibility for a given function has been relegated in code to the client or server, the decision cannot be reversed without rewriting the corresponding code in the corresponding language(s). It’s become obvious that standardizing interactions between server and client will become increasingly necessary for the smooth, fast operation of our evolving Web.
Node.js and everything around it are mutating rapidly with constant updates and modifications. It’s not as bad as it sounds, however, because it means it’s all getting a lot of attention, and functionality is increasing quickly. For now, the biggest chunk to know is the MEAN stack, which stands for MongoDB, Express, AngularJS, and Node.js:
- Express is a “Web application framework for Node.” I’m still a little fuzzy on what exactly a framework is, so from Wikipedia, “A software framework is a universal, reusable software platform to develop software applications, products and solutions. Software frameworks include support programs, compilers, code libraries, tool sets, and application programming interfaces (APIs) that bring together all the different components to enable development of a project or solution.” We’ll figure this one out together, later.