Beating the tradeoff between developer velocity and scalability
tomlinford.com
tomlinford.com
But this tradeoff doesn’t need to exist anymore. We’re seeing cloud architectures start to converge more and more, around tools like gRPC and kubernetes.
I feel like I live on a completely different planet than this person, because gRPC, kubernetes, and schemas that generate schemas is NOT how I would improve velocity or scale. I appreciate the article though, it was a good read.
Similarly, because the OpenApi spec gives examples, frontend devs can use the proxy to mock requests and responses with literally 0 code written. This parallelizes development really well because you know everyone is building to the same spec.
Running a bunch of debugs locally with the proxy does slow things up, but it's a trivial add to a containerized workflow.
Highly recommended! Parallelized development, prevents breaking changes, and provides a canonical API model that's always up to date and enforced!
It is never too early to start making an OpenAPI spec. Technical product managers can even deliver parts of specs in this form. The tools are easy enough.
Spec is created before any dev work begins. It might need changes when the work continues, no worries, the specs are versions and your team can decide on what stable versions are/aren't.
Also no asyncio isn’t great in this day and age.
Plain django, without DRF, just using JsonResponse is pretty great TBH, has all the batteries for things like auth and testing. Although having it be async would be a huge plus.
I recommend checking out pydantic and using that to enforce a schema for endpoint responses. Also much easier to understand (imho) than DRF’s serializers and you get static typing for free!
It's most of FastAPI (auto docs generation, great Pydantic integration, etc) but for Django.
That's been the standard in just about every enterprise Java app I've worked on. Having separate internal and external data models is critical for managing change and preserving backwards-compatibility of your API.
That's the happy path. If you focus on that then you will always get the impression that you're moving fast and everything is brilliant. The problem is that the happy path is the easy bit. Thinking through all the potential edge case problems is where things start feeling like you're moving a lot slower.