SlideShare a Scribd company logo
1 of 19
Download to read offline
FLASK!
18 months in @ happify
FLASK NYC 2013
Andy Parsons @andyparsons
This talk
FLASK NYC 2013
E x p e r i e n c e
a n d L e s s o n s
F l a s k
@
H a p p i f y
A n 1 8 - m o n t h - o l d
a c t i v e F l a s k
c o d e b a s e
H o w I g o t t o
F l a s k
Flask has become a
VIBRANT, ACTIVE toolkit
for HTTP servers.
But there aren’t a lot of
large examples from which
to learn. LET’S CHANGE
THAT.
Me.
•startup junkie. masochist.
•co-founder/CTO Happify
•previously CTO Outside.in, bookish, ...
•MENTOR @ seedcamp, techpeaks, 500 Startups
•pragmatist
•love choosing tools, Learning, making them better
not Me.
•Framework zealot
•django expert (no comparisons)
•IDEALIST
what is a “microframework?”
•just the essentials, nothing more
•extensibility through plugins
•readable source
•minimal magic
•easy to build a toy/demo
•lack of patterns for larger projects
FLASK NYC 2013
PROJECT LINES OF CODE COMPLEXITY
Backbone.js < 1000 LOW
Flask (not Werkzeug) ~2000 (?) LOW
Redis 100,000 MEDIUM
Django 170,000 MEDIUM
MongoDB 500,000 HIGH
PostgreSQL > 1,000,000 HIGH!
complexity spectrum
* STATS FROM OHLOH (http://www.ohloh.net/) and http://www.andreas-dewes.de/code_is_beautiful/
‣ java/spring/.NET
‣ a FEW rails-based startups (sinatra mixed in)
‣ scala services (scalatra, play)
‣ Python a natural fit for happify (data analysis, machine learning, nlp)
‣ flask selected as toolkit
my journey to flask
A Sampling of NYC Python
A Startup Junkie's Journey to Python via Java, Ruby and Scala
Andy Parsons
@andyparsons
My Startups and Their Stacks What Are We Building? And in general...
Happiness Speed Magic Readability
BUSINESS WEB API SERVICES DATABASES TEAM SIZE
Pro Photo ASP.NET C#, Perl SQL Server 12
Hyperlocal
Content
(Geolocation
)
RoR Sinatra Scala
PostgreSQL,
MongoDB
10
Ereading and
Book
Recommende
r
RoR Scalatra Scala/Java MongoDB 8
Life Gaming Flask
Python/
Gevent
Python
PostgreSQL,
MongoDB
3
Building Happify: Comparing Language Options
SPEED CONCURRENCY TOOLING
PACKAGING /
DEPENDENCIES
DEPLOYMENT TESTING
FRAMEWORKS
/ LIBS
RUBY
SCALA
PYTHON
Fast enough Achieved through Process.fork
Healthy, lots of
choice
Gems Capistrano Mature
Growing collection
of libs, but weak in
NLP
Fast! Real concurrency,Akka
Still early. IDE’s
weak.
Complex. JARs, SBT, Ivy,
Maven.
? Maturing
Early for native
scala libraries, rely
on Java interop
Fast enough
Achieved through
multiprocessing
Healthy, lots of
choice
Eggs Fabric Mature
Massive collection
of libraries
READABILITY
HAPPINESS /
PRODUCTIVITY
COMMUNITY /
ACTIVITY
PROPENSITY FOR
MAGIC
MATURITY /
STABILITY
HIRING
RUBY
SCALA
PYTHON
OK. Emphasis
metaprogramming can
present challenges.
High Huge and active
Metaprogramming is sometimes
abused. RoR is too magical and
many imitated its philosophy
Stable, but much
catchup remaining for
gems to support 1.9
Tough. Medium
learning curve,
hard to find
seasoned devs
Concise, expressive but
NOT simple.
Highly variable! Small and active
Too many ways to accomplish
things. Scala “implicits”
encourage magic
Language spec
changing, breakages
still occurring in dot
releases
Very difficult.
Steep learning
curve
Highly readable High Big and active Explicit better than implicit
Most mature here.
But the 2.x/3.x break
is bad.
OK. Shallow
learning curve.
FLAME BAIT
BASICS
Scala Ruby Python
23
18
8
How do they “Stack” Up?
Happify is an angel-funded consumer
destination “life game.”
HTML5, Mobile, and Facebook front ends.
Currently in stealth mode.
Score is based on:
Green = 2
Yellow = 1
Red = 0
Python
36%
Ruby
60%
Scala
4%
Github Project Relative %
Gratuitous Perf Charts!
* from: http://shootout.alioth.debian.org
pycon 2012
poster
what is happify?
‣ science of happiness
‣ positive psych trainer
‣ consumer subscription business
‣ launched in beta after 9 months
‣ ~100K users
‣ imminent public launch
FLASK NYC 2013
happify stack abbreviated biography
•FEbruary 2012: james dennis @j2labs for coffee
•march 2012: started coding poc (jinja templates only)
•june 2012: alpha poc launched
•september 2012: first real design/ux work
•october 2012: backbone/coffeescript introduced
•december 2013: redis added, closed beta launched
•march 2013: ES added, open beta launch
•june 2013: commerce, new feature set, scale up to 100K users
•august 2013: ”final” design, refactoring for public launch
•now: frontend and backend performance, press
what is large?
what is large?
•80 views
•200 templates
•60 backbone views
•50 models
•200 tests (need more!)
‣ backbone.js
‣ coffeescript
‣ haml
‣ less css
‣ flask
‣ flask-admin
‣ sqlalchemy
‣ postgres
The happify stack
‣ redis
‣ Elastic search
‣ NGINX
‣ celery
‣ gunicorn
‣ aws ec2/s3
‣ nose
‣ fabric
‣ api for mobile
‣ api for backbone
‣ backbone app bootstrapping
‣ template rendering
‣ administration ui
‣ aggregates data from postgres, redis, elasticsearch
‣ serializes context-specific object graphs
the role of flask - data switch
‣ project layout
‣ config
‣ routing setup
‣ db connection management
‣ serialization: shallow and deep
‣ FAB automation
code
‣ better config (multiple environments, config heirarchy)
‣ authentication
‣ assets pipeline
‣ model validation and serialization layer (waffling)
batteries i wish were included
batteries i could do without
‣ trailing slash redirects (but easy to control)
python 3! well, almost kinda
•flask/werkzeug support completed
•many extensions not yet
•fabric, boto, sentry ...
•too bad- unicode is a mess without it
•Handy: http://python3wos.appspot.com/
‣ flask is an excellent choice for apps like ours
‣ know what you are getting and what you aren’t, make no assumptions
‣ prepare to refactor relentlessly
‣ don’t worry that there’s no single way to do it!
conclusions
contact me:
andy parsons
andy@happify.com
@andyparsons
thank
you!

More Related Content

Viewers also liked

Python - Telegram
Python - TelegramPython - Telegram
Python - TelegramWidoyo PH
 
TLS303 How to Deploy Python Applications on AWS Elastic Beanstalk - AWS re:In...
TLS303 How to Deploy Python Applications on AWS Elastic Beanstalk - AWS re:In...TLS303 How to Deploy Python Applications on AWS Elastic Beanstalk - AWS re:In...
TLS303 How to Deploy Python Applications on AWS Elastic Beanstalk - AWS re:In...Amazon Web Services
 
Chat Bots Presentation 8.9.16
Chat Bots Presentation 8.9.16Chat Bots Presentation 8.9.16
Chat Bots Presentation 8.9.16Samuel Adams, MBA
 
Chatbot in Sale Management
Chatbot in Sale ManagementChatbot in Sale Management
Chatbot in Sale ManagementVõ Duy Tuấn
 
SF Python Meetup: TextRank in Python
SF Python Meetup: TextRank in PythonSF Python Meetup: TextRank in Python
SF Python Meetup: TextRank in PythonPaco Nathan
 
AWS re:Invent 2016: Life Without SSH: Immutable Infrastructure in Production ...
AWS re:Invent 2016: Life Without SSH: Immutable Infrastructure in Production ...AWS re:Invent 2016: Life Without SSH: Immutable Infrastructure in Production ...
AWS re:Invent 2016: Life Without SSH: Immutable Infrastructure in Production ...Amazon Web Services
 
Why Social Media Chat Bots Are the Future of Communication - Deck
Why Social Media Chat Bots Are the Future of Communication - DeckWhy Social Media Chat Bots Are the Future of Communication - Deck
Why Social Media Chat Bots Are the Future of Communication - DeckJan Rezab
 
Search Content vs. Social Content
Search Content vs. Social ContentSearch Content vs. Social Content
Search Content vs. Social ContentSemrush
 

Viewers also liked (9)

Python - Telegram
Python - TelegramPython - Telegram
Python - Telegram
 
TLS303 How to Deploy Python Applications on AWS Elastic Beanstalk - AWS re:In...
TLS303 How to Deploy Python Applications on AWS Elastic Beanstalk - AWS re:In...TLS303 How to Deploy Python Applications on AWS Elastic Beanstalk - AWS re:In...
TLS303 How to Deploy Python Applications on AWS Elastic Beanstalk - AWS re:In...
 
Chat Bots Presentation 8.9.16
Chat Bots Presentation 8.9.16Chat Bots Presentation 8.9.16
Chat Bots Presentation 8.9.16
 
Chatbot in Sale Management
Chatbot in Sale ManagementChatbot in Sale Management
Chatbot in Sale Management
 
Bot Trends 2016
Bot Trends 2016Bot Trends 2016
Bot Trends 2016
 
SF Python Meetup: TextRank in Python
SF Python Meetup: TextRank in PythonSF Python Meetup: TextRank in Python
SF Python Meetup: TextRank in Python
 
AWS re:Invent 2016: Life Without SSH: Immutable Infrastructure in Production ...
AWS re:Invent 2016: Life Without SSH: Immutable Infrastructure in Production ...AWS re:Invent 2016: Life Without SSH: Immutable Infrastructure in Production ...
AWS re:Invent 2016: Life Without SSH: Immutable Infrastructure in Production ...
 
Why Social Media Chat Bots Are the Future of Communication - Deck
Why Social Media Chat Bots Are the Future of Communication - DeckWhy Social Media Chat Bots Are the Future of Communication - Deck
Why Social Media Chat Bots Are the Future of Communication - Deck
 
Search Content vs. Social Content
Search Content vs. Social ContentSearch Content vs. Social Content
Search Content vs. Social Content
 

More from Andy Parsons

Open edX Conference 2014, McKinsey Academy
Open edX Conference 2014, McKinsey AcademyOpen edX Conference 2014, McKinsey Academy
Open edX Conference 2014, McKinsey AcademyAndy Parsons
 
Emotions of Startups 2014
Emotions of Startups 2014Emotions of Startups 2014
Emotions of Startups 2014Andy Parsons
 
Open Tech NYC 2013
Open Tech NYC 2013Open Tech NYC 2013
Open Tech NYC 2013Andy Parsons
 
Prince Building Tech Talk 12102012
Prince Building Tech Talk 12102012Prince Building Tech Talk 12102012
Prince Building Tech Talk 12102012Andy Parsons
 
Ga cloud scaling 3 30-2012
Ga cloud scaling 3 30-2012Ga cloud scaling 3 30-2012
Ga cloud scaling 3 30-2012Andy Parsons
 
Andy Parsons Pivotal June 2011
Andy Parsons Pivotal June 2011Andy Parsons Pivotal June 2011
Andy Parsons Pivotal June 2011Andy Parsons
 

More from Andy Parsons (6)

Open edX Conference 2014, McKinsey Academy
Open edX Conference 2014, McKinsey AcademyOpen edX Conference 2014, McKinsey Academy
Open edX Conference 2014, McKinsey Academy
 
Emotions of Startups 2014
Emotions of Startups 2014Emotions of Startups 2014
Emotions of Startups 2014
 
Open Tech NYC 2013
Open Tech NYC 2013Open Tech NYC 2013
Open Tech NYC 2013
 
Prince Building Tech Talk 12102012
Prince Building Tech Talk 12102012Prince Building Tech Talk 12102012
Prince Building Tech Talk 12102012
 
Ga cloud scaling 3 30-2012
Ga cloud scaling 3 30-2012Ga cloud scaling 3 30-2012
Ga cloud scaling 3 30-2012
 
Andy Parsons Pivotal June 2011
Andy Parsons Pivotal June 2011Andy Parsons Pivotal June 2011
Andy Parsons Pivotal June 2011
 

Recently uploaded

My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Recently uploaded (20)

My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

Flask NYC 09262013

  • 1. FLASK! 18 months in @ happify FLASK NYC 2013 Andy Parsons @andyparsons
  • 2. This talk FLASK NYC 2013 E x p e r i e n c e a n d L e s s o n s F l a s k @ H a p p i f y A n 1 8 - m o n t h - o l d a c t i v e F l a s k c o d e b a s e H o w I g o t t o F l a s k Flask has become a VIBRANT, ACTIVE toolkit for HTTP servers. But there aren’t a lot of large examples from which to learn. LET’S CHANGE THAT.
  • 3. Me. •startup junkie. masochist. •co-founder/CTO Happify •previously CTO Outside.in, bookish, ... •MENTOR @ seedcamp, techpeaks, 500 Startups •pragmatist •love choosing tools, Learning, making them better
  • 4. not Me. •Framework zealot •django expert (no comparisons) •IDEALIST
  • 5. what is a “microframework?” •just the essentials, nothing more •extensibility through plugins •readable source •minimal magic •easy to build a toy/demo •lack of patterns for larger projects
  • 6. FLASK NYC 2013 PROJECT LINES OF CODE COMPLEXITY Backbone.js < 1000 LOW Flask (not Werkzeug) ~2000 (?) LOW Redis 100,000 MEDIUM Django 170,000 MEDIUM MongoDB 500,000 HIGH PostgreSQL > 1,000,000 HIGH! complexity spectrum * STATS FROM OHLOH (http://www.ohloh.net/) and http://www.andreas-dewes.de/code_is_beautiful/
  • 7. ‣ java/spring/.NET ‣ a FEW rails-based startups (sinatra mixed in) ‣ scala services (scalatra, play) ‣ Python a natural fit for happify (data analysis, machine learning, nlp) ‣ flask selected as toolkit my journey to flask
  • 8. A Sampling of NYC Python A Startup Junkie's Journey to Python via Java, Ruby and Scala Andy Parsons @andyparsons My Startups and Their Stacks What Are We Building? And in general... Happiness Speed Magic Readability BUSINESS WEB API SERVICES DATABASES TEAM SIZE Pro Photo ASP.NET C#, Perl SQL Server 12 Hyperlocal Content (Geolocation ) RoR Sinatra Scala PostgreSQL, MongoDB 10 Ereading and Book Recommende r RoR Scalatra Scala/Java MongoDB 8 Life Gaming Flask Python/ Gevent Python PostgreSQL, MongoDB 3 Building Happify: Comparing Language Options SPEED CONCURRENCY TOOLING PACKAGING / DEPENDENCIES DEPLOYMENT TESTING FRAMEWORKS / LIBS RUBY SCALA PYTHON Fast enough Achieved through Process.fork Healthy, lots of choice Gems Capistrano Mature Growing collection of libs, but weak in NLP Fast! Real concurrency,Akka Still early. IDE’s weak. Complex. JARs, SBT, Ivy, Maven. ? Maturing Early for native scala libraries, rely on Java interop Fast enough Achieved through multiprocessing Healthy, lots of choice Eggs Fabric Mature Massive collection of libraries READABILITY HAPPINESS / PRODUCTIVITY COMMUNITY / ACTIVITY PROPENSITY FOR MAGIC MATURITY / STABILITY HIRING RUBY SCALA PYTHON OK. Emphasis metaprogramming can present challenges. High Huge and active Metaprogramming is sometimes abused. RoR is too magical and many imitated its philosophy Stable, but much catchup remaining for gems to support 1.9 Tough. Medium learning curve, hard to find seasoned devs Concise, expressive but NOT simple. Highly variable! Small and active Too many ways to accomplish things. Scala “implicits” encourage magic Language spec changing, breakages still occurring in dot releases Very difficult. Steep learning curve Highly readable High Big and active Explicit better than implicit Most mature here. But the 2.x/3.x break is bad. OK. Shallow learning curve. FLAME BAIT BASICS Scala Ruby Python 23 18 8 How do they “Stack” Up? Happify is an angel-funded consumer destination “life game.” HTML5, Mobile, and Facebook front ends. Currently in stealth mode. Score is based on: Green = 2 Yellow = 1 Red = 0 Python 36% Ruby 60% Scala 4% Github Project Relative % Gratuitous Perf Charts! * from: http://shootout.alioth.debian.org pycon 2012 poster
  • 9. what is happify? ‣ science of happiness ‣ positive psych trainer ‣ consumer subscription business ‣ launched in beta after 9 months ‣ ~100K users ‣ imminent public launch FLASK NYC 2013
  • 10. happify stack abbreviated biography •FEbruary 2012: james dennis @j2labs for coffee •march 2012: started coding poc (jinja templates only) •june 2012: alpha poc launched •september 2012: first real design/ux work •october 2012: backbone/coffeescript introduced •december 2013: redis added, closed beta launched •march 2013: ES added, open beta launch •june 2013: commerce, new feature set, scale up to 100K users •august 2013: ”final” design, refactoring for public launch •now: frontend and backend performance, press
  • 12. what is large? •80 views •200 templates •60 backbone views •50 models •200 tests (need more!)
  • 13. ‣ backbone.js ‣ coffeescript ‣ haml ‣ less css ‣ flask ‣ flask-admin ‣ sqlalchemy ‣ postgres The happify stack ‣ redis ‣ Elastic search ‣ NGINX ‣ celery ‣ gunicorn ‣ aws ec2/s3 ‣ nose ‣ fabric
  • 14. ‣ api for mobile ‣ api for backbone ‣ backbone app bootstrapping ‣ template rendering ‣ administration ui ‣ aggregates data from postgres, redis, elasticsearch ‣ serializes context-specific object graphs the role of flask - data switch
  • 15. ‣ project layout ‣ config ‣ routing setup ‣ db connection management ‣ serialization: shallow and deep ‣ FAB automation code
  • 16. ‣ better config (multiple environments, config heirarchy) ‣ authentication ‣ assets pipeline ‣ model validation and serialization layer (waffling) batteries i wish were included batteries i could do without ‣ trailing slash redirects (but easy to control)
  • 17. python 3! well, almost kinda •flask/werkzeug support completed •many extensions not yet •fabric, boto, sentry ... •too bad- unicode is a mess without it •Handy: http://python3wos.appspot.com/
  • 18. ‣ flask is an excellent choice for apps like ours ‣ know what you are getting and what you aren’t, make no assumptions ‣ prepare to refactor relentlessly ‣ don’t worry that there’s no single way to do it! conclusions