Ask for advice on a startup’s tech stack and the answer usually comes back the same: pick boring, batteries-included technology and ship the MVP in a weekend. In practice that means Django or Rails. Both give you an ORM, migrations, an admin panel, session auth, and server-rendered templates on the first day, and none of it needs wiring. A single developer can have users logging in and editing records before Monday.

That advice is right about the first month. I think it gets the following four years wrong, and two things have changed the math since it became standard: code generation from specifications, and AI assistants that do their best work against a compiler.

What the Frameworks Optimize For

Django and Rails optimize for starting. Every default exists so that the first model, the first form, and the first page appear with as little ceremony as possible. Conventions replace configuration, the ORM infers structure from class definitions, and dynamic typing means nothing has to be declared before it is used.

For a prototype those are good tradeoffs, and the frameworks make them openly. The cost is deferred. Each shortcut assumes the application stays small, synchronous, and understood by the people who wrote it. A product that succeeds breaks those assumptions one at a time, and the convenience borrowed in the first month comes back with interest.

How a Monolith Outgrows Its Framework

The path is familiar enough that most backend developers can recite it.

In the first year the application is forms, server-rendered templates, and synchronous request handling. A request comes in, the view runs a query, the template renders, and the response goes out. One developer can hold the whole thing in their head, and nothing needs types because nothing is far from where it was defined.

Then the product needs work that does not fit inside a request: sending email, processing a webhook from a payment provider, building a report, calling a slow third-party API. The framework is built around the request/response cycle, so the work moves out of process. In Django that has meant Celery with RabbitMQ or Redis as the broker. Rails has Sidekiq, and Rails 8 ships Solid Queue as the default. Django 6.0 added a Tasks framework, but it only defines the interface; running the tasks is left to a separate worker. Django also has async views and an async ORM API now, though transactions still do not work in async code, and the docs recommend wrapping that part in a synchronous function. Whichever route you take, you now run a second kind of process, deploy it, monitor it, and pass data to it across a serialization boundary. A job’s arguments are a JSON blob, and the code that enqueues the job and the code that runs it agree on its shape by convention only.

The frontend comes next. Server templates handle forms and lists well and struggle with a dashboard that updates live, a drag-and-drop editor, or a mobile app that needs the same data. The team adopts React and builds a JSON API with Django REST Framework or Rails in API mode. Templates, forms, and most of the view layer stop mattering. DRF serializers become a second hand-written definition of every model, the frontend keeps a third one in TypeScript, and the contract between the two applications lives in nobody’s compiler.

Eventually several parts of the system need to react to the same events, the job queue turns into a bottleneck or a source of duplicate work, and someone adds Kafka. Python producers emit dictionaries, Python consumers read dictionaries, and the schema lives in a wiki page if it lives anywhere. The simple monolith has become a distributed system made of web processes, workers, a broker, an event log, and a separate frontend, connected by data whose shape is checked only at runtime.

None of these steps is a mistake on its own. Each answers a real need. Together they remove most of the batteries the framework provided and add boundaries the framework never typed.

When the People Who Knew Leave

For a while the system works because of the people who built it. They remember that process_order gets customer as an ID on one code path and as a model instance on another, that metadata can be None for orders created before the 2023 migration, and which Celery task expects a dict with a retry_count key.

Then the company grows. The original engineers move on or get promoted away from the code. New developers join, and the organization splits into teams that each own a slice of the monolith or a service carved out of it. The knowledge that made the dynamic code safe was never written anywhere a tool could read it.

Without enforced types, a function signature gives you argument names and little else. def calculate_invoice(account, items, options=None) does not say whether account is a model, an ID, or a dict from an API response, what items contains, or which keys options may hold. To find out, you read the implementation, then the functions it calls, then the place four or five layers up where items was assembled. Python and Ruby both support type annotations, but in a codebase that grew without them they are sparse and unenforced, and a wrong annotation is worse than none. Calling another team’s code turns into research. Changing it is harder still, because nothing tells you who depends on the shape you are about to change.

Teams adapt in ways that cost time. Reviewers trace data by hand, so reviews slow down. The test suite grows to cover what a type checker would have checked for free, and CI time grows with it. Developers add if x is not None guards everywhere, which hides the real contract further. Work that should take an afternoon gets scheduled for a sprint because nobody is sure what it will break. This is why static type checks sit at the top of my checklist for choosing a language .

Twitter’s Move to the JVM

Twitter is the usual example, and the details are more interesting than the “Rails can’t scale” summary.

Twitter launched on Rails in 2006 and grew on it fast enough to prove the frameworks’ case: a small team captured an enormous market. By 2008 the site was also famous for its outage page. The product had changed shape along the way. A tweet is a small write, but delivering it to every follower’s timeline is a large fan-out, and that workload has little in common with the CRUD that Rails was designed around.

The first pieces moved to Scala on the JVM in 2008 and 2009, starting with the message queue. In a 2009 interview with Artima , the engineers gave two kinds of reasons. Steve Jenson pointed to long-lived server processes, which the JVM had been optimized for and Ruby handled poorly. Alex Payne pointed to types. A lot of the logic in their Ruby system replicated a type system, he said, either in unit tests or as validations on models, and “eventually you end up rewriting your own type system, and you sort of do it badly.” That is the previous section described by someone living through it.

By 2013 the main Rails application, which Twitter called the Monorail, had been replaced by JVM services. Raffi Krikorian’s post on a new tweets-per-second record (143,199 in one second during a broadcast of Castle in the Sky) laid out the goals of that rewrite, as InfoQ summarized them : cut the number of machines by a factor of ten, move to services with cleaner boundaries, and let smaller teams ship features faster. Each team owned its services and their interfaces. Raw performance was one goal out of three, and the other two were about how people work together.

Concurrency was the other half. Ruby at the time scaled by running more processes, and Twitter had hit the limits of that model. Finagle , Twitter’s RPC library, represented every remote call as a typed Future, and Marius Eriksen’s paper Your Server as a Function describes how services, filters, and futures compose. A JVM service could keep many calls in flight at once, and the compiler checked how their results were combined.

The companies that stayed on Ruby and Python paid for the same problem in tooling. Stripe wrote Sorbet , a static type checker for Ruby. Shopify adopted Sorbet across its monolith and built Packwerk to enforce boundaries between components inside it. Dropbox spent about three years type-checking four million lines of Python with mypy, whose core team it employed. These are well-run engineering organizations, and each one concluded that a dynamic codebase at its size needed types and module boundaries added after the fact.

How Much Slower Is a Typed Start?

The standard objection is about runway. If a team spends weeks wiring up schemas, auth, and boilerplate in Go, Scala, or C#, the company runs out of money before it launches. Ten years ago that was a fair point. It is much weaker now.

Take a prototype that would need four weeks in Django: email and password login, a handful of JSON endpoints, a simple UI, a few tables. The same scope in a typed stack today could look like this:

  • Go with the standard library router (method and path patterns since Go 1.22), sqlc for queries, a migration tool such as goose, and an auth library or a hosted identity provider.
  • C# with ASP.NET Core Minimal APIs, EF Core migrations, and ASP.NET Core Identity, which since .NET 8 can expose registration and login endpoints through MapIdentityApi.
  • Scala 3 with Tapir , where endpoints are typed values that also produce the OpenAPI documentation.
  • OCaml with Dream , which includes sessions, CSRF protection, templates, and SQL access through Caqti.

Each of these needs more wiring on the first day than django-admin startproject. Auth is the biggest piece in Go, where there is no blessed default. The admin panel is the one battery with no real equivalent: Django generates a usable CRUD interface for every model, and the typed stacks leave you with a database GUI or pages you build yourself. If the business runs on an internal back office, count that.

My estimate for the total difference is one to two weeks on that four-week prototype. For a company with three months of runway, that is real. For a company that expects to exist in four years, it is small next to the cost of adding types to a large codebase later, which is the work Stripe, Shopify, and Dropbox signed up for.

Generating the Boundaries

Hand-written setup is also no longer the baseline for a typed stack. Most backend code is plumbing: parsing and validating JSON at the HTTP edge, and mapping rows and query parameters at the database edge. In The Specification Sandwich I described generating both.

TypeSpec describes the API and compiles to OpenAPI, which oapi-codegen turns into a Go server interface with request and response types, plus a typed client for the frontend. Plain SQL describes the database: a schema file and a file of annotated queries, which sqlc turns into Go structs and query methods. The only hand-written code is the handler in the middle, which maps one set of generated types to the other and makes the actual decisions.

Compare that to the Django path above, where the model, the DRF serializer, and the TypeScript interface are three definitions of the same data kept in sync by people. Here there are two specifications, one per boundary, and the compiler checks the code between them. Rename a field in TypeSpec and every handler that uses it stops compiling. Change a column from nullable to NOT NULL and the generated field changes from *string to string, so every handler that treats it as a pointer fails the build. Adding a field is the case Go lets through, since a struct literal may leave fields out; the exhaustruct linter in golangci-lint closes that gap if you want it closed. The contract that Django teams carry in their heads, and lose when those people leave, sits in files a code generator reads.

What AI Changes

The setup work that remains is mostly declarative: TypeSpec models, SQL DDL, annotated queries, generator config. Language models are good at this kind of text. The formats are small, well documented, and common in training data, and a compiler checks the output immediately, however plausible it looks. An assistant can scaffold the API contract, the tables, and the typed queries for a prototype-sized application in an afternoon, which leaves review as the main cost. Most of the remaining Day-1 gap disappears.

The bigger effect shows up later, when the assistant is wrong. In a dynamic codebase an AI mistake looks like working code. A model writes payload.get("customer_id") when the key is customerId, and the result is None instead of an error. It calls Invoice.objects.filter(stauts="paid"), and nothing complains until that line runs and raises a FieldError. It invents a manager method with a reasonable name. A skimming reviewer approves all three, and they fail at runtime on whichever path the tests missed.

In a typed stack with generated boundaries, the same mistakes fail before anything runs. A misspelled field on a generated struct does not compile. A query that references a missing column fails in sqlc generate. A dereference of a nullable column without a check gets flagged by nilaway , and go vet and golangci-lint catch a further set. Each tool reports a file, a line, and a reason, and an agent can read that output and fix the code on its next step without a person relaying the error. The assistant makes as many mistakes as before, and the toolchain finds them in seconds.

This compounds over time. A codebase in its fourth year is larger than any context window, so an assistant works from a partial view in either stack. With types, the partial view is usually enough: the signature of a function in another team’s package says what it accepts and returns, and the compiler checks the call. Without them, the assistant is in the same position as the new hire from earlier, reading implementations four layers deep, and it is more willing to guess.

Choosing on Purpose

Picking Django or Rails is a loan against future maintenance. For a throwaway experiment, an investor demo, or an internal tool with five users, it is a good loan: you get speed when you need it and may never have to pay it back. The problems start when a team takes it without noticing and the prototype becomes the product.

The rules of thumb I would give a founder or a tech lead:

  • If you choose Python or Ruby, enforce static typing from the first commit. That means pyright or mypy in strict mode, or Sorbet, run in CI and blocking merges. Adding it in year three is the same work at a much higher price.
  • If you already know the product involves background workflows, webhooks, or event processing, pick a runtime with real concurrency and typed messages instead of a synchronous framework with a queue attached.
  • If more than one team will work on the code, or it has to outlive the people who started it, put the contracts in specifications that generate code: TypeSpec or OpenAPI for HTTP, SQL for the database, Protobuf or Avro for events.
  • Measure the setup gap for your own team instead of assuming it. Build a login and two endpoints in both stacks and time it.

The old advice assumed a trade between speed in the first month and sanity in the fourth year. Code generation removed most of the setup work from typed stacks, and AI assistants removed much of what was left while making the compiler more valuable than before. You can have the fast start and still hand a new team, or an agent, a codebase they can change without reading it all first.