SlideShare une entreprise Scribd logo
1  sur  19
Télécharger pour lire hors ligne
Baltimore Innovation Week 2015
Python in the Cloud:
Django vs Flask
Alex Viana (@AlexVianaPro)
Terbium Labs (@TerbiumLabs)
and
Terbium Labs
❖ Terbium Labs is a Baltimore-based data intelligence
company. Our product, Matchlight, allows customers to
monitor the dark web for stolen data.
❖ Matchlight is primarily written in Python, running on
AWS.
Motivation
❖ Django and Flask are the two most popular Python web
frameworks.
❖ We use both frameworks to fill different roles in our
work at Terbium Labs.
❖ It was surprisingly difficult to come to a firm decision
that this was the right direction.
❖ This talk is about what we learned in the process and
how it informed our decision.
Flask
❖ Flask is what the majority of our services runs on.
❖ Flask is a bare-bones Python web “microframework”.
❖ It’s great for building lightweight apps or
“microservices”.
❖ How lightweight? How Mirco?
Flask is Light
“Flask will never have a database layer. It will not have a form
library or anything else in that direction. Flask itself just bridges
to Werkzeug to implement a proper WSGI application and to
Jinja2 to handle templating. It also binds to a few common
standard library packages such as logging. Everything else is up
for extensions.”



- Flask Documentation

http://flask.pocoo.org/docs/0.10/design/#what-flask-is-what-
flask-is-not
Flask’s Hello World
from flask import Flask

app = Flask(__name__)



@app.route("/")

def hello():

return "Hello World!"



if __name__ == "__main__":

app.run()
Your Library as a Flask App
from flask import Flask

from my_module import important_function

app = Flask(__name__)



@app.route("/")

def hello():

results = important_function()

return results



if __name__ == "__main__":

app.run()
Flask in a Startup
❖ Don’t have to wrap your head around any new
framework patterns.
❖ Spend most of your time writing business logic not app
logic.
❖ Flask is excellent for the low-overhead rapid
implementation requirements start up development.
Issues with Flask
❖ On some of our larger REST API’s things got tricky.
❖ Lots of design considerations with side effects.
❖ Development was slowing down.
❖ Maybe Flask was the wrong choice? So we looked to
Django.
Django
❖ Django is far and away the most used Python web
framework.
❖ It’s the “batteries included” option: database ORM,
forms, admin interface, etc.
❖ But this means stopping everything and learning a new
framework. How do we know this is the right choice?
Python vs Django
❖ A little Googling on the internet give you something like
this:
❖ Django is for more full-featured applications.
❖ Flask is for more simple apps and rapid prototyping.
❖ Easy! But our product is made up of REST-ful micro
services, shouldn’t Flask be perfect?
More Confusion
❖ Flask is deployed at LinkedIn, Pinterest, Twillio, and the
2012 Obama election campaign. That’s big stuff!
❖ Miguel Grinberg’s Flask book builds a blog app with data
migrations, unit tests, authentication, etc. Those are a lot
of features!
❖ On the other hand we have the Django REST Framework.
REST is pretty lean, right?
❖ So who’s right? How do we choose? The clock is ticking…
Enter Django REST Framework
❖ So we gave Django REST framework a try.
❖ Django REST seemed like a contradiction at first; Django
just seemed too heavy for an API.
❖ But, we realized there is a -lot- that goes into a REST API:
authentication, serialization, permissions, data model,
queries, testing, pagination, …
❖ Then we had our breakthrough…
Flask and Django
❖ Think of Flask as a web framework framework!
❖ Put another way, Flask is not your framework. You use
Flask to build your framework.
❖ Development was slowing down because we weren’t
building our product, we were building our framework.
Flask as a Framework Framework
❖ In the “Hello World” case this is trivial, all you need is in
Flask, basically just a WSGI server.
❖ As you scale up you end up having to implement
everything yourself, a-la the Flask book.
❖ Once you deviate from that - you’re on your own.
❖ Which can be great! Unless it’s not.
Where Flask is Great
❖ This is why The Flask book is so great; it lays out all the
decisions for you.
❖ And this is why major projects can be written in Flask at
companies with deep resource and experience pools.
❖ And small project are a breeze because there’s literally
nothing else in the framework to think about.
❖ And this why everything in-between is so tough.
Building a Framework
❖ Is hard … just an FYI.
❖ Requires significant developer time.
❖ More importantly it requires informed opinions about
how your framework should work.
❖ Even beyond that it requires knowledge about what
decisions have to be made and how they interact.
Final Remarks
❖ The driver for improving our technology stack was a
sense we were working against, not with our tools. Don’t
ignore that, it’s a clue something is wrong.
❖ Once we realized the pain points and benefits of both
systems we could confidently select different tools for
different jobs. Don’t underestimate the impact of this.
❖ Both are great projects, we’re indebted to both teams.
Thank you for your attention.
Questions?

Contenu connexe

Tendances

Front-End Modernization for Mortals
Front-End Modernization for MortalsFront-End Modernization for Mortals
Front-End Modernization for Mortalscgack
 
Untangling - fall2017 - week 7
Untangling - fall2017 - week 7Untangling - fall2017 - week 7
Untangling - fall2017 - week 7Derek Jacoby
 
JS Fest 2019/Autumn. Eyal Eizenberg. Tipping the Scale
JS Fest 2019/Autumn. Eyal Eizenberg. Tipping the ScaleJS Fest 2019/Autumn. Eyal Eizenberg. Tipping the Scale
JS Fest 2019/Autumn. Eyal Eizenberg. Tipping the ScaleJSFestUA
 
Dumb and smart components + redux (1)
Dumb and smart components + redux (1)Dumb and smart components + redux (1)
Dumb and smart components + redux (1)Brecht Billiet
 
Tipping the Scale - Eyal Eizenberg
Tipping the Scale - Eyal EizenbergTipping the Scale - Eyal Eizenberg
Tipping the Scale - Eyal EizenbergWix Engineering
 
Untangling - fall2017 - week5
Untangling - fall2017 - week5Untangling - fall2017 - week5
Untangling - fall2017 - week5Derek Jacoby
 
Untangling spring week6
Untangling spring week6Untangling spring week6
Untangling spring week6Derek Jacoby
 
(For non-developers) HTML5: A richer web for everyone
(For non-developers) HTML5: A richer web for everyone(For non-developers) HTML5: A richer web for everyone
(For non-developers) HTML5: A richer web for everyoneChris Mills
 
HTML5: what's new?
HTML5: what's new?HTML5: what's new?
HTML5: what's new?Chris Mills
 
WTF: Where To Focus when you take over a Drupal project
WTF: Where To Focus when you take over a Drupal projectWTF: Where To Focus when you take over a Drupal project
WTF: Where To Focus when you take over a Drupal projectSymetris
 
Untangling the web11
Untangling the web11Untangling the web11
Untangling the web11Derek Jacoby
 
Untangling the web week1
Untangling the web week1Untangling the web week1
Untangling the web week1Derek Jacoby
 
What were you thinking? Worst Translation Practices
What were you thinking? Worst Translation PracticesWhat were you thinking? Worst Translation Practices
What were you thinking? Worst Translation PracticesKeith Brooks
 
Untangling - fall2017 - week6
Untangling - fall2017 - week6Untangling - fall2017 - week6
Untangling - fall2017 - week6Derek Jacoby
 
My Dog Ate My Translation Assignment
My Dog Ate My Translation AssignmentMy Dog Ate My Translation Assignment
My Dog Ate My Translation AssignmentKeith Brooks
 
Untangling spring week2
Untangling spring week2Untangling spring week2
Untangling spring week2Derek Jacoby
 
Real World Windows 8 Apps in JavaScript
Real World Windows 8 Apps in JavaScriptReal World Windows 8 Apps in JavaScript
Real World Windows 8 Apps in JavaScriptDomenic Denicola
 
Untangling spring week3
Untangling spring week3Untangling spring week3
Untangling spring week3Derek Jacoby
 

Tendances (20)

The Final Frontier
The Final FrontierThe Final Frontier
The Final Frontier
 
Front-End Modernization for Mortals
Front-End Modernization for MortalsFront-End Modernization for Mortals
Front-End Modernization for Mortals
 
Untangling - fall2017 - week 7
Untangling - fall2017 - week 7Untangling - fall2017 - week 7
Untangling - fall2017 - week 7
 
JS Fest 2019/Autumn. Eyal Eizenberg. Tipping the Scale
JS Fest 2019/Autumn. Eyal Eizenberg. Tipping the ScaleJS Fest 2019/Autumn. Eyal Eizenberg. Tipping the Scale
JS Fest 2019/Autumn. Eyal Eizenberg. Tipping the Scale
 
Dumb and smart components + redux (1)
Dumb and smart components + redux (1)Dumb and smart components + redux (1)
Dumb and smart components + redux (1)
 
Tipping the Scale - Eyal Eizenberg
Tipping the Scale - Eyal EizenbergTipping the Scale - Eyal Eizenberg
Tipping the Scale - Eyal Eizenberg
 
Untangling - fall2017 - week5
Untangling - fall2017 - week5Untangling - fall2017 - week5
Untangling - fall2017 - week5
 
Untangling spring week6
Untangling spring week6Untangling spring week6
Untangling spring week6
 
(For non-developers) HTML5: A richer web for everyone
(For non-developers) HTML5: A richer web for everyone(For non-developers) HTML5: A richer web for everyone
(For non-developers) HTML5: A richer web for everyone
 
HTML5: what's new?
HTML5: what's new?HTML5: what's new?
HTML5: what's new?
 
WTF: Where To Focus when you take over a Drupal project
WTF: Where To Focus when you take over a Drupal projectWTF: Where To Focus when you take over a Drupal project
WTF: Where To Focus when you take over a Drupal project
 
Untangling the web11
Untangling the web11Untangling the web11
Untangling the web11
 
Untangling the web week1
Untangling the web week1Untangling the web week1
Untangling the web week1
 
What were you thinking? Worst Translation Practices
What were you thinking? Worst Translation PracticesWhat were you thinking? Worst Translation Practices
What were you thinking? Worst Translation Practices
 
Untangling - fall2017 - week6
Untangling - fall2017 - week6Untangling - fall2017 - week6
Untangling - fall2017 - week6
 
My Dog Ate My Translation Assignment
My Dog Ate My Translation AssignmentMy Dog Ate My Translation Assignment
My Dog Ate My Translation Assignment
 
Untangling7
Untangling7Untangling7
Untangling7
 
Untangling spring week2
Untangling spring week2Untangling spring week2
Untangling spring week2
 
Real World Windows 8 Apps in JavaScript
Real World Windows 8 Apps in JavaScriptReal World Windows 8 Apps in JavaScript
Real World Windows 8 Apps in JavaScript
 
Untangling spring week3
Untangling spring week3Untangling spring week3
Untangling spring week3
 

En vedette

k10715 ankit kr. verma (Case study)
k10715 ankit kr. verma (Case study)k10715 ankit kr. verma (Case study)
k10715 ankit kr. verma (Case study)shailesh yadav
 
Zigbee social network
Zigbee social networkZigbee social network
Zigbee social networkIntersog
 
Brand identity prism kepferer model
Brand identity prism kepferer modelBrand identity prism kepferer model
Brand identity prism kepferer modelSabil Ahammed
 
Eurotech contribution to the AGILE-IoT project
Eurotech contribution to the AGILE-IoT projectEurotech contribution to the AGILE-IoT project
Eurotech contribution to the AGILE-IoT projectAGILE IoT
 
Mao3D Prótese de mão feitas por impressão 3D (Slides expo3dbr 2016)
Mao3D Prótese de mão feitas por impressão 3D (Slides expo3dbr 2016)Mao3D Prótese de mão feitas por impressão 3D (Slides expo3dbr 2016)
Mao3D Prótese de mão feitas por impressão 3D (Slides expo3dbr 2016)Maria Elizete Kunkel
 
FIWARE-IoT-Broker-introduction
FIWARE-IoT-Broker-introductionFIWARE-IoT-Broker-introduction
FIWARE-IoT-Broker-introductiongesslers
 
Best Abraham Lincoln Quotes in Hindi
Best Abraham Lincoln Quotes in Hindi Best Abraham Lincoln Quotes in Hindi
Best Abraham Lincoln Quotes in Hindi www.aasaanhai.net
 
2016 07-20-demo session
2016 07-20-demo session2016 07-20-demo session
2016 07-20-demo sessionAGILE IoT
 
2016 07-20-wp4-q2 f2 f berlin
2016 07-20-wp4-q2 f2 f berlin2016 07-20-wp4-q2 f2 f berlin
2016 07-20-wp4-q2 f2 f berlinAGILE IoT
 
WORKSHOP DOING BUSINESS IN GERMANY: OPPORTUNITIES IN THE GERMAN ENERGY MARKET
WORKSHOP  DOING BUSINESS IN GERMANY: OPPORTUNITIES IN THE GERMAN ENERGY MARKETWORKSHOP  DOING BUSINESS IN GERMANY: OPPORTUNITIES IN THE GERMAN ENERGY MARKET
WORKSHOP DOING BUSINESS IN GERMANY: OPPORTUNITIES IN THE GERMAN ENERGY MARKETCristina Wasmeier
 
Internet of Things - Lu, Ralph
Internet of Things - Lu, RalphInternet of Things - Lu, Ralph
Internet of Things - Lu, Ralphralphlu
 
MOLTO poster for ACL 2010, Uppsala Sweden
MOLTO poster for ACL 2010, Uppsala SwedenMOLTO poster for ACL 2010, Uppsala Sweden
MOLTO poster for ACL 2010, Uppsala SwedenOlga Caprotti
 
BoldPM Insights Summary: Why Smart, Connected Devices Are Transforming Busine...
BoldPM Insights Summary: Why Smart, Connected Devices Are Transforming Busine...BoldPM Insights Summary: Why Smart, Connected Devices Are Transforming Busine...
BoldPM Insights Summary: Why Smart, Connected Devices Are Transforming Busine...Hector Del Castillo, CPM, CPMM
 
Agile Cloud Service Strategy using DevOps
Agile Cloud Service Strategy using DevOpsAgile Cloud Service Strategy using DevOps
Agile Cloud Service Strategy using DevOpsJason Stevenson
 

En vedette (17)

k10715 ankit kr. verma (Case study)
k10715 ankit kr. verma (Case study)k10715 ankit kr. verma (Case study)
k10715 ankit kr. verma (Case study)
 
Zigbee social network
Zigbee social networkZigbee social network
Zigbee social network
 
Everything is changing in IT
Everything is changing in IT Everything is changing in IT
Everything is changing in IT
 
Mapa conceptual
Mapa conceptualMapa conceptual
Mapa conceptual
 
Brand identity prism kepferer model
Brand identity prism kepferer modelBrand identity prism kepferer model
Brand identity prism kepferer model
 
Eurotech contribution to the AGILE-IoT project
Eurotech contribution to the AGILE-IoT projectEurotech contribution to the AGILE-IoT project
Eurotech contribution to the AGILE-IoT project
 
Mao3D Prótese de mão feitas por impressão 3D (Slides expo3dbr 2016)
Mao3D Prótese de mão feitas por impressão 3D (Slides expo3dbr 2016)Mao3D Prótese de mão feitas por impressão 3D (Slides expo3dbr 2016)
Mao3D Prótese de mão feitas por impressão 3D (Slides expo3dbr 2016)
 
FIWARE-IoT-Broker-introduction
FIWARE-IoT-Broker-introductionFIWARE-IoT-Broker-introduction
FIWARE-IoT-Broker-introduction
 
Best Abraham Lincoln Quotes in Hindi
Best Abraham Lincoln Quotes in Hindi Best Abraham Lincoln Quotes in Hindi
Best Abraham Lincoln Quotes in Hindi
 
2016 07-20-demo session
2016 07-20-demo session2016 07-20-demo session
2016 07-20-demo session
 
England ppt final
England ppt finalEngland ppt final
England ppt final
 
2016 07-20-wp4-q2 f2 f berlin
2016 07-20-wp4-q2 f2 f berlin2016 07-20-wp4-q2 f2 f berlin
2016 07-20-wp4-q2 f2 f berlin
 
WORKSHOP DOING BUSINESS IN GERMANY: OPPORTUNITIES IN THE GERMAN ENERGY MARKET
WORKSHOP  DOING BUSINESS IN GERMANY: OPPORTUNITIES IN THE GERMAN ENERGY MARKETWORKSHOP  DOING BUSINESS IN GERMANY: OPPORTUNITIES IN THE GERMAN ENERGY MARKET
WORKSHOP DOING BUSINESS IN GERMANY: OPPORTUNITIES IN THE GERMAN ENERGY MARKET
 
Internet of Things - Lu, Ralph
Internet of Things - Lu, RalphInternet of Things - Lu, Ralph
Internet of Things - Lu, Ralph
 
MOLTO poster for ACL 2010, Uppsala Sweden
MOLTO poster for ACL 2010, Uppsala SwedenMOLTO poster for ACL 2010, Uppsala Sweden
MOLTO poster for ACL 2010, Uppsala Sweden
 
BoldPM Insights Summary: Why Smart, Connected Devices Are Transforming Busine...
BoldPM Insights Summary: Why Smart, Connected Devices Are Transforming Busine...BoldPM Insights Summary: Why Smart, Connected Devices Are Transforming Busine...
BoldPM Insights Summary: Why Smart, Connected Devices Are Transforming Busine...
 
Agile Cloud Service Strategy using DevOps
Agile Cloud Service Strategy using DevOpsAgile Cloud Service Strategy using DevOps
Agile Cloud Service Strategy using DevOps
 

Similaire à BIW15: Python in the Cloud: Django and Flaks

Stapling and patching the web of now - ForwardJS3, San Francisco
Stapling and patching the web of now - ForwardJS3, San FranciscoStapling and patching the web of now - ForwardJS3, San Francisco
Stapling and patching the web of now - ForwardJS3, San FranciscoChristian Heilmann
 
RPA on Azure with .Net
RPA on Azure with .NetRPA on Azure with .Net
RPA on Azure with .NetMarco Parenzan
 
Python Web Frameworks: Django vs. Flask for Web Development
Python Web Frameworks: Django vs. Flask for Web DevelopmentPython Web Frameworks: Django vs. Flask for Web Development
Python Web Frameworks: Django vs. Flask for Web DevelopmentUncodemy
 
PyCon PL 2014 executable api
PyCon PL 2014   executable apiPyCon PL 2014   executable api
PyCon PL 2014 executable apiWojtek Erbetowski
 
Some chat ops what?
Some chat ops what?Some chat ops what?
Some chat ops what?Evan Powell
 
Better and Faster: A Journey Toward Clean Code and Enjoyment
Better and Faster: A Journey Toward Clean Code and EnjoymentBetter and Faster: A Journey Toward Clean Code and Enjoyment
Better and Faster: A Journey Toward Clean Code and EnjoymentChris Holland
 
SFBA Splunk Usergroup meeting March 13, 2024
SFBA Splunk Usergroup meeting March 13, 2024SFBA Splunk Usergroup meeting March 13, 2024
SFBA Splunk Usergroup meeting March 13, 2024Becky Burwell
 
Building serverless apps with Go & SAM
Building serverless apps with Go & SAMBuilding serverless apps with Go & SAM
Building serverless apps with Go & SAMLeon Stigter
 
Java And Community Support
Java And Community SupportJava And Community Support
Java And Community SupportWilliam Grosso
 
Semantic web, python, construction industry
Semantic web, python, construction industrySemantic web, python, construction industry
Semantic web, python, construction industryReinout van Rees
 
Java Web Frameworks Sweetspots
Java Web Frameworks SweetspotsJava Web Frameworks Sweetspots
Java Web Frameworks SweetspotsMatt Raible
 
CTE 323 - Lecture 1.pptx
CTE 323 - Lecture 1.pptxCTE 323 - Lecture 1.pptx
CTE 323 - Lecture 1.pptxOduniyiAdebola
 
Paris Web - Javascript as a programming language
Paris Web - Javascript as a programming languageParis Web - Javascript as a programming language
Paris Web - Javascript as a programming languageMarco Cedaro
 
Flask and Paramiko for Python VA
Flask and Paramiko for Python VAFlask and Paramiko for Python VA
Flask and Paramiko for Python VAEnrique Valenzuela
 
30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software EngineerSean Coates
 
Jared Whitlock Open Source In The Enterprise Plone @ Novell
Jared Whitlock   Open Source In The Enterprise    Plone @ NovellJared Whitlock   Open Source In The Enterprise    Plone @ Novell
Jared Whitlock Open Source In The Enterprise Plone @ NovellVincenzo Barone
 
SemTech 2010: Pelorus Platform
SemTech 2010: Pelorus PlatformSemTech 2010: Pelorus Platform
SemTech 2010: Pelorus PlatformClark & Parsia LLC
 
Frugal Web Development
Frugal Web DevelopmentFrugal Web Development
Frugal Web Developmenttcottrill
 
0506-django-web-framework-for-python.pdf
0506-django-web-framework-for-python.pdf0506-django-web-framework-for-python.pdf
0506-django-web-framework-for-python.pdfradhianiedjan1
 

Similaire à BIW15: Python in the Cloud: Django and Flaks (20)

Django vs flask
Django vs flaskDjango vs flask
Django vs flask
 
Stapling and patching the web of now - ForwardJS3, San Francisco
Stapling and patching the web of now - ForwardJS3, San FranciscoStapling and patching the web of now - ForwardJS3, San Francisco
Stapling and patching the web of now - ForwardJS3, San Francisco
 
RPA on Azure with .Net
RPA on Azure with .NetRPA on Azure with .Net
RPA on Azure with .Net
 
Python Web Frameworks: Django vs. Flask for Web Development
Python Web Frameworks: Django vs. Flask for Web DevelopmentPython Web Frameworks: Django vs. Flask for Web Development
Python Web Frameworks: Django vs. Flask for Web Development
 
PyCon PL 2014 executable api
PyCon PL 2014   executable apiPyCon PL 2014   executable api
PyCon PL 2014 executable api
 
Some chat ops what?
Some chat ops what?Some chat ops what?
Some chat ops what?
 
Better and Faster: A Journey Toward Clean Code and Enjoyment
Better and Faster: A Journey Toward Clean Code and EnjoymentBetter and Faster: A Journey Toward Clean Code and Enjoyment
Better and Faster: A Journey Toward Clean Code and Enjoyment
 
SFBA Splunk Usergroup meeting March 13, 2024
SFBA Splunk Usergroup meeting March 13, 2024SFBA Splunk Usergroup meeting March 13, 2024
SFBA Splunk Usergroup meeting March 13, 2024
 
Building serverless apps with Go & SAM
Building serverless apps with Go & SAMBuilding serverless apps with Go & SAM
Building serverless apps with Go & SAM
 
Java And Community Support
Java And Community SupportJava And Community Support
Java And Community Support
 
Semantic web, python, construction industry
Semantic web, python, construction industrySemantic web, python, construction industry
Semantic web, python, construction industry
 
Java Web Frameworks Sweetspots
Java Web Frameworks SweetspotsJava Web Frameworks Sweetspots
Java Web Frameworks Sweetspots
 
CTE 323 - Lecture 1.pptx
CTE 323 - Lecture 1.pptxCTE 323 - Lecture 1.pptx
CTE 323 - Lecture 1.pptx
 
Paris Web - Javascript as a programming language
Paris Web - Javascript as a programming languageParis Web - Javascript as a programming language
Paris Web - Javascript as a programming language
 
Flask and Paramiko for Python VA
Flask and Paramiko for Python VAFlask and Paramiko for Python VA
Flask and Paramiko for Python VA
 
30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer
 
Jared Whitlock Open Source In The Enterprise Plone @ Novell
Jared Whitlock   Open Source In The Enterprise    Plone @ NovellJared Whitlock   Open Source In The Enterprise    Plone @ Novell
Jared Whitlock Open Source In The Enterprise Plone @ Novell
 
SemTech 2010: Pelorus Platform
SemTech 2010: Pelorus PlatformSemTech 2010: Pelorus Platform
SemTech 2010: Pelorus Platform
 
Frugal Web Development
Frugal Web DevelopmentFrugal Web Development
Frugal Web Development
 
0506-django-web-framework-for-python.pdf
0506-django-web-framework-for-python.pdf0506-django-web-framework-for-python.pdf
0506-django-web-framework-for-python.pdf
 

Dernier

Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 

Dernier (20)

Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 

BIW15: Python in the Cloud: Django and Flaks

  • 1. Baltimore Innovation Week 2015 Python in the Cloud: Django vs Flask Alex Viana (@AlexVianaPro) Terbium Labs (@TerbiumLabs) and
  • 2. Terbium Labs ❖ Terbium Labs is a Baltimore-based data intelligence company. Our product, Matchlight, allows customers to monitor the dark web for stolen data. ❖ Matchlight is primarily written in Python, running on AWS.
  • 3. Motivation ❖ Django and Flask are the two most popular Python web frameworks. ❖ We use both frameworks to fill different roles in our work at Terbium Labs. ❖ It was surprisingly difficult to come to a firm decision that this was the right direction. ❖ This talk is about what we learned in the process and how it informed our decision.
  • 4. Flask ❖ Flask is what the majority of our services runs on. ❖ Flask is a bare-bones Python web “microframework”. ❖ It’s great for building lightweight apps or “microservices”. ❖ How lightweight? How Mirco?
  • 5. Flask is Light “Flask will never have a database layer. It will not have a form library or anything else in that direction. Flask itself just bridges to Werkzeug to implement a proper WSGI application and to Jinja2 to handle templating. It also binds to a few common standard library packages such as logging. Everything else is up for extensions.”
 
 - Flask Documentation
 http://flask.pocoo.org/docs/0.10/design/#what-flask-is-what- flask-is-not
  • 6. Flask’s Hello World from flask import Flask
 app = Flask(__name__)
 
 @app.route("/")
 def hello():
 return "Hello World!"
 
 if __name__ == "__main__":
 app.run()
  • 7. Your Library as a Flask App from flask import Flask
 from my_module import important_function
 app = Flask(__name__)
 
 @app.route("/")
 def hello():
 results = important_function()
 return results
 
 if __name__ == "__main__":
 app.run()
  • 8. Flask in a Startup ❖ Don’t have to wrap your head around any new framework patterns. ❖ Spend most of your time writing business logic not app logic. ❖ Flask is excellent for the low-overhead rapid implementation requirements start up development.
  • 9. Issues with Flask ❖ On some of our larger REST API’s things got tricky. ❖ Lots of design considerations with side effects. ❖ Development was slowing down. ❖ Maybe Flask was the wrong choice? So we looked to Django.
  • 10. Django ❖ Django is far and away the most used Python web framework. ❖ It’s the “batteries included” option: database ORM, forms, admin interface, etc. ❖ But this means stopping everything and learning a new framework. How do we know this is the right choice?
  • 11. Python vs Django ❖ A little Googling on the internet give you something like this: ❖ Django is for more full-featured applications. ❖ Flask is for more simple apps and rapid prototyping. ❖ Easy! But our product is made up of REST-ful micro services, shouldn’t Flask be perfect?
  • 12. More Confusion ❖ Flask is deployed at LinkedIn, Pinterest, Twillio, and the 2012 Obama election campaign. That’s big stuff! ❖ Miguel Grinberg’s Flask book builds a blog app with data migrations, unit tests, authentication, etc. Those are a lot of features! ❖ On the other hand we have the Django REST Framework. REST is pretty lean, right? ❖ So who’s right? How do we choose? The clock is ticking…
  • 13. Enter Django REST Framework ❖ So we gave Django REST framework a try. ❖ Django REST seemed like a contradiction at first; Django just seemed too heavy for an API. ❖ But, we realized there is a -lot- that goes into a REST API: authentication, serialization, permissions, data model, queries, testing, pagination, … ❖ Then we had our breakthrough…
  • 14. Flask and Django ❖ Think of Flask as a web framework framework! ❖ Put another way, Flask is not your framework. You use Flask to build your framework. ❖ Development was slowing down because we weren’t building our product, we were building our framework.
  • 15. Flask as a Framework Framework ❖ In the “Hello World” case this is trivial, all you need is in Flask, basically just a WSGI server. ❖ As you scale up you end up having to implement everything yourself, a-la the Flask book. ❖ Once you deviate from that - you’re on your own. ❖ Which can be great! Unless it’s not.
  • 16. Where Flask is Great ❖ This is why The Flask book is so great; it lays out all the decisions for you. ❖ And this is why major projects can be written in Flask at companies with deep resource and experience pools. ❖ And small project are a breeze because there’s literally nothing else in the framework to think about. ❖ And this why everything in-between is so tough.
  • 17. Building a Framework ❖ Is hard … just an FYI. ❖ Requires significant developer time. ❖ More importantly it requires informed opinions about how your framework should work. ❖ Even beyond that it requires knowledge about what decisions have to be made and how they interact.
  • 18. Final Remarks ❖ The driver for improving our technology stack was a sense we were working against, not with our tools. Don’t ignore that, it’s a clue something is wrong. ❖ Once we realized the pain points and benefits of both systems we could confidently select different tools for different jobs. Don’t underestimate the impact of this. ❖ Both are great projects, we’re indebted to both teams.
  • 19. Thank you for your attention. Questions?