Skip to content

feat: DB optimization, improved container security and improved pipeline checks#19

Merged
codewithme-py merged 1 commit intomainfrom
feat/optimizations-layer
Mar 11, 2026
Merged

feat: DB optimization, improved container security and improved pipeline checks#19
codewithme-py merged 1 commit intomainfrom
feat/optimizations-layer

Conversation

@codewithme-py
Copy link
Copy Markdown
Owner

What has been done:

1. Database optimization (SQL Tuning)

  • Added indexes (B-Tree) to the columns status and created_at in the table reservations.

Why: The ARQ background worker (who searches for overdue reservations) began to work out requests for ~0.08ms (Index Scan instead of Full Table Scan), which is critical for High-Load scenarios during product drops.

2. Docker Hardening (Container Safety)

  • A system non-root user appuser has been created for the FastAPI process.

  • The root file system of the container is switched to read_only: true mode via docker-compose.yaml Writing is allowed only in tmpfs (/tmp) for temporary files.

Why: Minimizing the consequences in the case of a potential RCE - the attacker will not get root rights and will not be able to overwrite the source code of the application.

3. CI / Dealing with addictions

  • Environment consistency validation has been implemented: step uv lock --check has been added to GitHub Actions.

  • Added test coverage control: pytest now crashes with an error if coverage is below 70% (--cov-fail-under).

@codewithme-py codewithme-py merged commit 917809d into main Mar 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant