SlideShare ist ein Scribd-Unternehmen logo
1 von 37
PHP to Python:
No Regrets
The Grass Is Always Greener




                                Alex Ezell
                                  Emma
                              July 31, 2011
the on e on th e left.
Hi, I’m
The bloodiest wars in history
 have been religious wars.
               -Richard M. Nixon
Why did we change?
          How did we change?
  Would I do it all again?
          What did we learn?
Why did we change?
Change Is What We Do
Big, Hairy Ass Goals

 Rewrite the platform incrementally
 Provide a world-class customer API
 Reexamine every tool
 Quadruple the tech team
 Lead instead of follow
Opportunity
Major push from the business for new features more
often and the freedom to make that happen
Team growth
Stability and agreement in other areas: infrastructure,
strategic planning, etc.
Developer desire - we simply wanted more.
Necessity with regards to current codebase
Code Unity / Management
Lots of background, server processes managing parts
of our application. Desire for code in background
processes to more closely resemble application code
Threading, decoupling, and queueing.
Third-party mailer integration.
Several small teams working on a single project.
Modernizing Our Toolset

Homegrown PHP Web Framework -> Django
PEAR_DB -> SQLAlchemy
Apache -> WSGI
No Testing/Docs -> nose and Sphinx
CVS Update -> Fabric Deploys of Git Repo
Why Python?
Maturity and capability
Ease of use / Powerful / Low learning curve
Rapid development
Future of the technology
Ecosystem of tools
How did we change?
Revolution or Evolution?
 Stop for a full rewrite and not have something
 compelling when you reboot
 No new features while the rewrite occurs
 Inability to really beta test new stuff
 Fairly entrenched customer base
 Competition is innovating quickly
Service API
Scalability, Speed, Fault-tolerant, Easy Deployment
Collection of Python WSGI Apps
Delayed processes, log readers, and queue consumers
New structure for all business logic
Smaller, tighter codebase - Easier to build on
Public API is just a wrapper
Heavy use of Redis
Module Fiesta
                   accounts
   tantuclient                     tantu
                 audience
queueworkers                          jumper
                     dbsession

         logparser               graffiti
Learn the Python Ecosystem
      Fabric==1.1.2           meld3==0.6.7
       Jinja2==2.5.5           nose==1.0.0
     Pygments==1.4         paramiko==1.7.7.1
   SQLAlchemy==0.7.0        psycopg2==2.4.1
      Sphinx==1.0.7           pycrypto==2.3
     Tempita==0.5.1            redis==2.0.0
       WebOb==1.0            requests==0.5.0
     WebTest==1.2.2         setproctitle==1.1
      coverage==3.4        supervisor==3.0a10
    decorator==3.3.1          wsgiref==0.1.2
    distribute==0.6.16   yoyo-migrations==4.1.0
       docutils==0.7
Testing! Testing! Testing!

 nose, WebOb, WebTest
 Rapid iteration
 Distributed team
 No testing of the Django app piece
Session Handling

Let PHP continue to handle session authentication
Teach Python how to read/write PHP serialization using
Scott Hurring’s code: http://hurring.com/scott/code/
python/serialize/
Django has built-in memcache support, so we make
PHP save sessions in memcache
Gotta Get That Data

PEAR_DB handled all queries and the database
connection with hand-written SQL
Moving to multi-database, sharded model - handle
connections seamlessly
Handle different types of encoding seamlessly
Rewrite all queries in SQLAlchemy from straight SQL
The Campaign Edit Example

2600 lines of code to 700
Exact same functionality including some additional stuff
Number of database queries stayed close to the same
Very Javascript heavy, so changes might not be as
extensive as other sections
What did we learn?
What We Learned
We don’t really need a web framework
Django is awesome, so is Flask, so is WSGI
git is invaluable for distributed teams on big projects
Easy deployment is vital
Data encoding sucks and is hard
Timezone handling sucks and is hard
What We Learned
PHP frameworks (CakePHP and Symfony) have come
a long way and are on par with Django
The shift to sqlalchemy has provided lots of challenges
Django template parsing can be slow in certain
situations
Hiring Python developers can be tough, especially in
Nashville
Juggling multiple systems is fraught with danger
What We Learned
Incremental rewrites are technically more difficult
Starting from scratch would have left us lost in the
marketplace
Many of our problems had nothing to do with language
choice or tools or frameworks
Learning a New Language
Porting is bad
Bad habits are easy to break in Python, though not
unavoidable
Python’s interactive interpreter makes tinkering easy
Every developer learns in unique ways and at different
rates
Reading great code
Would I do it all again?
www.wordle.net
Positives
 Codebase is becoming more standardized
 Developer energy is high
 Features we have implemented have turned out well
 and been easy to add functionality to
 Python’s standard library offers powerful, quality add-
 on modules for free
 Developers we have hired have been able to contribute
 quickly and be impactful
Many of us crucify ourselves
between two thieves - regret for
the past and fear of the future.
                  - Fulton Oursler
We’re Launching It Sept.
1
Contact Me


 Email: alex@myemma.com
 Twitter: @aezellisdead or @emmaemailtech
We Are Hiring at Emma
Happy Hour Tonight at Eddie
George’s Grill from 6-8pm
http://myemma.com/tech-jobs/
Email: alex@myemma.com
Twitter: @aezellisdead or
@emmaemailtech
Photo Credits

Nixon - BusinessWeek: http://images.businessweek.com/ss/07/04/0426_dow/
source/5.htm

Change - http://www.flickr.com/photos/spursfan_ace/2328879637/

Kofi Annan - http://www.gambianow.com/news/Open-Forum/Have-Your-Say/
Many_Give_Annan_High_Marks_as_UN_Chief_Despite_Flaws.html

Butterflies - http://21stcenturylearning.typepad.com/blog/2009/01/why-
change.html

Sad boy - http://www.psychologytoday.com/blog/ulterior-motives/200806/will-i-
regret-it-in-the-morning-how-about-when-im-64

Weitere ähnliche Inhalte

Was ist angesagt?

Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language Ganesh Samarthyam
 
Go language presentation
Go language presentationGo language presentation
Go language presentationparamisoft
 
Introduction to Go programming
Introduction to Go programmingIntroduction to Go programming
Introduction to Go programmingExotel
 
Modern Perl for the Unfrozen Paleolithic Perl Programmer
Modern Perl for the Unfrozen Paleolithic  Perl ProgrammerModern Perl for the Unfrozen Paleolithic  Perl Programmer
Modern Perl for the Unfrozen Paleolithic Perl ProgrammerJohn Anderson
 
PHP Files: An Introduction
PHP Files: An IntroductionPHP Files: An Introduction
PHP Files: An IntroductionJacques Woodcock
 
Livecode widget course
Livecode widget courseLivecode widget course
Livecode widget coursecrazyaxe
 
Happy hacking with Plone
Happy hacking with PloneHappy hacking with Plone
Happy hacking with PloneMakina Corpus
 
Running a Plone product on Substance D
Running a Plone product on Substance DRunning a Plone product on Substance D
Running a Plone product on Substance DMakina Corpus
 
Emscripten - compile your C/C++ to JavaScript
Emscripten - compile your C/C++ to JavaScriptEmscripten - compile your C/C++ to JavaScript
Emscripten - compile your C/C++ to JavaScript穎睿 梁
 
The GNOME way - What can we learn from and within the Open Documentation World
The GNOME way - What can we learn from and within the Open Documentation WorldThe GNOME way - What can we learn from and within the Open Documentation World
The GNOME way - What can we learn from and within the Open Documentation WorldRadina Matic
 
Golang 101
Golang 101Golang 101
Golang 101宇 傅
 
difference between c c++ c#
difference between c c++ c#difference between c c++ c#
difference between c c++ c#Sireesh K
 
Solving Localization Challenges with Design Pattern Automation
Solving Localization Challenges with Design Pattern AutomationSolving Localization Challenges with Design Pattern Automation
Solving Localization Challenges with Design Pattern AutomationPostSharp Technologies
 
Future of PERL in IT
Future of PERL in ITFuture of PERL in IT
Future of PERL in ITNexiilabs
 

Was ist angesagt? (19)

Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language
 
Go language presentation
Go language presentationGo language presentation
Go language presentation
 
Code rippa
Code rippaCode rippa
Code rippa
 
Introduction to Go programming
Introduction to Go programmingIntroduction to Go programming
Introduction to Go programming
 
Modern Perl for the Unfrozen Paleolithic Perl Programmer
Modern Perl for the Unfrozen Paleolithic  Perl ProgrammerModern Perl for the Unfrozen Paleolithic  Perl Programmer
Modern Perl for the Unfrozen Paleolithic Perl Programmer
 
PHP Files: An Introduction
PHP Files: An IntroductionPHP Files: An Introduction
PHP Files: An Introduction
 
Livecode widget course
Livecode widget courseLivecode widget course
Livecode widget course
 
Go Language presentation
Go Language presentationGo Language presentation
Go Language presentation
 
The PHP Renaissance
The PHP RenaissanceThe PHP Renaissance
The PHP Renaissance
 
Happy hacking with Plone
Happy hacking with PloneHappy hacking with Plone
Happy hacking with Plone
 
Running a Plone product on Substance D
Running a Plone product on Substance DRunning a Plone product on Substance D
Running a Plone product on Substance D
 
Emscripten - compile your C/C++ to JavaScript
Emscripten - compile your C/C++ to JavaScriptEmscripten - compile your C/C++ to JavaScript
Emscripten - compile your C/C++ to JavaScript
 
The GNOME way - What can we learn from and within the Open Documentation World
The GNOME way - What can we learn from and within the Open Documentation WorldThe GNOME way - What can we learn from and within the Open Documentation World
The GNOME way - What can we learn from and within the Open Documentation World
 
Golang 101
Golang 101Golang 101
Golang 101
 
difference between c c++ c#
difference between c c++ c#difference between c c++ c#
difference between c c++ c#
 
Ruby programming
Ruby programmingRuby programming
Ruby programming
 
Solving Localization Challenges with Design Pattern Automation
Solving Localization Challenges with Design Pattern AutomationSolving Localization Challenges with Design Pattern Automation
Solving Localization Challenges with Design Pattern Automation
 
Future of PERL in IT
Future of PERL in ITFuture of PERL in IT
Future of PERL in IT
 
An introduction to programming in Go
An introduction to programming in GoAn introduction to programming in Go
An introduction to programming in Go
 

Andere mochten auch

Basic .Net Training in Hyderabad
Basic .Net Training in HyderabadBasic .Net Training in Hyderabad
Basic .Net Training in HyderabadUgs8008
 
Python Programming - II. The Basics
Python Programming - II. The BasicsPython Programming - II. The Basics
Python Programming - II. The BasicsRanel Padon
 
Introduction To Unix
Introduction To UnixIntroduction To Unix
Introduction To UnixCTIN
 
visual basic .net
visual basic .netvisual basic .net
visual basic .netronald_a_go
 
Unix operating system
Unix operating systemUnix operating system
Unix operating systemmidhunjose4u
 
VISUAL BASIC .net data accesss vii
VISUAL BASIC .net data accesss viiVISUAL BASIC .net data accesss vii
VISUAL BASIC .net data accesss viiargusacademy
 
Comparison of Programming Platforms
Comparison of Programming PlatformsComparison of Programming Platforms
Comparison of Programming PlatformsAnup Hariharan Nair
 
Android vs ios System Architecture in OS perspective
Android vs ios System Architecture in OS perspectiveAndroid vs ios System Architecture in OS perspective
Android vs ios System Architecture in OS perspectiveRaj Pratim Bhattacharya
 
Difference between Java and c#
Difference between Java and c#Difference between Java and c#
Difference between Java and c#Sagar Pednekar
 
Introduction to .NET Framework and C# (English)
Introduction to .NET Framework and C# (English)Introduction to .NET Framework and C# (English)
Introduction to .NET Framework and C# (English)Vangos Pterneas
 
Why Java Sucks and C# Rocks (Final)
Why Java Sucks and C# Rocks (Final)Why Java Sucks and C# Rocks (Final)
Why Java Sucks and C# Rocks (Final)jeffz
 
.NET Framework Overview
.NET Framework Overview.NET Framework Overview
.NET Framework OverviewDoncho Minkov
 
Unix OS & Commands
Unix OS & CommandsUnix OS & Commands
Unix OS & CommandsMohit Belwal
 

Andere mochten auch (20)

Basic .Net Training in Hyderabad
Basic .Net Training in HyderabadBasic .Net Training in Hyderabad
Basic .Net Training in Hyderabad
 
presentation on Unix basic by prince kumar kushwhaha
presentation on Unix basic by prince kumar kushwhahapresentation on Unix basic by prince kumar kushwhaha
presentation on Unix basic by prince kumar kushwhaha
 
Python Programming - II. The Basics
Python Programming - II. The BasicsPython Programming - II. The Basics
Python Programming - II. The Basics
 
Introduction To Unix
Introduction To UnixIntroduction To Unix
Introduction To Unix
 
Python Basics
Python BasicsPython Basics
Python Basics
 
visual basic .net
visual basic .netvisual basic .net
visual basic .net
 
Unix operating system
Unix operating systemUnix operating system
Unix operating system
 
Java vs .net (beginners)
Java vs .net (beginners)Java vs .net (beginners)
Java vs .net (beginners)
 
Basic 50 linus command
Basic 50 linus commandBasic 50 linus command
Basic 50 linus command
 
VISUAL BASIC .net data accesss vii
VISUAL BASIC .net data accesss viiVISUAL BASIC .net data accesss vii
VISUAL BASIC .net data accesss vii
 
Comparison of Programming Platforms
Comparison of Programming PlatformsComparison of Programming Platforms
Comparison of Programming Platforms
 
Android vs ios System Architecture in OS perspective
Android vs ios System Architecture in OS perspectiveAndroid vs ios System Architecture in OS perspective
Android vs ios System Architecture in OS perspective
 
Unix slideshare
Unix slideshareUnix slideshare
Unix slideshare
 
Android Vs iOS
Android Vs iOSAndroid Vs iOS
Android Vs iOS
 
Introduction to Python Basics Programming
Introduction to Python Basics ProgrammingIntroduction to Python Basics Programming
Introduction to Python Basics Programming
 
Difference between Java and c#
Difference between Java and c#Difference between Java and c#
Difference between Java and c#
 
Introduction to .NET Framework and C# (English)
Introduction to .NET Framework and C# (English)Introduction to .NET Framework and C# (English)
Introduction to .NET Framework and C# (English)
 
Why Java Sucks and C# Rocks (Final)
Why Java Sucks and C# Rocks (Final)Why Java Sucks and C# Rocks (Final)
Why Java Sucks and C# Rocks (Final)
 
.NET Framework Overview
.NET Framework Overview.NET Framework Overview
.NET Framework Overview
 
Unix OS & Commands
Unix OS & CommandsUnix OS & Commands
Unix OS & Commands
 

Ähnlich wie PHP to Python with No Regrets

Алексей Петров "PHP at Scale: Knowing enough to be dangerous!"
Алексей Петров "PHP at Scale: Knowing enough to be dangerous!"Алексей Петров "PHP at Scale: Knowing enough to be dangerous!"
Алексей Петров "PHP at Scale: Knowing enough to be dangerous!"Fwdays
 
XPDays Ukraine: Legacy
XPDays Ukraine: LegacyXPDays Ukraine: Legacy
XPDays Ukraine: LegacyVictor_Cr
 
Intro to Perfect - LA presentation
Intro to Perfect - LA presentationIntro to Perfect - LA presentation
Intro to Perfect - LA presentationTim Taplin
 
PHP 4? OMG! A small vademecum for obsolete software migration.
PHP 4? OMG! A small vademecum for obsolete software migration.PHP 4? OMG! A small vademecum for obsolete software migration.
PHP 4? OMG! A small vademecum for obsolete software migration.Francesco Fullone
 
Generative AI in CSharp with Semantic Kernel.pptx
Generative AI in CSharp with Semantic Kernel.pptxGenerative AI in CSharp with Semantic Kernel.pptx
Generative AI in CSharp with Semantic Kernel.pptxAlon Fliess
 
Dev Ops for systems of record - Talk at Agile Australia 2015
Dev Ops for systems of record - Talk at Agile Australia 2015Dev Ops for systems of record - Talk at Agile Australia 2015
Dev Ops for systems of record - Talk at Agile Australia 2015Mirco Hering
 
The Medusa Project
The Medusa ProjectThe Medusa Project
The Medusa ProjectRahul Dé
 
Python and Zope: An introduction (May 2004)
Python and Zope: An introduction (May 2004)Python and Zope: An introduction (May 2004)
Python and Zope: An introduction (May 2004)Kiran Jonnalagadda
 
PhpSpec: practical introduction
PhpSpec: practical introductionPhpSpec: practical introduction
PhpSpec: practical introductionDave Hulbert
 
DevOps The Cultural revolution
DevOps The Cultural revolutionDevOps The Cultural revolution
DevOps The Cultural revolutionSomenath Ghosh
 
Holistic JavaScript Performance
Holistic JavaScript PerformanceHolistic JavaScript Performance
Holistic JavaScript Performancejeresig
 
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
 
scale_perf_best_practices
scale_perf_best_practicesscale_perf_best_practices
scale_perf_best_practiceswebuploader
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to PythonSpotle.ai
 
10 practices that every developer needs to start right now
10 practices that every developer needs to start right now10 practices that every developer needs to start right now
10 practices that every developer needs to start right nowCaleb Jenkins
 
The Rise of the DataOps - Dataiku - J On the Beach 2016
The Rise of the DataOps - Dataiku - J On the Beach 2016 The Rise of the DataOps - Dataiku - J On the Beach 2016
The Rise of the DataOps - Dataiku - J On the Beach 2016 Dataiku
 
best source to learn python
best source to learn pythonbest source to learn python
best source to learn pythonNaveenJindal20
 

Ähnlich wie PHP to Python with No Regrets (20)

Алексей Петров "PHP at Scale: Knowing enough to be dangerous!"
Алексей Петров "PHP at Scale: Knowing enough to be dangerous!"Алексей Петров "PHP at Scale: Knowing enough to be dangerous!"
Алексей Петров "PHP at Scale: Knowing enough to be dangerous!"
 
Dev ops
Dev opsDev ops
Dev ops
 
XPDays Ukraine: Legacy
XPDays Ukraine: LegacyXPDays Ukraine: Legacy
XPDays Ukraine: Legacy
 
Intro to Perfect - LA presentation
Intro to Perfect - LA presentationIntro to Perfect - LA presentation
Intro to Perfect - LA presentation
 
Performance Tuning with XHProf
Performance Tuning with XHProfPerformance Tuning with XHProf
Performance Tuning with XHProf
 
PHP 4? OMG! A small vademecum for obsolete software migration.
PHP 4? OMG! A small vademecum for obsolete software migration.PHP 4? OMG! A small vademecum for obsolete software migration.
PHP 4? OMG! A small vademecum for obsolete software migration.
 
Generative AI in CSharp with Semantic Kernel.pptx
Generative AI in CSharp with Semantic Kernel.pptxGenerative AI in CSharp with Semantic Kernel.pptx
Generative AI in CSharp with Semantic Kernel.pptx
 
Dev Ops for systems of record - Talk at Agile Australia 2015
Dev Ops for systems of record - Talk at Agile Australia 2015Dev Ops for systems of record - Talk at Agile Australia 2015
Dev Ops for systems of record - Talk at Agile Australia 2015
 
The Medusa Project
The Medusa ProjectThe Medusa Project
The Medusa Project
 
Python and Zope: An introduction (May 2004)
Python and Zope: An introduction (May 2004)Python and Zope: An introduction (May 2004)
Python and Zope: An introduction (May 2004)
 
PhpSpec: practical introduction
PhpSpec: practical introductionPhpSpec: practical introduction
PhpSpec: practical introduction
 
DevOps The Cultural revolution
DevOps The Cultural revolutionDevOps The Cultural revolution
DevOps The Cultural revolution
 
Holistic JavaScript Performance
Holistic JavaScript PerformanceHolistic JavaScript Performance
Holistic JavaScript Performance
 
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
 
scale_perf_best_practices
scale_perf_best_practicesscale_perf_best_practices
scale_perf_best_practices
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
 
10 practices that every developer needs to start right now
10 practices that every developer needs to start right now10 practices that every developer needs to start right now
10 practices that every developer needs to start right now
 
The Rise of the DataOps - Dataiku - J On the Beach 2016
The Rise of the DataOps - Dataiku - J On the Beach 2016 The Rise of the DataOps - Dataiku - J On the Beach 2016
The Rise of the DataOps - Dataiku - J On the Beach 2016
 
dhiraj_ghavate
dhiraj_ghavatedhiraj_ghavate
dhiraj_ghavate
 
best source to learn python
best source to learn pythonbest source to learn python
best source to learn python
 

Kürzlich hochgeladen

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
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
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
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
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
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
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 

Kürzlich hochgeladen (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
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
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
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
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
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
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 

PHP to Python with No Regrets

  • 1. PHP to Python: No Regrets The Grass Is Always Greener Alex Ezell Emma July 31, 2011
  • 2. the on e on th e left. Hi, I’m
  • 3. The bloodiest wars in history have been religious wars. -Richard M. Nixon
  • 4. Why did we change? How did we change? Would I do it all again? What did we learn?
  • 5. Why did we change?
  • 7. Big, Hairy Ass Goals Rewrite the platform incrementally Provide a world-class customer API Reexamine every tool Quadruple the tech team Lead instead of follow
  • 8. Opportunity Major push from the business for new features more often and the freedom to make that happen Team growth Stability and agreement in other areas: infrastructure, strategic planning, etc. Developer desire - we simply wanted more. Necessity with regards to current codebase
  • 9. Code Unity / Management Lots of background, server processes managing parts of our application. Desire for code in background processes to more closely resemble application code Threading, decoupling, and queueing. Third-party mailer integration. Several small teams working on a single project.
  • 10. Modernizing Our Toolset Homegrown PHP Web Framework -> Django PEAR_DB -> SQLAlchemy Apache -> WSGI No Testing/Docs -> nose and Sphinx CVS Update -> Fabric Deploys of Git Repo
  • 11. Why Python? Maturity and capability Ease of use / Powerful / Low learning curve Rapid development Future of the technology Ecosystem of tools
  • 12. How did we change?
  • 13. Revolution or Evolution? Stop for a full rewrite and not have something compelling when you reboot No new features while the rewrite occurs Inability to really beta test new stuff Fairly entrenched customer base Competition is innovating quickly
  • 14. Service API Scalability, Speed, Fault-tolerant, Easy Deployment Collection of Python WSGI Apps Delayed processes, log readers, and queue consumers New structure for all business logic Smaller, tighter codebase - Easier to build on Public API is just a wrapper Heavy use of Redis
  • 15. Module Fiesta accounts tantuclient tantu audience queueworkers jumper dbsession logparser graffiti
  • 16. Learn the Python Ecosystem Fabric==1.1.2 meld3==0.6.7 Jinja2==2.5.5 nose==1.0.0 Pygments==1.4 paramiko==1.7.7.1 SQLAlchemy==0.7.0 psycopg2==2.4.1 Sphinx==1.0.7 pycrypto==2.3 Tempita==0.5.1 redis==2.0.0 WebOb==1.0 requests==0.5.0 WebTest==1.2.2 setproctitle==1.1 coverage==3.4 supervisor==3.0a10 decorator==3.3.1 wsgiref==0.1.2 distribute==0.6.16 yoyo-migrations==4.1.0 docutils==0.7
  • 17. Testing! Testing! Testing! nose, WebOb, WebTest Rapid iteration Distributed team No testing of the Django app piece
  • 18. Session Handling Let PHP continue to handle session authentication Teach Python how to read/write PHP serialization using Scott Hurring’s code: http://hurring.com/scott/code/ python/serialize/ Django has built-in memcache support, so we make PHP save sessions in memcache
  • 19. Gotta Get That Data PEAR_DB handled all queries and the database connection with hand-written SQL Moving to multi-database, sharded model - handle connections seamlessly Handle different types of encoding seamlessly Rewrite all queries in SQLAlchemy from straight SQL
  • 20.
  • 21.
  • 22. The Campaign Edit Example 2600 lines of code to 700 Exact same functionality including some additional stuff Number of database queries stayed close to the same Very Javascript heavy, so changes might not be as extensive as other sections
  • 23.
  • 24.
  • 25. What did we learn?
  • 26. What We Learned We don’t really need a web framework Django is awesome, so is Flask, so is WSGI git is invaluable for distributed teams on big projects Easy deployment is vital Data encoding sucks and is hard Timezone handling sucks and is hard
  • 27. What We Learned PHP frameworks (CakePHP and Symfony) have come a long way and are on par with Django The shift to sqlalchemy has provided lots of challenges Django template parsing can be slow in certain situations Hiring Python developers can be tough, especially in Nashville Juggling multiple systems is fraught with danger
  • 28. What We Learned Incremental rewrites are technically more difficult Starting from scratch would have left us lost in the marketplace Many of our problems had nothing to do with language choice or tools or frameworks
  • 29. Learning a New Language Porting is bad Bad habits are easy to break in Python, though not unavoidable Python’s interactive interpreter makes tinkering easy Every developer learns in unique ways and at different rates Reading great code
  • 30. Would I do it all again?
  • 32. Positives Codebase is becoming more standardized Developer energy is high Features we have implemented have turned out well and been easy to add functionality to Python’s standard library offers powerful, quality add- on modules for free Developers we have hired have been able to contribute quickly and be impactful
  • 33. Many of us crucify ourselves between two thieves - regret for the past and fear of the future. - Fulton Oursler
  • 35. Contact Me Email: alex@myemma.com Twitter: @aezellisdead or @emmaemailtech
  • 36. We Are Hiring at Emma Happy Hour Tonight at Eddie George’s Grill from 6-8pm http://myemma.com/tech-jobs/ Email: alex@myemma.com Twitter: @aezellisdead or @emmaemailtech
  • 37. Photo Credits Nixon - BusinessWeek: http://images.businessweek.com/ss/07/04/0426_dow/ source/5.htm Change - http://www.flickr.com/photos/spursfan_ace/2328879637/ Kofi Annan - http://www.gambianow.com/news/Open-Forum/Have-Your-Say/ Many_Give_Annan_High_Marks_as_UN_Chief_Despite_Flaws.html Butterflies - http://21stcenturylearning.typepad.com/blog/2009/01/why- change.html Sad boy - http://www.psychologytoday.com/blog/ulterior-motives/200806/will-i- regret-it-in-the-morning-how-about-when-im-64

Hinweis der Redaktion

  1. - while there will be some comparison of languages, this isn’t a talk about which language is better, it’s more about why we chose to switch from PHP to Python\n\n
  2. Name, Title, Experience?\n
  3. - because knowledge is power, I know more about this than you know about that\n- because success begets success, why change what you’re good at?\n- because language, even computer language, is a very personal human construct\n
  4. 4 topics for the preso\n
  5. \n
  6. - software development, especially web, is centered around change\n- business health demands change, mostly growth, but also strategic\n- personal growth demands change, not necessarily language, but new challenges\n
  7. \n
  8. - Looking at a complete rewrite of code for PHP 5/6 compliance\n- Current framework was showing its age: older templating system, older database access layer, maintenance was becoming a chore, adding new features was really difficult\n
  9. - yes, php can run from the command line -- environment, database connection, etc.\n- python is more general purpose from its inception\n- reuse code in scripts\n- threading in mailer processes, yay!\n
  10. - evaluation really began with looking at available Frameworks\n- What’s the most mature and can be used right now?\n- What has some capabilities to change where we might need change?\n- Who has a favorite framework? Name the thing you like most about it.\n
  11. - maturity/capability - who’s using it now? will it integrate with our other tools (database)?\n- use/learning - can we learn it? do we want to?\n- django’s user base is growing exponentially\n- python’s standard library - lots of quality modules\n\n
  12. Talk about timeline\n
  13. - tipping point where retrofit changes sides\n
  14. \n
  15. \n
  16. \n
  17. \n
  18. - added some code to the session stuff\n- wanted to pave the way for Django user management, because it’s nice\n
  19. - multi-database needs to shift on the fly\n- special encoding types: Latin 1, ASCII, Unicode\n- speed of sqlalchemy or the Django ORM - objects vs. arrays\n- writing queries was a big learning curve\n
  20. PHP response. Lots of tables. Many queries. Bad structure forcing bad code.\n
  21. sqlalchemy version of the same query. Better database structure begets better code.\n
  22. - code includes html, db access, javascript, everything\n- queries are interesting because they don’t change much and might actually be more code\n
  23. \n
  24. \n
  25. \n
  26. - do something: internal tools, one-off fun project\n- direction: concurrency, speed, etc.\n
  27. \n
  28. \n
  29. - bad habits: brute force loops vs. generators\n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n