When comparing Sails.js vs Mach, the Slant community recommends Sails.js for most people. In the question“What are the best node.js web frameworks?” Sails.js is ranked 4th while Mach is ranked 11th. The most important reason people chose Sails.js is:
Sails.js is built with a focus on building real time communication apps such as chat or multiplayer games, so naturally it has Socket.io extremely well supported.
Specs
Ranked in these QuestionsQuestion Ranking
Pros
Pro Transparent support for Socket.io
Sails.js is built with a focus on building real time communication apps such as chat or multiplayer games, so naturally it has Socket.io extremely well supported.
Pro MVC architecture
This could be a huge plus, if you prefer to build your apps using the Model View Controller architecture. Using Sails.js you'll find the task of separating the business logic from the user interface and keeping the interactions between them in a separate layer, extremely easy.
Pro JSON API generated for free
Exposes public JSON API for free. No additional routing to be defined. Makes it pretty easy to access data from anywhere.
Pro ORM that can be plugged into any database, or even custom web service
Sails.js uses Waterline ORM at its backend which means you can store your data in any datastore that you like; all you have to do is make a change to the Waterline adapter, this will allow you to store your data in MySQL/Redis or any other kind of database.
Pro So easy to deploy and lift
Pro Great documentation and structure
Clear documentation and easy to understand. The file structure gives you a way to understand where you can start to develop when you encounter a new Sails project
Pro Streaming
Mach has some pretty cool streaming functionalities built directly into it, if your web app provides any audio/video/data streaming features, you can consider using Mach to build it.
Pro Composability
Since Mach already is asynchronous (stateless) which means your logic is implemented by using promises (then objects
); hence your functions are pretty independent and composable.
Pro Simplicity
No complex layers between plain HTTP requests and the corresponding JS functions invoked. Which in turn means each GET/POST/PUT or any other HTTP request is directly mapped to a Javascript function. Hence leading to a huge increase in performance for your app
Pro Robust
One of the distinguishing features of Mach is it's robustness, errors won't be terminating your complete app, instead they'll bubble up so you can handle them gracefully.
Pro Asynchronous
Like most of the Node.js's core, Mach is an asynchronous web framework too. Each response (of a request) can simply be hooked up to a then
method so that its result or the reason for failure can be retrieved after the action is complete. If you're wondering what async operations are, here's a pretty good explanation for you
Cons
Con Poor ORM
The built-in Waterline is not well designed and is not suitable for production environments. Populating more than 1 level deep is a nightmare, there is no transaction support, new features/bug fixes are not implemented anywhere near a timely manner (the most requested feature 'deep populate' has been lingering in their github issues list for over a year and a half now).