Flask vs Yii: What are the differences?
Developers describe Flask as "a microframework for Python based on Werkzeug, Jinja 2 and good intentions". Flask is intended for getting started very quickly and was developed with best intentions in mind. On the other hand, Yii is detailed as "A high-performance PHP framework best for developing Web 2.0 applications". Yii comes with: MVC, DAO/ActiveRecord, I18N/L10N, caching, authentication and role-based access control, scaffolding, testing, etc. It can reduce your development time significantly.
Flask can be classified as a tool in the "Microframeworks (Backend)" category, while Yii is grouped under "Frameworks (Full Stack)".
"Lightweight" is the top reason why over 261 developers like Flask, while over 36 developers mention "Open source" as the leading cause for choosing Yii.
Flask and Yii are both open source tools. It seems that Flask with 45.2K GitHub stars and 12.7K forks on GitHub has more adoption than Yii with 4.86K GitHub stars and 2.22K GitHub forks.
Netflix, reddit, and Lyft are some of the popular companies that use Flask, whereas Yii is used by 180vita, Lulo, and Utrip. Flask has a broader approval, being mentioned in 511 company stacks & 531 developers stacks; compared to Yii, which is listed in 58 company stacks and 32 developer stacks.
What is Flask?
What is Yii?
Need advice about which tool to choose?Ask the StackShare community!
Sign up to add, upvote and see more prosMake informed product decisions
What are the cons of using Yii?
Sign up to get full access to all the companiesMake informed product decisions
Sign up to get full access to all the tool integrationsMake informed product decisions
Unlike our frontend, we chose Flask, a microframework, for our backend. We use it with Python 3 and Gunicorn.
One of the reasons was that I have significant experience with this framework. However, it also was a rather straightforward choice given that our backend almost only serves REST APIs, and that most of the work is talking to the database with SQLAlchemy .
We could have gone with something like Hug but it is kind of early. We might revisit that decision for new services later on.
Of all PHP frameworks, my best and only choice is Yii . Think of this: you have a MySQL database, it contains several tables. Now you want to setup a PHP-MVC site, firstly, you must create Models, Yii have a very handy tool called Gii, you can easily create model with Gii just by one click, Gii will read your database table columns and create PHP models automatically for you. Now you need Controller, still with Gii, it will automatically create all 4 php files for you with Insert/Delete/Update/Select even with Search function.
Well, now the most modern way is to have a RESTful API, that's even easier with Yii, you even don't need to care about all the columns, just 4 lines of code you can expose your database table as RESTful API with all GET/POST/PUT/DELETE support, even you change your database table columns, you don't need to change any PHP code.
For security, Yii have embedded authentication and RBAC support. For multi language, Yii have embedded i18n support, all with out-of-box. Just play with it, I bet you will love it.
We are in the process of building a modern content platform to deliver our content through various channels. We decided to go with Microservices architecture as we wanted scale. Microservice architecture style is an approach to developing an application as a suite of small independently deployable services built around specific business capabilities. You can gain modularity, extensive parallelism and cost-effective scaling by deploying services across many distributed servers. Microservices modularity facilitates independent updates/deployments, and helps to avoid single point of failure, which can help prevent large-scale outages. We also decided to use Event Driven Architecture pattern which is a popular distributed asynchronous architecture pattern used to produce highly scalable applications. The event-driven architecture is made up of highly decoupled, single-purpose event processing components that asynchronously receive and process events.
To build our #Backend capabilities we decided to use the following: 1. #Microservices - Java with Spring Boot , Node.js with ExpressJS and Python with Flask 2. #Eventsourcingframework - Amazon Kinesis , Amazon Kinesis Firehose , Amazon SNS , Amazon SQS, AWS Lambda 3. #Data - Amazon RDS , Amazon DynamoDB , Amazon S3 , MongoDB Atlas
To build #Webapps we decided to use Angular 2 with RxJS
#Devops - GitHub , Travis CI , Terraform , Docker , Serverless
Flask is a light, yet powerful Python web framework perfect for quickly building smaller web applications. It's a "micro-framework" that's easy to learn and simple to use, so it's perfect for those new to web development as well as those looking to rapidly develop a web application.
I use Flask for times when I need to create a REST API that interfaces with other Python code, or there is no specific reason why I'd want to use Node.JS. I prefer Flask because of its small learning curve, allowing me to get started coding as quickly as possible
This lightweight web framework enables quick REST API development while enabling easy clustering, and the usage of multiple worker processes required to scale the REST API service to meet high volume requirements.
Service to query NOAA weather forecasts data and service to build tidal current forecast maps using AWS EC2 and Geoserver
Flask drives our APIs, both the Website APIs and the majority of the REST Messaging APIs