Cheat sheet · Build products
Backend development cheat sheet (Rust)
Opens with creditsA quick-revision companion to the backend roadmap in Rust, for anyone building APIs with Axum, Tokio and SQLx. Read a chapter before a project, an exam or a technical conversation, and use the glossary to refresh a term you half remember.
Chapters
9 chapters · 78 concepts
1Rust essentials for the backendThe parts of Rust that shape every service: ownership, enums and Result, traits, Cargo, async on Tokio, shared state, and the Axum and SQLx crates most APIs start from.9 concepts
- 1Ownership and borrowingEvery value has one owner and is dropped when the owner goes out of scope.
- 2Structs, enums and pattern matchingStructs group named fields.
- 3Result, Option and the ? operatorA function that can fail returns
Result<T, E>, and a value that may be missing is anOption<T>. - 4Traits and genericsA trait lists methods a type promises to have, implemented with
impl Trait for Type. - 5Cargo, crates and featuresCargo builds, tests and runs Rust code.
- 6async/await on TokioAn async function returns a future, which does nothing until it is awaited.
- 7Shared state: Arc, Mutex, Send and Sync
Arc<T>shares one value between tasks by counting references, andMutex<T>orRwLock<T>lets them change it one at a time. - 8Axum routers, extractors and IntoResponseAn Axum handler is an async function whose arguments are extractors:
Path,Query,JsonandStatepull typed values out of the request. - 9SQLx: checked queries and a poolSQLx runs plain SQL asynchronously.
9 in this chapterOpen this chapter2Terminal and GitThe two tools every backend task starts with: moving around a machine in a shell, and keeping every change in version control.3 concepts
- 1Terminal essentialsA shell runs commands such as
cd,ls,cat,grepandcurl, and pipes (|) feed one command's output into the next. - 2Git commits and branchesGit records snapshots of your project as commits.
- 3Pull requestsA pull request proposes merging a branch into main and shows the diff, CI results and review comments in one place.
3 in this chapterOpen this chapter- 1Terminal essentialsA shell runs commands such as
- How HTTP worksWhat happens between a client and your server: finding it, connecting securely and exchanging requests and responses.6 conceptsOpens with credits
- Relational databases and SQLModel data, query it by hand, index it for real queries, keep it consistent with transactions and understand what the ORM does for you.10 conceptsOpens with credits
- Designing and building APIsTurn the database into a contract other programs rely on: resources, validation, errors, pagination, safe retries, versioning and documentation.10 conceptsOpens with credits
- Authentication and API securityDecide who is calling and what they may do, store secrets safely and close the holes attackers try first.10 conceptsOpens with credits
- Caching, queues and performanceMeasure first, then make the service fast: cache the right things, keep slow work out of the request path and use database connections wisely.10 conceptsOpens with credits
- Testing, CI/CD and deploymentBuild the safety net that lets you change code without fear: tests against a real database, a pipeline on every push and a container you can deploy and roll back.10 conceptsOpens with credits
- Architecture and reliabilityHow services are split, how they talk and how they fail, and the patterns that keep a system up and traceable when a dependency is slow or down.10 conceptsOpens with credits
- 10Glossary, A to ZEvery concept in the sheet and the smaller terms it uses, in one list.172 terms
About this sheet
APIs, databases, auth, deploys.
Related on Sefism
Picked from the other libraries by shared topics.
Roadmaps
See allBest practices
See all- REST API Design Best PracticesDesign HTTP APIs clients enjoy using: resources and URLs, methods, status codes, problem details errors, pagination, idempotency keys, ETags, versioning and OpenAPI.
- TypeScript Best PracticesModern TypeScript best practices for 2026: strict settings, TypeScript 7, modeling data with unions, safe narrowing, runtime validation, generics and typed linting.
- Authentication Best PracticesBuild sign-in that holds up: password rules from NIST, Argon2id hashing, login throttling, MFA and passkeys, secure sessions and safe account recovery.
Checklists
See all- Production Readiness ChecklistCheck a service before it takes real traffic: ownership, SLOs, capacity, timeouts and retries, alerts, rollout and rollback, backups, security and on-call.
- API Security ChecklistCheck your REST or GraphQL API against the OWASP API Security Top 10: authentication, object authorization, rate limits, input validation, SSRF, CORS and logging.
- Database Migration ChecklistCheck a schema or data migration before it ships: expand and contract, lock behaviour, online indexes, batched backfills, rehearsal on real data, backups, rollback, deploy order and monitoring.
Project structures
See all- Express with TypeScript project structureFor students who know a bit of JavaScript and want a backend that looks like the ones teams actually run. Express gives you almost no structure, so this layout supplies it: one folder per feature under src/modules, each split into routes, controller, service and repository, with Zod at the edge and Vitest plus Supertest for tests.
- NestJS project structureFor people who want a structured TypeScript backend with clear rules about where code goes. Every feature is a Nest module that owns its controller, service, DTOs, entities and tests, so the app grows by adding folders, not by stretching old ones. The tree follows one orders API from nest new to a codebase a whole team can run for years.
- FastAPI project structureA typed Python API for an orders app, built the way the FastAPI docs and the official full stack template lay it out: one
apppackage, a router per feature, Pydantic schemas at the edges, services in the middle and SQLAlchemy models with Alembic migrations underneath. For students who have finished the FastAPI tutorial and want to know where the second, tenth and fiftieth file go.
Career questions
See all- How do I choose between frontend, backend, mobile, cloud, cybersecurity, data and AI without trying them all for years?Do not try to pick the best field; pick the one whose daily problems you can tolerate on a bad day. Run a short, cheap experiment in two or three candidates, compare what you enjoyed doing rather than what sounded exciting, check the local job market, and commit for six to nine months.
- Should I use Firebase or Supabase for my app?Both let you ship an app fast with auth, a database, storage and hosting-style services. Supabase is built on PostgreSQL, so it suits relational data and SQL skills you will reuse anywhere. Firebase is a mature Google platform with a document database and strong mobile tooling. Choose by your data shape, your platform, and how much you want to learn transferable database skills.
- What should I learn to become a web developer, and in what order?Learn the web platform first (HTML, CSS, JavaScript, how HTTP works), then one frontend framework, then a backend with a database, and build a real project at each stage. If you already know WordPress, you are not starting over: your HTML, CSS and PHP experience transfers.
Work with me
Stuck on something specific?
Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.
- 1:1 Mentorship
- Fresh Graduate Mentorship
- Career Guidance
Brand deals, promos and partnerships: tauseeffayyaz@gmail.com