Five years with Django or Rails: upgrades, maintenance and the total cost
TL;DR
Difficulty: Intermediate
Most of an application's cost comes after launch, and most of that is new features. The slice that keeps it healthy is small and cannot be skipped, only postponed.
- Django gives you a calendar: a feature release about every eight months, an LTS every third release with about three years of security fixes, every end date published.
- Rails gives you a queue: security fixes for the newest two release series, so your dates depend on keeping up.
- Your real support date is the earliest of three clocks: framework, language and dependencies.
- In an illustrative five year model the two frameworks differ by one developer day a year of upkeep. Catching up late instead of paying as you go costs about 45% more.
- Rule of thumb: budget a tenth of the build effort every year for upkeep, and write it into the contract.
Everyone asks what an application costs to build. The bigger bill comes after launch. Here is what keeping a Django or Rails application healthy for five years really involves, from the projects' own support policies to a five year cost model for an invented chain of bicycle workshops in Limerick.
The question behind this article
"How much will it cost to build?" is the question everyone asks. It is the wrong one to stop at. A web application that runs a business is not bought once like a van. It is closer to a building: you pay to put it up, and then you pay every year to keep the roof on, the wiring safe and the rooms fit for what the business has become.
This article is about the second bill. What does it cost to keep a Django or a Ruby on Rails application healthy for five years? Healthy means three things: it runs on versions that still receive security fixes, it can take new features without fighting its own past, and nobody is afraid to touch it.
I build on Ruby on Rails, so read anything I say about Rails with that in mind. Every comparison below is one I would expect a senior Django developer to accept as fair, and every policy comes from the projects' own pages as they stand in mid January 2024.
Two ideas carry the whole article, so here they are up front.
- Django gives you a calendar, Rails gives you a queue. Django publishes the month each version loses support. Rails supports the newest release series and the one before it, so your version's clock only starts when the next one ships. Both work. They ask for different habits.
- The framework moves the upkeep bill by a day or so a year. Your discipline moves it by nearly half. In the five year model below, the two frameworks come out within one developer day a year of each other. Skipping upgrades and catching up later costs about 45% more than paying as you go.
I use one invented business throughout, the same one as the rest of this series. Freewheel Cycles is a chain of six bicycle repair workshops in Limerick (freewheelcycles.example). The founder is Niamh. Her developers are Aisling, who has four years of Python, and Cian, who has three years of JavaScript and TypeScript with React. They are replacing spreadsheets and a rented booking widget with their own application, and right now they are building a two week spike of the core in both frameworks. A spike is a short, throwaway build whose only job is to answer a question. Their question is which framework to commit to. Earlier in this series I compared the two philosophies, where each one shines, the honest learning curve and performance, hosting and hiring. This article adds the running costs. The next one in the series turns all of it into a decision method.
Most of the money is spent after launch
Robert L. Glass collected what he called frequently forgotten facts about software engineering in 2001. Two of them belong at the top of any budget. Maintenance typically consumes 40% to 80% of software costs, about 60% on average. And roughly 60% of that maintenance is enhancement, adding new capability to old software, while correcting errors is only about 17%1. He called the pair the 60/60 rule.
Those figures are old and they are averages across very different systems, so treat them as a direction, not a forecast. The direction is what matters: the launch is the start of the spending, not the end of it. And most of what people call maintenance is not fixing things. It is the business asking for more.
That leaves a smaller slice which is pure upkeep: moving to new framework and language versions, applying security patches, replacing dependencies that die, and paying for hosting and monitoring. It is small, but it has an unusual property. You cannot skip it. You can only postpone it, and postponing it has interest.
Example: what "after launch" means for Freewheel Cycles
Niamh has budgeted six months for the first version: online booking with a time slot per mechanic, a live workshop board where job cards move from "waiting" to "in repair" to "ready", photos on job cards, parts stock with a nightly reorder report, "your bike is ready" by email and text message, a back office, invoices with VAT and reporting.
Now list what happens after launch, in the order it will probably arrive:
- The mechanics ask for a small mobile app. That is enhancement.
- A security release of the framework appears on a Tuesday. That is upkeep, and it cannot wait for a quiet week.
- Niamh opens two more workshops and wants reporting per workshop. Enhancement again.
- The language the application runs on, Ruby or Python, publishes a new version, and the old one has an end of life date. Upkeep.
- A small library that formats invoice PDFs stops being maintained. Upkeep, and possibly a surprise.
- The framework itself releases a new feature version. Upkeep, with some new features thrown in.
Items 1 and 3 are the business growing. Items 2, 4, 5 and 6 are the price of standing still safely. This article is mostly about the second group, and about how the choice between Django and Rails changes it.
Django gives you a calendar, Rails gives you a queue
Both projects publish exactly how long each version is supported. They answer the question in two different shapes, and the shape changes how you budget.
How Django supports its versions
Django releases a new feature version roughly every eight months. Every third one is a long term support (LTS) release, which receives security and data loss fixes for a guaranteed period, typically three years2. The numbering makes this visible: 4.0, 4.1, 4.2 LTS, then 5.0, 5.1, 5.2 LTS, and so on3.
A normal feature release gets two kinds of support. Mainstream support covers security fixes, data loss bugs, crashing bugs, major bugs in new features and regressions. Extended support covers only security and data loss fixes4. Crucially, the download page prints the month each one ends4. Django 5.0 came out on 4 December 20235.
Django also gives security fixes to the two most recent release series plus any supported LTS, and it pre announces every security release on the django announce mailing list about a week ahead, with the date and the severity6.
How Rails supports its versions
Rails takes a different approach. Its maintenance policy, as published in January 2024, works by position rather than by date78:
- Bug fixes go to the latest release series only. Today that is 7.1. The maintenance page also lists 7.0 as a special case still receiving bug fixes.
- Security fixes go to the current release series and the next most recent one: 7.1 and 7.0.
- Severe security fixes, as judged by the core team, go to every release in the current major series and to the last release of the previous major series: 7.1, 7.0 and 6.1.
- Anything older is unsupported. You can point your application at the stable branch in Git and backport fixes yourself, but no new versions are released.
Rails 7.1 came out on 5 October 20239. The policy does not say when 7.1 stops being supported, because that depends on when 7.2 and the release after it arrive. Looking back, the gaps between Rails feature releases have varied: 6.0 in August 2019, 6.1 in December 2020, 7.0 in December 2021, 7.1 in October 202310. That is 16, 12 and 22 months.
Rails also numbers versions slightly differently from strict semantic versioning: a minor version such as 7.1 may contain API changes, with breaking changes announced by deprecation notices in the previous release8. So the step from 7.0 to 7.1 deserves the same respect as the step from Django 4.2 to 5.0.
Why the shape matters
With Django, you can write a date in the budget. "Django 4.2 is supported until April 2026" is a sentence a finance director can put in a spreadsheet. With Rails, you write a habit instead: "we stay within one release series of the newest". The habit protects you whatever the dates turn out to be. The calendar lets you plan a large step far ahead.
Neither is better. A calendar suits organisations that budget in big, rare projects. A queue suits teams that do a little every month. The mistake is to treat Rails as if support ran for a fixed three years, or Django's LTS as if you could forget it until the last month.
Example: where the two Freewheel spikes stand on 16 January 2024
Aisling and Cian built their spikes on the newest versions: Rails 7.1 on Ruby 3.3, and Django 5.0 on Python 3.12. Here is the support picture for those and for the versions around them, taken from the official pages471112.
| Line | Released | Bug fixes | Security fixes |
|---|---|---|---|
| Django 5.0 | 4 December 2023 | until August 2024 | until April 2025 |
| Django 4.2 LTS | April 2023 | ended 4 December 2023 | until April 2026 |
| Django 3.2 LTS | April 2021 | ended December 2021 | until April 2024 |
| Rails 7.1 | 5 October 2023 | while it is the newest series | while it is one of the two newest series |
| Rails 7.0 | December 2021 | listed as a special case | while it is one of the two newest series |
| Rails 6.1 | December 2020 | none | severe issues only, while 7 is the current major |
| Ruby 3.3 | 25 December 2023 | normal maintenance | end of life not yet set |
| Ruby 3.2 | 25 December 2022 | normal maintenance | until 31 March 2026 (expected) |
| Ruby 3.0 | 25 December 2020 | security only | until 31 March 2024 (expected) |
| Python 3.12 | 2 October 2023 | bug fixes | until October 2028 |
| Python 3.8 | 14 October 2019 | security only | until October 2024 |
Read the table as Niamh would. On the Django side every row has a date: 5.0 is safe until April 2025, and the planned 5.2 LTS (April 2025 on Django's roadmap today) is the natural next stop. On the Rails side, 7.1 is safe for as long as the team keeps within one release of the newest, and the only dates come from Ruby.
The interesting rows are the old ones. Any business still running Django 3.2 has about three months of security fixes left. Any business on Ruby 3.0 has about ten weeks.
Rails is missing from that chart on purpose. It has no end dates to plot, which is the whole point of a queue.
Your support ends at the earliest of three clocks
A web application does not run on a framework alone. It runs on a framework, on a language, and on dozens of smaller packages, the dependencies. Each has its own support clock. The application is only as supported as the first clock to run out.
- is the date until which your whole stack receives security fixes.
- is the end of security support for your Django or Rails version.
- is the end of life of your Python or Ruby version.
- is the earliest date at which a dependency you rely on stops being maintained or stops supporting your versions.
- means "the earliest of".
The formula is trivial. The habit is not: teams check the framework's date, feel safe, and forget the language underneath. (Foundations: ratios and rates covers the basic arithmetic of working with rates and time spans used throughout this article.)
The language clocks are predictable in both worlds. Python releases a new version every October and supports it for about five years: roughly 18 months of bug fixes followed by security fixes only1213. Ruby releases on 25 December each year, and recent versions have reached end of life about three years and three months later11. Ruby 3.3 came out three weeks ago, on 25 December 202314.
The language also moves under the framework. Python 3.12 removed the old distutils package entirely15. Ruby 3.3 warns when an application requires libraries such as base64, bigdecimal or csv without listing them in the Gemfile, because they will stop shipping as default parts of Ruby16. Neither change is dramatic. Both land on someone's desk.
Example: four stacks, four end dates
Take four stacks a business could be running on 16 January 2024 and apply the formula. Assume, for now, that every dependency is healthy, so only the first two clocks count.
| Stack | Framework clock | Language clock | Supported until |
|---|---|---|---|
| Django 4.2 LTS on Python 3.8 | April 2026 | October 2024 | October 2024 |
| Django 4.2 LTS on Python 3.12 | April 2026 | October 2028 | April 2026 |
| Rails 7.0 on Ruby 3.0 | while 7.0 is one of the two newest | 31 March 2024 | 31 March 2024 |
| Rails 7.1 on Ruby 3.3 | while 7.1 is one of the two newest | not yet set (about 2027 on past form) | set by your upgrade habit |
The first row is the trap. Django 4.2 is the LTS, and the team believes it has until April 2026. The Python version underneath ends 18 months earlier. Django 4.2 is also the last series to support Python 3.8 at all17, so moving to a newer Python is a small job now and a forced one later.
The third row is the same trap on the Rails side, and it is closer. Rails 7.0 is still inside its security window. Ruby 3.0 is not going to be for much longer.
The fourth row is where Freewheel's Rails spike sits. Its end date is not in any table. It is in Aisling and Cian's habits.
What an upgrade involves in Rails
An upgrade has two parts: a small mechanical one and a larger one of reading and testing. Both frameworks document the process carefully. Here is the Rails version, taken from the official upgrading guide for 7.118.
The guide's first advice is about tests, not code: the best way to be sure an application still works after an upgrade is to have good test coverage before you start. Without tests you have to click through every piece of functionality by hand. Then:
- Upgrade Ruby and Rails separately, Ruby first.
- Move one minor version at a time, so you make use of the deprecation warnings.
- For each step, move to the latest patch release of your current version, fix the tests and deprecations, then move to the latest patch of the next minor version.
- Run the update task,
bin/rails app:update, which offers new and changed configuration files interactively. - Switch on the new framework defaults one by one, then raise
config.load_defaults.
A deprecation warning is the framework telling you "this still works today, but it will be removed in a later version, and here is what to use instead". It is the least expensive upgrade information you will ever get, because it arrives while the old code still runs.
Example: making the Rails spike ready for its next upgrade
Freewheel's Rails spike is on 7.1, so there is nothing to upgrade today. The useful work is to make the next step boring. Aisling starts by making deprecations fail the test suite, so they cannot pile up quietly. Rails 7.1 generates this setting in config/environments/test.rb as :stderr, which only prints them19. Aisling changes it:
# config/environments/test.rb
Rails.application.configure do
# Print is the generated default. Raise makes any deprecated call
# fail the test that triggered it, so it is fixed the day it appears.
config.active_support.deprecation = :raise
# Generated by Rails 7.1 already: specific deprecations you have
# declared as disallowed always raise.
config.active_support.disallowed_deprecation = :raise
end
When 7.2 eventually arrives, the step itself looks like this. First the Gemfile, pinned to the minor series so that bundle update only brings in patch releases until someone decides otherwise:
# Gemfile
# "~> 7.1.2" means 7.1.2 or any later 7.1 patch, never 7.2.
gem "rails", "~> 7.1.2"
To take the step, Cian raises the pin to the next series and runs the update task:
# After changing the pin in the Gemfile to the next minor series
bundle update rails
# Offers each new or changed config file; review every difference
bin/rails app:update
# Run everything, including the slower system tests
bin/rails test:all
The update task creates a file named config/initializers/new_framework_defaults_X_Y.rb with every new default commented out. The application keeps its old behaviour until someone uncomments a line. Here is one real entry from the 7.1 version of that file20, exactly as generated:
# config/initializers/new_framework_defaults_7_1.rb
# Do not treat an `ActionController::Parameters` instance
# as equal to an equivalent `Hash` by default.
#++
# Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality = false
Uncomment the line, run the tests, deploy, then take the next one.
Once every line is switched on and in production, the file is deleted and config/application.rb moves to the new version:
# config/application.rb
module Freewheel
class Application < Rails::Application
# Raise this only after every new default is enabled and in production.
config.load_defaults 7.1
end
end
That is the whole shape of a Rails upgrade: pin, update, review generated files, flip defaults one at a time, raise the defaults version. For larger jumps, the community next_rails gem by FastRuby.io adds dual booting, which runs the test suite against the current and the next Rails version side by side21.
What an upgrade involves in Django
Django's upgrade guide reads remarkably like Rails'22. Read the release notes for every version between yours and the target. Look at the deprecation timeline. Resolve every deprecation warning on your current version before you move. Upgrade one feature release at a time, using the latest patch of each, and use the same incremental approach from one LTS to the next. Upgrade your dependencies too, and wait if one of them is not ready.
Django's deprecation policy is precise. A feature deprecated in version A.x keeps working through all A.x releases with a warning, and is removed in B.0, or in B.1 if it was deprecated in the LTS, so every deprecation lives through at least two feature releases3. In code, each deprecation is a warning class named after the version that removes it. In Django 5.0, RemovedInDjango51Warning marks things that disappear in 5.1 and RemovedInDjango60Warning marks things that disappear in 6.023.
One difference catches people out. Python hides deprecation warnings by default. You have to switch them on.
Example: making the Django spike ready for its next upgrade
Aisling does the same preparation on the Django spike. The documented way to see the warnings is the -Wa flag on the Python interpreter22:
# Show every warning, including deprecations, while the tests run
python -Wa manage.py test
Seeing warnings is good. Failing on them is better, for the same reason as on the Rails side. She adds a filter to the test settings, so a deprecation scheduled for the next feature release fails the build:
# freewheel/settings/test.py
import warnings
from django.utils.deprecation import RemovedInDjango51Warning
from .base import * # noqa: F401,F403
# Anything Django 5.1 will remove fails the suite today, while the old
# code still runs and the fix is small.
warnings.simplefilter("error", RemovedInDjango51Warning)
The pin in the requirements file mirrors the Rails one:
# requirements.txt
# "~=5.0.1" means 5.0.1 or any later 5.0 patch, never 5.1.
Django~=5.0.1
When 5.1 arrives, the step is: raise the pin, install, run the full suite with warnings on, fix what fails, deploy. If the project uses caching, the guide also recommends clearing the cache after an upgrade, because pickled objects are not guaranteed to be compatible across versions22.
The Django community has its own helper too. Adam Johnson's django-upgrade tool rewrites code to newer Django idioms automatically for a target version, for example --target-version 5.024.
Does the framework change the upgrade bill?
Put the two processes side by side and the honest answer is: less than either community likes to think.
| Rails | Django | |
|---|---|---|
| Feature release rhythm | irregular, 12 to 22 months recently | roughly every 8 months |
| Support model | by position: newest two series for security | by date: published months, LTS about three years |
| Size of a typical step | larger: new framework defaults to adopt one by one | smaller: two release deprecation window |
| Official tooling | bin/rails app:update, new framework defaults file | deprecation warning classes, python -Wa |
| Community helper | next_rails dual boot | django-upgrade code rewriter |
| Security pre announcement | announcement on the embargo date | about a week ahead, with severity |
Django has more, smaller steps. Rails has fewer, larger ones. Over a year they come to roughly the same effort. The real differences are elsewhere: Django lets you choose a lumpy LTS to LTS strategy with dates fixed years ahead, and it warns you a week before security releases. Rails ships more of the stack as defaults (Active Job, Action Mailer, Active Storage, and Hotwire through its default gems), so one upgrade moves more of your application at once, but there are fewer independent packages to coordinate.
Example: the upgrade line for each spike, in developer days per year
These are my estimates for an application of Freewheel's size with a good test suite, not measurements. They are there to show the shape, and I give the reasoning for each line.
| Item per year | Rails spike | Django spike | Reasoning |
|---|---|---|---|
| Framework feature upgrades | 6 | 6 | Rails: a minor about every 16 months at 8 days each. Django: a feature release about every 8 months at 4 days each |
| Language upgrade | 2 | 2 | one Ruby or Python version a year |
| Major updates of other dependencies | 4 | 4 | the handful of packages that change their API each year |
| Upgrades, | 12 | 12 | |
| Framework security releases | 2.5 | 3.5 | five release days in 2023 for Rails, seven for Django, half a day each |
| Routine dependency updates and audits | 9.5 | 9.5 | a weekly batch of about two hours |
| Security and dependencies, | 12 | 13 | |
| Upkeep in total | 24 | 25 |
The security line uses real counts. In 2023, rubygems.org shows Rails security versions (the four part numbers such as 7.0.4.1) released on five separate days10. Django's security archive lists security releases on seven days25. One day a year between the two is noise. That is the first half of this article's claim: the framework barely moves the upkeep bill.
Security patches are the part you cannot schedule
Upgrades can wait for a convenient week. Security releases cannot. They arrive when someone finds a hole, and the clock starts the moment the fix is public, because the fix also tells attackers where the hole was.
Both projects run a careful, private disclosure process626:
- Django pre announces each security release on the django announce list about a week before, with its date and severity (high for remote code execution or SQL injection, moderate for cross site scripting or cross site request forgery, low for things like data exposure), then publishes the fixes, the release notes and a weblog post on the day6.
- Rails sends the announcement to its security announcements forum on the embargo date, releases the gems the same day and posts on the Rails weblog. Rails asks you to subscribe to that forum section, and it states plainly that nobody, however large, gets notified earlier26.
The framework is only one source. Every dependency can ship a fix too. That is what the audit tools are for:
bundler-auditchecks theGemfile.lockof a Ruby application against the Ruby Advisory Database and also flags insecure gem sources27.pip-audit, maintained by the Python Packaging Authority (PyPA), checks a Python environment or requirements file against the Python Packaging Advisory Database, or against Open Source Vulnerabilities (OSV)28.
Example: a security release lands on a Tuesday
Here is how I would want it to go at Freewheel, step by step, with either framework. The audit runs on every push and every night in continuous integration (CI), the service that runs the tests automatically whenever code changes.
# Rails: refresh the advisory database, then check Gemfile.lock
bundle exec bundle-audit check --update
# Django: check the pinned requirements against PyPI advisories
pip-audit -r requirements.txt
- Tuesday 9am. The nightly audit failed overnight, or the announcement arrived by email. Cian reads the advisory and asks one question: does the affected feature exist in our application?
- 9.30am. It does. He raises the patch version, which the pin allows without touching anything else, and pushes a branch.
- 10am. The full test suite runs in CI and passes. Because Freewheel takes every patch release as it comes, the jump is one patch, not twelve.
- 10.30am. Deploy, check the error monitoring, close the ticket and write one line in the upgrade log.
Ninety minutes, because three things were already true: the application was on a supported version, the pin made the patch a one line change, and the tests made it safe. Take away any one of the three and Tuesday becomes a week.
A word on the law
General information, not legal advice. Freewheel holds personal data for 9,000 active customers. Under Article 32 of the General Data Protection Regulation (GDPR), a business must take appropriate technical and organisational measures to secure personal data, measured against current technical standards and the risk, and must regularly test and evaluate them29. Running a framework that no longer receives security fixes is hard to square with current technical standards. If a breach does happen, the Data Protection Commission (DPC) is the regulator in Ireland30. A lawyer can tell you what applies to your business. The engineering point is simpler: a supported, patched stack is the easiest part of that duty to meet.
Judge a dependency by its exit cost, not by its stars
The third clock is the one teams forget. A dependency is any package your application uses that you did not write: a gem in Rails, a package in Django. Both frameworks include a great deal, which is part of their appeal, but every real application adds 20 to 60 more.
Most advice on choosing dependencies asks about popularity: stars on GitHub, downloads, recent commits. Those tell you how likely a package is to stay alive. They do not tell you what happens to you if it does not. So I ask a second question first.
If this package stopped being maintained tomorrow, how many developer days would it take us to replace it or to look after it ourselves? That is the exit cost. Multiply it by a rough chance of abandonment over five years and you have an expected cost you can compare across packages, which is the same arithmetic as expected value in Foundations: expected value.
A dependency with a high exit cost deserves a careful look before you add it. One with a low exit cost hardly matters, however obscure.
Signals worth checking, in both ecosystems:
- Does it support the version you will move to next? On PyPI, packages list the Django versions they support in their classifiers. In Ruby, the gemspec states which Rails versions the gem accepts.
- Who maintains it? One person in their spare time, a company, or a foundation.
- How fast were the last few security issues handled?
- Could the framework do this already? Rails 7.1 and Django 5.0 each cover a great deal. Every package you avoid is a clock you do not have to watch.
Example: Freewheel's dependency inventory
Aisling lists what each spike adds beyond the framework. The package names below are a typical set for this kind of application. The exit costs and chances are my illustrative estimates.
| Need | Rails spike | Django spike | Exit cost (days) | Chance of abandonment in 5 years | Expected cost (days) |
|---|---|---|---|---|---|
| Image resizing for job card photos | image_processing | Pillow | 3 | 5% | 0.15 |
| Text message sending | twilio-ruby | twilio | 2 | 10% | 0.2 |
| Live workshop board | built in (Hotwire) | django-htmx plus htmx | 0 / 4 | 0% / 15% | 0 / 0.6 |
| Invoice PDFs | a small PDF gem | a small PDF package | 8 | 40% | 3.2 |
| Background jobs | a job backend gem | a task queue package | 6 | 10% | 0.6 |
One line stands out: invoice PDFs. Both spikes use a small library maintained by one person, it touches money and tax, and replacing it means checking every invoice layout again. So Aisling keeps the PDF code behind one small class of Freewheel's own, which means the library can be swapped in a few days instead of eight. The exit cost halves before anything has gone wrong. The other lines are grand, and knowing that is half the value of the exercise.
The cliff: what skipping upgrades really costs
Every team that falls behind had a good reason at the time: the busy season, a big feature, "it still works". Skipping one upgrade does save time that quarter. The bill turns up later, bigger, at a moment you did not choose. That moment is the cliff.
Here is what makes the late bill bigger, item by item:
- The steps are the same. Both guides tell you to go one version at a time even when you are far behind1822. Skipping three steps means doing three steps later, plus everything below.
- Dependencies have moved on. Packages drop support for old framework versions. Catching up means replacing or upgrading several at once, which you would otherwise have done one at a time inside routine updates.
- Nobody remembers the code. Glass estimated that understanding the existing product is the dominant maintenance task, about 30% of maintenance time1. After three years, the person who wrote the booking code may have left.
- Everything changes at once. A big bang upgrade touches every part of the application in one release, so bugs surface in production that ten small releases would have caught one by one.
- You are exposed in the meantime. Between the end of security support and the catch up, every newly found vulnerability in your version stays open.
The last item is risk, not effort, so it needs a different kind of sum:
- is the expected cost of running unsupported.
- is the chance per year that a vulnerability affecting your application is found and exploited.
- is the cost of one such incident: downtime, investigation, customer notices, lost bookings.
- is the number of years you run unsupported.
Expected cost means the average outcome over many possible futures, not a forecast that it will happen. Foundations: expected value explains it from scratch.
Example: Freewheel pays as it goes, or catches up in year five
Two versions of Freewheel's next five years, with the developer days from the upgrade table above and a blended internal cost of €400 per developer day. That rate is an illustrative assumption for a developer employed in Limerick, including employer's PRSI and other costs.
Continuous. Year 1 is a launch year with 14 days of upkeep (4 days of upgrades and 10 days of security and dependency work after launch). Years 2 to 5 take 24 days each. Total: 14 + 4 × 24 = 110 days.
Deferred. Year 1 is the same, 14 days. In years 2 to 4 the team only applies patches within its current versions: 12 days a year, no upgrades. In year 5 an end of life date forces the catch up. Here is my estimate of it:
| Catch up item | Days |
|---|---|
| Three framework steps at 8 days | 24 |
| Three language steps at 2 days | 6 |
| Dependencies replaced or upgraded in one go | 20 |
| Relearning the code, about 30% of the 50 days above | 15 |
| Stabilising after a big bang release | 10 |
| Catch up in total | 75 |
Year 5 is then 12 + 75 = 87 days. Total: 14 + 3 × 12 + 87 = 137 days.
The difference in effort is 137 minus 110, which is 27 days, which at €400 a day is €10,800.
Now the exposure. Assume the deferred team runs unsupported for two years (), puts the chance of a relevant, exploited vulnerability at 10% a year () and the cost of an incident at €45,000 (). These are illustrative assumptions, not statistics:
- , the assumed yearly chance of a relevant, exploited vulnerability.
- , the assumed cost of one incident in euro.
- , the years run unsupported.
- , the expected cost in euro.
So skipping costs:
- is the extra cost of deferring, in euro.
- 27 is the extra developer days, 400 the cost per day in euro, and 9,000 the expected exposure from above.
The continuous upkeep for the whole five years was 110 days, or €44,000. Deferring adds €19,800 to that, which is about 45% more (Foundations: percentages). And it arrives as 87 days in one year: for two developers, roughly ten weeks with no new features, at a time chosen by an end of life date rather than by Niamh.
The chart shows why deferring is tempting. For three years the deferred line looks like a saving. The saving is a loan.
A five year total cost model
Now everything in one place. The model below adds the build, five years of feature work, upgrades, security and dependency work, hosting and monitoring:
- is the total cost of owning the application for five years.
- is the cost of building the first version.
- counts the years, from 1 to 5, and means "add up the bracket for each of the five years".
- is feature work in year : everything the business asks for after launch.
- is upgrades in year : framework, language and major dependency versions.
- is security and dependency work in year : patches, audits and routine updates.
- is hosting in year : servers, database, backups, a staging copy.
- is monitoring in year : error tracking, uptime checks, logs.
Developer work is days multiplied by the day rate . Hosting and monitoring are paid in money directly. Foundations: ratios and rates covers turning days into money with a rate.
Example: Freewheel Cycles over five years
All figures are illustrative and mine, built from the assumptions already stated. The day rate is €400.
- Build, : two developers for six months, about 240 developer days. 240 × €400 = €96,000.
- Features, : 150 days in the second half of year 1, then 360 days a year as the business grows towards more workshops, a mechanics app and better reporting. 1,590 days in all, €636,000.
- Upgrades, : 4 days in year 1, then 12 a year. 52 days, €20,800.
- Security and dependencies, : 10 days in year 1, then 12 a year. 58 days, €23,200.
- Hosting, : €140 a month in years 1 and 2, €230 a month from year 3 as the chain grows. €1,680 + €1,680 + 3 × €2,760 = €11,640.
- Monitoring, : €70 a month in years 1 and 2, €120 a month from year 3. €840 + €840 + 3 × €1,440 = €6,000.
Year by year, in thousands of euro:
| Year | Build | Features | Upgrades | Security and dependencies | Hosting | Monitoring | Total |
|---|---|---|---|---|---|---|---|
| 1 | 96.0 | 60.0 | 1.6 | 4.0 | 1.68 | 0.84 | 164.12 |
| 2 | 0 | 144.0 | 4.8 | 4.8 | 1.68 | 0.84 | 156.12 |
| 3 | 0 | 144.0 | 4.8 | 4.8 | 2.76 | 1.44 | 157.8 |
| 4 | 0 | 144.0 | 4.8 | 4.8 | 2.76 | 1.44 | 157.8 |
| 5 | 0 | 144.0 | 4.8 | 4.8 | 2.76 | 1.44 | 157.8 |
| Five years | 96.0 | 636.0 | 20.8 | 23.2 | 11.64 | 6.0 | 793.64 |
So:
- , the build.
- , five years of feature work.
- and , upgrades and security work.
- and , hosting and monitoring.
- , the five year total in euro.
Three things stand out.
The build is about an eighth of the total. €96,000 out of €793,640 is 12.1%. Everything else happens after launch, which is Glass's point made concrete. Freewheel's post launch share is higher than his 40% to 80% because Niamh plans to keep both developers and keep building.
Feature work dominates. €636,000, about 80%. That is not maintenance in the gloomy sense. It is the business growing.
Keeping it healthy is small, and steady. Upgrades plus security and dependencies come to €44,000, 5.5% of the total. Hosting and monitoring add €17,640, 2.2%.
A rule of thumb you can use tomorrow
Here is the rule I take from this model, and it is my judgement, not a published standard: budget about a tenth of the build effort, every year, for keeping the application healthy. Freewheel's build is 240 developer days. Its steady upkeep is 24 days a year. If your build is 400 days, expect around 40 days a year of upgrades, security and dependency work, whichever framework you choose.
The rule fails in two predictable ways. It runs high if the application is small and uses almost nothing beyond the framework. It runs low if the application has a weak test suite, because every upgrade then needs days of clicking through by hand. The test suite is the one investment that lowers every upkeep line at once (it is also why I write the tests before the code), which is why the series on testing later in this programme ends with keeping a suite fast and trustworthy in CI.
Upgrade now or later?
Not every release needs to be taken the day it ships. A new feature release often waits for your dependencies to catch up, and that is fine. What matters is that waiting is a decision with a review date, not a default.
Example: three releases, three decisions
Run the flow on three releases Freewheel will meet in its first year. The dates of future releases are not known yet, so these are realistic situations rather than a forecast.
- A Django or Rails security patch. The flow stops at the first question: patch within days. This is the Tuesday from earlier.
- Ruby 3.3 or Python 3.12 when the spike started on the version before. Not a security release. Support for the old version runs for years, so there is no rush. The dependencies support it, and the suite passes with deprecations as errors. Upgrade now, while it is a two day job.
- The next Rails or Django feature release, in its first week. Not a security release. Support for the current version continues. But the background job package or the PDF library has not declared support yet. Wait, with a review date four weeks out. When the review comes, run the flow again.
The third case is where teams drift. "Wait" without a date becomes "skip", and "skip" becomes the cliff.
For the person paying for this: what to put in the contract
If you commission an application, from an in house team or from someone like me, upkeep is the part most likely to be missing from the agreement. Build contracts describe features. Nobody writes down who keeps the thing supported, so nobody does, and three years later the business owns an application that runs on versions without security fixes. These are the clauses I would want in any agreement for a web application, as the buyer. This is general information, not legal advice.
My view:
- Supported versions only. The application always runs on framework and language versions that receive security fixes under the projects' own published policies, linked in the agreement. For Rails that means the newest two release series. For Django, a version inside its published security window.
- A patch window. Security releases rated high or severe by the project are applied within two working days, all other security releases within 14 days. The test suite must pass before deploy.
- An upgrade rhythm. A new framework feature release is adopted within six months of its release, unless a named dependency blocks it, in which case the block is written down with a review date. With Django you can choose LTS to LTS instead, as long as you move before the old LTS loses support.
- Upkeep as its own budget line. A fixed allowance, about a tenth of the build effort a year by the rule of thumb above, reported quarterly, never borrowed for features.
- Tests are a deliverable. The automated test suite is handed over with the code, runs in CI, and treats deprecation warnings as failures.
- A dependency inventory. Every package beyond the framework is listed with what it does, who maintains it and its exit cost, reviewed twice a year, and checked by
bundler-auditorpip-auditon every build. - You own everything. The code repository, the hosting accounts, the domain and the data are in the client's name, so any competent developer can pick up the work. That is how I work: the client owns the code, the accounts and the data.
None of these clauses is about Django or Rails. That is deliberate. The cliff is not a property of either framework.
Example: Niamh's upkeep clause
Here is how the first four points might read in Freewheel's agreement, in plain words:
The application will run on versions of its framework (Django or Ruby on Rails) and of its language (Python or Ruby) that receive security fixes under the projects' published support policies. Security releases rated high or severe by the project will be applied within two working days of publication, others within 14 days, in each case after the automated test suite has passed. New feature releases of the framework will be adopted within six months of release, unless a dependency listed in the inventory does not yet support them, in which case the reason and a review date will be recorded. Freewheel Cycles will fund 24 developer days a year for this work, separately from feature work, with a short report each quarter.
Niamh does not need to know what bin/rails app:update does to hold anyone to that paragraph. The quarterly report only has to answer three questions: which versions are we on, are they supported, and what is next.
If you want help writing these into your own plans, this is part of what I do when I build web applications, and my prices are published, upkeep included.
Conclusion
The cost of an application is mostly paid after launch, and most of that is the business asking for more. The slice that keeps it healthy is small, about a tenth of the build effort each year in my model, and it is the one slice you cannot skip, only postpone at interest.
Django and Rails shape that slice differently. Django gives you a calendar: feature releases about every eight months, LTS releases with about three years of security fixes, and every end date published. Rails gives you a queue: security fixes for the newest two release series, so your dates depend on your habit of keeping up. Either way, your real support date is the earliest of three clocks: framework, language and dependencies.
Over five years, the framework choice moved Freewheel's upkeep by one developer day a year. Paying as it goes rather than catching up at the end saved about 45% of the upkeep bill and ten weeks of frozen features. If you are weighing the two frameworks, the next article in this series puts all of this, together with performance, hosting and hiring, into one decision method. If you are paying for either one, put the upkeep in the contract.
