From 0.10 to 5.2. The story of a 13 year old Rails app - RailsConf 2019

From 0.10 to 5.2. The story of a 13 year old Rails app - RailsConf 2019

Small-dollar donations were critical in the last election. The first version of the software that powers ActBlue, the main player in the space, was written in Rails 0.10.

During 13 years, 30K organizations have used the platform to raise $3 billion.

Some lessons we'll be sharing on this presentation: how to scale a monolith to process 1.5M RPM and 250 payments/sec, how to be productive with a 110K line code base, how to minimize the pain of Ruby/Rails upgrades and technical debt.

Intended for beginner to intermediate developers, managers, and anyone interested in building a lasting system.

7c3079b900a9915716d7517b3ad587bf?s=128

Braulio Carreno

April 30, 2019
Tweet

Transcript

  1. 1.

    Story of a 13 year old Rails app Braulio Carreño

    Principal Engineer from version 0.10 to 5.2 14
  2. 2.

    ActBlue • small-dollar donations • founded 2004 • nonprofit organization

    • independent from political organizations • fundraising platform for Democratic campaigns and committees and nonprofit organizations • all Democratic presidential campaigns relying on ActBlue
  3. 3.
  4. 4.
  5. 5.

    2018 election cycle • 41 million contributions • $1.6 billion

    • $39 average • 15,000 unique campaigns, committees, and organizations
  6. 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)
  7. 9.

    Long-running software • Organization needs to respond to change •

    efficiently • keeping reliability • keeping security • example: Apple Pay implementation
  8. 12.

    Technical debt • treat as a feature • cost /

    benefit • priorities • planning • examples • Pay Pal processing • recurring contributions
  9. 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
  10. 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
  11. 18.

    Codebase after 14 years • 35,000 commits • 110,000 lines

    of source code • 120 top classes • 25 top modules
  12. 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)
  13. 20.

    Good commit messages 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 Subject Body google: "chris beams commit message” https://chris.beams.io/posts/git-commit/
  14. 21.

    Keeping healthy codebase • no source code comments is bad

    • documentation (partial E-R diagrams)
  15. 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)
  16. 24.

    Addressing team growth • fewer and better developers • treat

    developers very well • code reviews / pair programming • mentorship
  17. 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
  18. 30.
  19. 32.
  20. 34.

    Contributions per Month in Millions Oct 06 Dec 18 Dec

    16 move to the cloud “you lie” Oct 10 Oct 08 Oct 12 Oct 18 Oct 14 Oct 16 M ar 16
  21. 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
  22. 37.
  23. 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