2. Why Meteor ?
If you’re in a hurry, you can safely skip this chapter and head straight to the Beginning with Meteor chapter. This Why Meteor chapter is there for those that want to know why Meteor should be used.
2.1 How I felt in love with Meteor
I’ve been coding a lot of data-centric applications using various technology stacks. They usually involve displaying and updating data from some store (mainly a database) through a user interface and APIs, adding some functional logic in the way.
Problem is: most technology stacks involve writing quite some code for basic things, and often require different coding logics on the client and server.
One of my clients presented me with a challenging application to build. After rough evaluation of the time needed, writing a proof of concept required dozens of days. That was too much, so I took a full day and looked for available technology stacks. By the end of the day I stumbled upon Meteor. It promised a lot, but would it hold to its promises?
Well, it did. In five days I had the proof-of-concept coded and deployed on a staging server. A few days later it appeared that Meteor could also meet the requirements for another client’s project, except that the requirements needed low-level network I/O. Turns out Meteor allowed me to leverage Node.js in a breeze, and I had the first draft running in hours.
I love tools that make me productive for common tasks while also allowing for greater power and customization when needed. Meteor does just that, providing simple ways to answer most requirements of today’s applications.
2.2 Why is Meteor so productive?
Meteor makes writing applications a much faster process than many other Javascript environments. Here are some of the reasons why:
- Everything a developer needs is installed in a breeze, on any major OS (Linux, Windows, OS X);
- JavaScript code on the server and client, some of the code may even be shared between the two;
- Native support for MongoDB collections (if you don’t know MongoDB we’ll talk about it a bit later);
- Automated synchronization of the data between client and server;
- Very little code to write;
- Most of the functionality a developer usually needs is provided as easy-to-install packages;
- A very helpful command-line utility.
- Out-of-the-box effortless minification and file combine;
- Simple creation of packages;
- Integrated debugging of server code right in the browser;
- Straightforward unit-testing of created packages.
2.3 Where is the catch?
Too often you invest time and energy in a technology stack, only to find out its drawbacks a while later.
After some extensive use, Meteor drawbacks came when deploying. This is personal experience, but I was faced with two problems.
First, as long as you are willing to host your apps in Meteor’s cloud solution (Galaxy), everything goes well. If you want to host Meteor apps in your custom environment, you’d better use a Linux machine. In which case things go quite smoothly when you don’t require a server farm.
As of writing, deploying to a production Windows server was so difficult that I stopped in the process. That’s a real pain, to say the less. This is strange since the Meteor team worked hard to bring excellent support for developing on a Windows environment. However, my problems were solved when using Docker for deployment. Dockerized Meteor applications can be deployed on any platform that support Docker, which means Linux, Windows or cloud with no surprise.
Second, the applications deployed had performance problems. There are many things that can be done in order to improve Meteor application performance, but it’s quite a disappointment to spend a lot of time on performance improvements when the development stage was so quick.
All in all, though you can learn Meteor very quickly (that’s the purpose of this book), bear in mind that fully understanding Meteor takes time. It’s a quick way to create applications thanks to bold assertions from the Meteor stack and many things going on under the hood. You’ll be able to create great Meteor applications within a few days, but you’ll need to invest some time to fully understand Meteor’s engine.
What I mean is that most tasks that usually take hours of coding will take minutes using Meteor, but during the first days be prepared to get stuck several times on some documentation reading. All in all you should gain a lot of time anyway, but you’ll need to invest yourself in order to really master the Meteor stack.