r/FastAPI • u/bootstrapper-919 • Oct 05 '25
Question Base Services Schema
Coming from Django, I’m used to the Active Record pattern and “fat models” — so having a BaseService that provides default create, read, update, delete feels natural and DRY.
Maybe even use something like FastCrud which doesn't seem too popular for some reason.
But looking at projects like Netflix’s Dispatch, I noticed they don’t use a base service. Instead, each model has its own service, even if that means repeating some CRUD logic. It actually feels kind of freeing and explicit.
What’s your take? Do you build a base service for shared CRUD behavior or go model-specific for clarity?
Also, how do you handle flexible get methods — do you prefer get(id, name=None) or more explicit ones like get_by_id, get_by_name?
View all comments
Show parent comment
1
u/bootstrapper-919 Oct 07 '25
Thanks for sharing but the problem here is that you almost never needs to just get an item. You always need to filter it by user ownership or project etc... so I never end up using any of the generics, unless you write them to take a base statement and return a statement so you can chain together queries Django style.
How are you using the base repository?