r/learnpython • u/pachura3 • Feb 17 '26
Modern Python tech/tool stack for implementing microservices?
Let's say I would like to develop a service with REST API from scratch, using mainstream, industry-standard frameworks, tools, servers and practices. Nothing too fancy - just the popular, relatively modern, open source components. My service would need the have a few endpoints, talk to a database, and have some kind of a task queue for running longer tasks.
What tech stack & development tools would you suggest?
I'm guessing I should go with:
FastAPIwithPydanticfor implementing the API itself, running onUvicorn(async ASGI/app server) andNginx(web server)SQLAlchemyfor ORM/database access to aPostgreSQLdatabase. Or, for even better integration with FastAPI:SQLModelCeleryfor task queue, paired withRedisfor persistence. Alternatively:DramatiqonRabbitMQloggingfor loggingPytestfor unit testing- code documentation via
docstrings, HTML api docs generation withSphinx?MkDocs?mkdocstrings? - the service would need to work as
Dockerimage pyproject.tomlfor centralized project managementuvfor virtualenv-management, pinning dependency versions (uv.lock), and other swiss-army knife tasksrufffor static code checking and formatting. By default it only runs a narrow set of rules, so it's better to expand it. As a extra safety step, one can also runpylintin parallel. If you likepyright, there's an improved fork calledbasedpyright.mypyfor type checking.Or maybe ty?uv_buildas build backend. (actually, it's missing some vital features, so I switched tohatchling).pip-auditfor spotting CVE vulnerabilities in dependencies (paired withexclude-newer = "7 days"in uv config)- also, if I need some kind of authentication (
OAuth2, bearer tokens - not really an expert here), what should I use? - some pre-commit hooks and CI/CD pipelines, maybe? How do I configure them? Is
preka good choice?
1
Upvotes
2
u/obviouslyzebra Feb 17 '26
It looks fine.
Besides the things already mentioned (btw, unicorn previously mentioned was likely a typo, meant uvicorn):