When comparing Sails.js vs Flask, the Slant community recommends Flask for most people. In the question“What is the best web application framework?” Flask is ranked 6th while Sails.js is ranked 9th. The most important reason people chose Flask is:
Even though it's pretty minimalistic out of the box, Flask still provides the necessary tools to build a quick prototype for a web app right after a fresh install. With all the main components pretty much packed in the `flask` package, building a simple web app in a single Python file is as easy as it gets.
Ranked in these QuestionsQuestion Ranking
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 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 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 Extremely easy to build a quick prototype
Even though it's pretty minimalistic out of the box, Flask still provides the necessary tools to build a quick prototype for a web app right after a fresh install. With all the main components pretty much packed in the
flask package, building a simple web app in a single Python file is as easy as it gets.
Pro Lots of resources available online
Flask is one of the most popular Python web frameworks, if not the most popular one. As such, there's plenty of guides, tutorials, and libraries available for it. A large number of important Python libraries, such as SQLAlchemy have libraries for Flask, which add valuable bindings to make the development process and the integration between these libraries and Flask as easy as possible.
Pro Minimalist without losing power
Flask is very easy to get up and going, with vanilla HTML or with bootstrap pieces. It doesn't take much lines of Python to load Flask to get headers working, etc, and since it's all modular you don't have to have something you don't want in your application.
Pro Very flexible
Flask gives developers a lot of flexibility in how they develop their web applications.
For example, the choice of not having an ORM, but instead choosing one suited to the task, or another area where Flask gives a lot of options to developers is the templating. They can use Jinja2, Flask's default templating language or choose from a number of different templating languages they desire.
Pro Great documentation
The official documentation is very thorough and complete. Everything is explained in-depth and followed by extremely well-explained tutorials that tackle real-world problems.
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).
Con Not async-friendly
Flask is explicitly not designed to handle async programming.
Con Threadlocals and globals used everywhere
The default way of creating applications in flask makes it hard to use reusable and clean code.
Con Setting up a large project requires some previous knowledge of the framework
Setting up a large project with Flask is not that easy considering how there's no "official" way of doing it. Blueprints are a useful tool in this regard but require some additional reading and are a bit tricky to get right for a beginner.
The lack of some defaults can also be problematic. Having to choose between different libraries for a certain task is never easy, especially if you have never worked with Flask before.