MeteorJS is one of the most talked-about Node.js frameworks on the scene. So where does it fall in the Node.js framework landscape, and is it the right choice for your MEAN-powered application?
First, why would you choose one framework and not another?
In the world of frameworks, choosing the one that’s right for your application can be daunting. There are pros and cons, full-stack vs. minimalist, API-driven or data-driven. Frequently, when a developer chooses one framework (and programming language) over another, it’s to meet a specific engineering requirement for the app. And most often, they’re striking a balance between speed of development and flexibility.
There’s no one-size-fits-all with frameworks, so it’s important to choose the one that meets the most hard-and-fast requirements for your app.
Let’s take a closer look at why so many developers are looking to this full-stack, MVC-style framework for fast development of responsive, real-time applications.
METEORJS BASICS
The key to Meteor is hinted at right in its name: speed. If you’re looking to rapidly develop smaller, reactive applications on the Node.js platform, Meteor is definitely an excellent choice.
Meteor is a full-stack, highly opinionated MVC framework for Node.js that’s a little less flexible than a more lightweight framework like ExpressJS. If you’re working with a MEAN stack (or any variation of it that includes the Node platform), bringing Meteor into your software stack is going to help you accelerate the development of iOS, Android, and web applications.
It uses a mix of front-end JavaScript that runs in the browser, back-end JavaScript that runs on a Meteor server within a Node.js container, and any other HTML, CSS, and static assets to create highly reactive user interfaces (UIs)—the kind that update information within the UI without having to hit refresh. This is the kind of UI users have come to expect, and for many companies, it’s the number one technical requirement they have for their apps. Also, it integrates with Apache Cordova, AngularJS, React, and MongoDB.
So why do developers love it? Here are a few of its biggest pros.
It’s full-stack.
This is one way of saying Meteor comes with a ton of integration, support, and features right out of the box. The advantage here is that Meteor has already assembled the compatible parts of the stack for you, from the database integrations to the front-end framework. It has a default technology for every layer of its stack, but these are interchangeable if you’re looking for alternatives. You’re not locked in if you prefer swapping one technology for another. For example, Meteor’s default front-end framework Blaze can be swapped for React or AngularJS.
Meteor is a highly opinionated framework, which is developer-speak for being a little less flexible—a trade-off when you’re working with so much scaffolding and features right out of the gates. Again, the benefit here is speed. What it lacks in minimalism it makes up for in fast development turnarounds, and having a fully integrated stack up front lets you get going on your project a lot faster.
It’s fast.
Meteor’s speed comes from its ample scaffolding, libraries, and excellent community-authored packages that make up for most shortcomings or holes in requirements. Also, it takes care of a lot of the tedious, small tasks developers have to carry out, which enables them to focus more on the business logic and functionality of the end result. Like most frameworks, Meteor keeps you from having to reinvent the wheel every time you’re crafting a back end.
Also, you can easily deploy your Meteor applications to the cloud with its subscription-based cloud deployment service, Galaxy.
It’s reactive, and creates the real-time updated UIs that modern app users expect.
Real-time capabilities are huge for apps like social networking sites or collaborative apps where users want updates shared right as they’re happening. Many traditional web apps required a refresh button, which can be tedious. If you can picture the users of your app having to click refresh often, Meteor is probably going to be your best bet. That, and, real-time is what people are used to when it comes to mobile apps.
From a technical standpoint, Meteor is reactive because of its methods for refreshing data. To refresh the data in the UI, it replicates a subset of the MongoDB database in the browser as a local “miniMongo” subset. Any updates to data will happen live in your app, on your user’s screen. This is partly possible thanks to Meteor’s MVC model. Meteor is able to render refreshed data (the model) right in the browser (the view) without making a trip back to the server. By processing the HTML in the browser, the user sees an updated UI while Meteor loops back to the server to make modifications in the actual database.
Where Node on its own can lack in serving up dynamic web content, Meteor steps in and makes it faster and more fluid. The key is that it overrides Node’s module-based system and uses its own packaging system.
Meteor is reactive on the programming side, too, so developers can get more done with less lines of code.
Its built-in integration with Apache Cordova offers immense business value.
With Apache Cordova built into the latest release of Meteor, you can easily build your app to be cross-platform for Android, iOS, or the web with only one codebase. Going cross-platform over native is a great option for businesses that want the feel and functionality of native apps, but don’t want to spend the time or budget to create two separate codebases for separate operating systems or devices.
It’s well-supported—both by the MDG team and a growing community of developers.
From a production standpoint, the Meteor Development Group (MDG) is a great team who stands behind Meteor and is dedicated to keeping it updated and working well. There’s no risk of a developer who created the framework moving on from the project or neglecting to keep it updated—MDG is on top of the health of the Meteor ecosystem.
But the developers who use Meteor have contributed to its growth and longevity, as well. The community behind it is constantly creating packages that extend Meteor’s functionality. MDG has invested a lot not only in the technology itself, but in cultivating this community behind it. There are packages for everything from API functions like login, authentication, and oauth authorization to router packages like the widely used iron:router.
This big community of developers is able to help one another troubleshoot problems of every kind. With a crowd that big behind it, it’s rare to run into a problem during development that someone else hasn’t already seen, fixed, and shared a solution for.
It’s got plenty of libraries and packages to extend its functionality.
A lot of Meteor’s code is built on the jQuery JavaScript library and the Underscore.js framework as the foundation for more common tasks. MeteorJS’s front-end development is handled by proprietary libraries like Blaze and Tracker. It’s similar to Express with many of the same “internals,” and recent releases embed a package manager so you don’t have to install the third-party package system, Meteorite.
Now, Meteor makes it easy to install third-party packages. Check out Atmosphere.js for the best Meteor packages—it’s a total catalog for libraries that are reliable, up-to-date and popular among other Meteor developers.
A few considerations before you dive in.
The Meteor community is always working to make up for shortcomings in the framework, but remember: a framework is often designed to do one or more things very well. You have to decide where you want to compromise, and what you need from it. That said, there are a few things to consider with Meteor before giving it a go.
It only integrates with the MongoDB database. That means no support for SQL databases. Also, historically there have been issues using Meteor with a pre-existing MongoDB installation.
If your app is going to get big, you may need a more scalable stack than Meteor. There are some developers who say Meteor’s biggest strength is for messaging apps. But if you anticipate a lot of growth in users, traffic, and data or need a more robust app, you may want to look into a more robust solution.