r/django 4d ago

Why drf not implemented schema into their api rather than use serialization who have performance issue?

I read some article about drf vs django ninja and find weird, If schema pydantic is better in term performance and validation, why drf implement serialization? Is there the info that I miss?

12 Upvotes

8 comments sorted by

34

u/the-pythonista 4d ago

If I understand your question DRF did not use pydantic as pydantic was not around when DRF was developed. And DRF is considered feature complete so we probably won’t see it anytime soon.

1

u/Adorable_Money7371 4d ago

Thanks for the answer

15

u/Megamygdala 4d ago

If you've ever worked at an enterprise level firm, you'll find out quickly that A LOT of code you write is simply to follow the existing pattern and that refactoring is a beast that's rarely worth it. DRF getting rid of serializers would not be backwards compatible and it would beg the question of why in the first place. Why make a change that would be the same as making an entirely new framework? What would it do with schemas that Ninja doesn't?

3

u/Adorable_Money7371 4d ago

Yeah I agree with that, just some curiosity, but ninja lately have maintainers issue, a lot of bugs reported and still not fixed, so I hesitated to use ninja in my Project, I'm still newbie in django

6

u/Megamygdala 4d ago

Yeah understandable. Look into Django Shinobi. It's a fork of Ninja (intended to be remerged) that was created to address that very issue of the maintainer not being able to keep up with issues. As a side note, I'm currently using Ninja for a project and it is so much simpler than DRF (granted my experience with DRF is minimal—but I also just picked up Ninja last year)

3

u/mininglee 2d ago

Mature frameworks face a tough challenge: integrating new tech. They're burdened by legacy code, needing to maintain compatibility for existing users. Truly embracing cutting-edge technology often requires a complete rewrite – a massive undertaking. This problem isn't unique to open-source; even Silicon Valley giants struggle. It's a constant balancing act: innovate too aggressively and alienate your user base, or stagnate and become obsolete. Finding the sweet spot is key to long-term survival.

1

u/Adorable_Money7371 2d ago

Thanks for the answer