文字内容
1. 14 Story of a 13 year old Rails app from version 0.10 to 5.2 Braulio Carreño Principal Engineer
2. ActBlue • • • • • small-dollar donations • all Democratic presidential campaigns relying on ActBlue founded 2004 nonprofit organization independent from political organizations fundraising platform for Democratic campaigns and committees and nonprofit organizations
4. More than Processing Payments • • • • compliance A/B tests campaign dashboards integrations
5. 2018 election cycle • • • • 41 million contributions $1.6 billion $39 average 15,000 unique campaigns, committees, and organizations
6. Lifetime Volume Sep 2012
7. Indigo = our Rails app #4b0082
8. First commit commit 24a91d79bb6ec12a124d4544e96b94a78fa6059e (HEAD) Author: Matt DeBergalis Date: Fri Mar 11 18:28:22 2005 +0000 diff --git a/CHANGELOG b/CHANGELOG --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,435 @@ +*0.10.0* (24th February, 2005)
9. Long-running software • Organization needs to respond to change • • • • efficiently keeping reliability keeping security example: Apple Pay implementation
10. Age Growth Technical debt Codebase Obsolescence Team Complexity Load
11. Age Growth Technical debt Codebase Obsolescence Team Complexity Load
12. Technical debt • • • • • treat as a feature cost / benefit priorities planning examples • • Pay Pal processing recurring contributions
13. Age Growth Technical debt Codebase Obsolescence Team Complexity Load
14. Obsolescence • • • old versions aren’t maintained worst technical debt high security risk
15. Rails and Ruby Upgrades • • • • • • good test suite don’t skip minor versions Rails Guides: Upgrading Ruby on Rails read release notes fix deprecation and other warnings move to latest patch ex: 5.2.3
16. Rails and Ruby Upgrades • • • • • • switch from third party gem to standard Rails / Ruby minimize surface of upgrade get rid of obsolete / unmaintained gem or fork it gem dependencies harder than Rails / Ruby exception: from Ruby 1.8.7 to 1.9 (encodings) Workshop Thursday: Upgrade Rails 101
17. Age Growth Technical debt Codebase Obsolescence Team Complexity Load
18. Codebase after 14 years • 35,000 commits • 110,000 lines of source code • 120 top classes • 25 top modules
19. Codebase growth • • • long-lived applications are a mess software: writing is easier than reading most common experience: • • • green field app legacy app: very small change or re-write first non-mess app: 7 year old Indigo (2012)
20. Good commit messages Subject Fix source detection in case of multiple candidates This commit improves the detection of a property source when more than one group with the same type exist. Closes gh-16549 google: "chris beams commit message” https://chris.beams.io/posts/git-commit/ Body
21. Keeping healthy codebase • • no source code comments is bad documentation (partial E-R diagrams)
22. Age Growth Technical debt Codebase Obsolescence Team Complexity Load
23. Team growth • • • • ActBlue was bootstrapped 2012: 22 ActBluers = 7 technical team, 4 developers today: 120 ActBluers = 34 technical team, 20 developers increased communication and process (multiple teams)
24. Addressing team growth • • • • fewer and better developers treat developers very well code reviews / pair programming mentorship
25. Age Growth Technical debt Codebase Obsolescence Team Complexity Load
26. No user action on tip step (2015)
27. highly optimized for load performance Contribution form flowchart
28. Separate FormApp • • • • first version of FormApp in Rails know when not to use Rails best tool for the job (React) monolith: follow the framework
29. Age Growth Technical debt Codebase Obsolescence Team Complexity Load
31. “You Lie” Rep. Wilson 9/9/09 CONTRIBUTIONS PER HOUR
33. Sanders NH primary 2/9/16
34. 6 16 t1 ar M Oc Oct 18 Contributions per Month in Millions 4 t1 Oc 2 t1 Oc 8 c1 De 6 c1 De to ve oud moe cl th ” lie 0 t1 Oc ou “y 8 t0 Oc 6 t0 Oc
35. “Rails doesn’t scale” — Twitter
36. Scaling • architecture • • • • • • avoid “centralized” processing build parallelism and concurrency load balancing asynchronous jobs (sidekiq, Active Job) content delivery network (CDN) Fastly RailsConf 2017 High Performance Political Revolutions
38. thanks! Join us! ActBlue is always looking for top talent https://actblue.com/jobs jobs@actblue.com Braulio Carreño @bcarreno https://carreno.me