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

Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdfHafizMudaserAhmad
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgsaravananr517913
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxRomil Mishra
 
National Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfNational Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfRajuKanojiya4
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the weldingMuhammadUzairLiaqat
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptMadan Karki
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
BSNL Internship Training presentation.pptx
BSNL Internship Training presentation.pptxBSNL Internship Training presentation.pptx
BSNL Internship Training presentation.pptxNiranjanYadav41
 
Risk Management in Engineering Construction Project
Risk Management in Engineering Construction ProjectRisk Management in Engineering Construction Project
Risk Management in Engineering Construction ProjectErbil Polytechnic University
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Configuration of IoT devices - Systems managament
Configuration of IoT devices - Systems managamentConfiguration of IoT devices - Systems managament
Configuration of IoT devices - Systems managamentBharaniDharan195623
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
System Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingSystem Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingBootNeck1
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating SystemRashmi Bhat
 

Dernier (20)

Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptx
 
National Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfNational Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdf
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the welding
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.ppt
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
BSNL Internship Training presentation.pptx
BSNL Internship Training presentation.pptxBSNL Internship Training presentation.pptx
BSNL Internship Training presentation.pptx
 
Risk Management in Engineering Construction Project
Risk Management in Engineering Construction ProjectRisk Management in Engineering Construction Project
Risk Management in Engineering Construction Project
 
Designing pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptxDesigning pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptx
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Configuration of IoT devices - Systems managament
Configuration of IoT devices - Systems managamentConfiguration of IoT devices - Systems managament
Configuration of IoT devices - Systems managament
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
System Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingSystem Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event Scheduling
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating System
 

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?