DevOps
fromInfoQ
17 hours agoReplacing Database Sequences at Scale Without Breaking 100+ Services
Validating requirements can simplify complex problems, and embedding sequence generation reduces network calls, enhancing performance and reliability.
For a long time I wanted to document something I have done many times in production systems but never explained clearly: using Django ORM as a standalone module to connect to an existing database. In my work I have often dealt with legacy systems where the only reliable source of truth was the database itself. In those situations, Django ORM became my Swiss army knife.
The core idea is three separate attribute layers: inputs (what comes in), internals (working state), and outputs (what goes out). Each is a distinct declaration with its own namespace and type checking. Combined with declarative make calls that define action order, the data flow through a service is visible at a glance: class Payments::Process < ApplicationService::Base input :payment, type: Payment internal :charge_result, type: Servactory::Result output :payment, type: Payment make :validate_status! make :perform_request! make :handle_response! make :assign_payment
About the show Sponsored by us! Support our work through: Connect with the hosts Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 11am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it.
Readable failures. When something breaks, I want to understand why in seconds, not minutes. Predictable setup. I want to know exactly what state my tests are running against. Minimal magic. The less indirection between my test code and what's actually happening, the better. Easy onboarding. New team members should be able to write tests on day one without learning a new paradigm.
We also patched two potential denial-of-service vulnerabilities when handling large, malformed inputs. One exploits inefficient string concatenation in header parsing under ASGI ( CVE 2025-14550). Concatenating strings in a loop is known to be slow, and we've done fixes in public where the impact is low. The other one ( CVE 2026-1285) exploits deeply nested entities. December's vulnerability in the XML serializer ( CVE 2025-64460) was about those very two themes.