r/Backend 1h ago

41% of APIs drift within 30 days!

Upvotes

Let's say you use a 3rd party api that shipped a breaking change 3 months prior to roll out. Your team fixed the documented change. But then something broke downstream silently due to this breaking change. So how do you catch it in such situations on top of monitoring and alerting ? Has anyone tried automating any part of this?


r/Backend 8m ago

Springboot vs Python for back-end

Upvotes

3rd sem, tier-3 college, no placement cell — need to pick a backend stack I can actually get hired with on my own.

Spring Boot postings mostly ask 2-3 YOE even for freshers. FastAPI/Django get called “less in-demand” vs Java/Node. AI/ML is the hyped direction but barely hires freshers either. Not doing MERN.

Anyone working backend jobs — is the Spring Boot experience wall as rigid as it looks, or does it flex with strong projects? And is Python backend genuinely harder to break into right now, or just perception


r/Backend 21m ago

Im a self-taught dev & no jobs experience. Your guide is really meaningful to me

Thumbnail
Upvotes

r/Backend 1h ago

Is this authentication code good or bad or worse !!!

Upvotes

from app.domain.entities import user

import hashlib

import secrets

from datetime import datetime, timedelta, timezone

from uuid import UUID

import jwt

from passlib.context import CryptContext

import re

from app.infrastructure.settings import settings

from app.infrastructure.postgres.user_postgres import PostgresUserRepository

from app.infrastructure.postgres.refresh_token import PostgresRefreshTokenRepository

_pwd_context = CryptContext(schemes=["argon2"], deprecated="auto")

class AuthService:

def __init__(

self,

user_repo: PostgresUserRepository,

refresh_repo: PostgresRefreshTokenRepository,

):

self._user_repo = user_repo

self._refresh_repo = refresh_repo

# Password

def hash_password(self, plain: str) -> str:

return _pwd_context.hash(plain)

def verify_password(self, plain:str, hashed:str) -> bool:

return _pwd_context.verify(plain, hashed)

# Access token

def create_access_token(self, user_id:UUID, role:str) -> str:

expire = datetime.now(timezone.utc) + timedelta(

minutes=settings.access_token_expire_minute

)

payload = {

"sub": str(user_id),

"role":role,

"exp":expire

}

return jwt.encode(payload, settings.jwt_secret_key, algorithm=settings.jwt_algorithm)

def decode_access_token(self, token:str) -> UUID:

payload = jwt.decode(

token,

settings.jwt_secret_key,

algorithms=[settings.jwt_algorithm],

)

return UUID(payload["sub"])

# Refresh Token

def create_refresh_token(self) -> str:

return secrets.token_urlsafe(32)

def _hash_token(self, raw:str) -> str:

return hashlib.sha256(raw.encode()).hexdigest()

async def register(self, username: str, email: str, password: str, confirm_password: str, contact: int) -> None:

if password != confirm_password:

raise ValueError("Passwords do not match")

existing = await self._user_repo.get_by_email(email)

if existing:

raise ValueError("Email already registered")

hashed = self.hash_password(password)

return await self._user_repo.create(username, email, hashed, contact)

async def login(self, identifier:str, password:str)-> None:

pattern = r"^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$"

if re.fullmatch(pattern, identifier):

user = await self._user_repo.get_by_email(identifier)

else:

user = await self._user_repo.get_by_username(identifier)

if not user or not self.verify_password(password, user.password_hash):

raise ValueError("Invalid email/username or password")

if not user.is_active:

raise ValueError("Account is Deactivated")

access_token = self.create_access_token(user.id, user.role)

raw_refresh = self.create_refresh_token()

expires_at = datetime.now(timezone.utc) + timedelta(days=settings.refresh_token_expire_day)

await self._refresh_repo.create(user.id, self._hash_token(raw_refresh), expires_at)

return access_token, raw_refresh

async def refresh(self, raw_refresh_token:str) -> str:

token_hash = self._hash_token(raw_refresh_token)

user_id = await self._refresh_repo.get_valid(token_hash)

if not user_id:

raise ValueError("Invalid or epired refresh token")

return self.create_access_token(user_id)

user = await self._user_repo.get_by_id(user_id)

if not user or not user.is_active:

raise ValueError("User not found or deactivated")

return self.create_access_token(user_id, user.role)

async def logout(self, raw_refresh_token:str) -> None:

token_hash = self._hash_token(raw_refresh_token)

await self._refresh_repo.revoke(token_hash)


r/Backend 6h ago

What IT/CS career would you choose in 2026 if your goal was to stay valuable for the next 7–10 years despite AI?

Thumbnail
0 Upvotes

r/Backend 20h ago

Spring Boot vs FastAPI/Django for a fresher with no placement support — which is actually more viable?

8 Upvotes

Confused between Spring Boot and Python (FastAPI/Django) for backend — 3rd sem, tier-3 college, no on-campus placements
I’m in my 3rd semester at a tier-3 college with no on-campus placement support, so whatever I learn has to get me hired on my own merit. Trying to pick a backend stack and getting mixed signals everywhere.
Some things I keep hearing:
Spring Boot roles expect 2-3 years of experience, hard to break in as a fresher

FastAPI/Django are seen as “slower” and a lot of companies/startups don’t hire for them the way they do for Java or Node

Everything is shifting toward AI/ML, so maybe Python is the safer long-term bet — except AI/ML roles barely hire freshers either, most want research experience or a portfolio of real projects

I don’t want to do MERN — just not interested in it

So I feel stuck from every angle: Spring Boot wants experience I don’t have, Python backend roles seem fewer for freshers, and AI/ML — the “future” everyone points to — doesn’t want freshers either.
For people who’ve actually landed their first job from a non-target/tier-3 college — what actually mattered more, the framework/stack you picked or something else entirely (projects, DSA, internships, networking)? Trying to make a decision I won’t regret in a year.


r/Backend 19h ago

Learning PHP

3 Upvotes

Im entering my second year of college and I need to have decent knowledge of how PHP works and its syntax for connecting with MYSQL. What free or cheap tools am I able to use to help me learn it within ~5 months? I can allow 2hrs a day practice


r/Backend 21h ago

Is language choice hindering my progress and future choice?

4 Upvotes

Hello y'all,

I know I shouldn't have shiny object syndrome, but every language/stack just feels better than the other... I just can't figure it out at the state i'm in...

I am an aspiring self-taught developer and I recently finished CS50x and made the Final Project on a personal project related to my degree that replaces some kind of paperwork in a digital manner for industrial sites like oil and gas etc. Nothing grand just the web MVP but still missing mobile app and many stuff.

The reason I am writing this is that a few years back before going all in like I did now, I did some Java, then realized my fundamentals are non-existent so I took CS50x (best decision so far) and skimmed through CS50P so I know my fair bit of Python right now.

The reason I am writing in Backend subreddit is because it feels the most interesting for me so far besides desktop apps. I am naturally curious and just want to be able to create any software I want to create but I REALLY also want to make money with it if I acquire decent skills lol.

  • So I have been looking at Automate the Boring stuff with Python to learn automation and sell that as a freelance service.
  • I also thought of learning full backend to try to get a job or freelance etc
  • And then there's my big project idea I mentioned in the top which feels like it will require a looooot of time to create with where I am right now in my journey.

So my questions are:

  1. If you were in my shoes, creating an industrial software, which stack would you choose? That is, considering my knowledge extends to only what is covered in CS50x.
  2. If you wanted to make money now in 2026-2027 but had little knowledge, what skills/tech would you learn to help you reach there?
  3. What's the most fun career that would allow you to engineer any piece of software you want?
  4. (This one is specific to Backend) 2 resoureces that stand out to me rn is either I learn FastAPI for AI integration in future, CS50W to learn web properly, or what looks to be my favorite so far "Backend from first principles" playlist on youtube.

I know with AI things are only getting cheaper and easier to create software but still, I feel like fundamentals should always be learned to supervise the AI's and architect the pieces of software that it builds.


r/Backend 1d ago

Looking for backend project ideas and need help in Which tool to use Drogon(Cpp) or node js

6 Upvotes

I am confused when I think about project ideas as when I think of small backend projects I think these won't we good for resume or is just too easy than anyone can build then but when I see complicated projects I think that I don't have enough skill needed to do them.

Regarding which tool to use I have used both node js and drogon I found that node js I very easy to work with and can work fast with help of this but with drogon even if it takes a more time I see how a request is getting processed how a request is working where is a request causing error and learn a lot

So anyone if they can give me some guidance I would be very grateful


r/Backend 23h ago

LarkBatis: A build-time MyBatis compiled to plain Java - Spring ready

Thumbnail larkbatis.github.io
2 Upvotes

r/Backend 12h ago

A credits_remaining column is a race condition once jobs become asynchronous

0 Upvotes

I started with the obvious model for usage credits:

balance = user.credits_remaining

if balance < cost:
    raise InsufficientCredits()

user.credits_remaining = balance - cost
await session.commit()

It looks fine until expensive work becomes asynchronous.

The simplest failure case:

  • user has 10 credits
  • job A costs 7
  • job B costs 7
  • both requests arrive at nearly the same time
  • both transactions read balance = 10
  • both conclude the user can afford the job
  • both proceed

You just delivered 14 credits of work for 10.

The interesting part is that there are actually two different problems here.

1. Two different jobs competing for the same balance

An idempotency constraint doesn't help, because these are legitimately different jobs.

The balance check and deduction need to become one concurrency-safe operation.

One approach in Postgres is to lock the owning row:

SELECT ... FOR UPDATE

before checking the balance and inserting the spend.

Then the second transaction waits, sees the new balance, and fails the affordability check.

Another perfectly reasonable design is a conditional atomic update:

UPDATE users
SET credits_remaining = credits_remaining - :cost
WHERE id = :id
  AND credits_remaining >= :cost
RETURNING credits_remaining;

No returned row means the spend was rejected.

2. The same job being delivered twice

That's a different failure mode.

Workers retry.
Brokers redeliver messages.
HTTP requests get repeated.

For that, I use an append-only credit ledger and make:

UNIQUE(job_id, kind)

an invariant.

So the same logical deduction cannot be inserted twice.

The distinction ended up being useful:

  • concurrency control protects against different jobs spending the same balance
  • idempotency protects against the same job charging twice

They are related, but they are not the same guarantee.

I also stopped treating the current balance as the source of truth.

Instead, each movement is a row:

grant   +100
deduct    -7
refund    +7

Balance is derived from the ledger.

That gives you a few things almost for free:

  • refunds are new facts instead of edits
  • failed jobs can be reconciled
  • retries are traceable
  • support can answer “why is this balance 37?”
  • you retain an audit trail

The downside is obvious: more machinery than one integer column.

For a simple synchronous app I probably wouldn't bother.

For metered AI / background-job workloads, I've found it worth it.

I also keep a regression test that starts with 10 credits and runs two 7-credit spends concurrently in separate DB transactions using different job IDs.

Exactly one must succeed and the final balance must be 3.

Curious how others handle the two pieces in production:

  • For concurrent different jobs, do you use SELECT ... FOR UPDATE, a conditional UPDATE, SERIALIZABLE, or something else?
  • For accounting, do you keep a mutable balance plus audit history, or make the ledger itself the source of truth?

r/Backend 1d ago

Python for backend

34 Upvotes

Is python a good choice if I want to get a job as backend dev?
I already learn how to create some api projects with Django and FastAPI, Celery, Redis and SQL, but I always keep hearing that python is only good for DS/ML stuff and it would be better to pick other languages or stacks for backend.
So I would appreciate any answer how the situation really looks in the real world.


r/Backend 1d ago

3rd sem CS student, basic Python, planning backend → DevOps | Sanity check on my 5-year plan?

1 Upvotes

Where I am right now->

3rd semester CS student at a university in EU. Did Java and C for university exams, passed them, but I'd call myself beginner level in both. I'm now learning Python on my own. No real projects, no professional experience, no DSA foundation.

So yeah, genuine beginner. Not being modest, that's where I am.

The plan:

I'm thinking backend first. Python, SQL, Linux as the foundation, then transition into DevOps/platform engineering after 2–3 years of actual backend work. The idea is to get work experience in Europe after graduating (I'm already here, might as well use it), and then eventually transition to remote international work if that's realistic.

I've deliberately avoided frontend and full-stack. The reasoning: I don't want to compete in the most crowded segment of the market. I'd rather go deep on backend + infrastructure where the supply of engineers is thinner, especially for remote roles.

What I'm currently using:

Considering boot dev (paid, ~$29/month) as my primary resource. It's backend-only, structured linearly, and covers Python → DSA → Linux → Git → SQL → Docker → K8s → CI/CD in one subscription. The alternative I'm weighing is just using free resources (CS50P, Exercism, OSTEP, etc.) but honestly, free resources give me decision fatigue and I end up tab hopping instead of learning.

What I wanna know:

  1. Is boot dev worth the subscription for someone at my level, or is there something better? I've seen mixed opinions. Some people swear by it, others say just do CS50 + Exercism + free MIT courses. For context: I need structure. I don't do well with "here's 50 free resources, figure it out." If boot dev isn't it, what paid resource actually is?
  2. I've deliberately avoided frontend and full-stack, is that going to bite me?
  3. What should I actually be studying right now at the beginner stage? Not "what's the full roadmap" just the next 6 months. I'm mass-consuming Python basics but I don't know if I should also be touching Linux/Git/SQL in parallel or if that fragments my focus. What order did you do it in, and what would you change?

Thanks. Happy to give more details if it helps.


r/Backend 2d ago

What is your go-to blogs or YouTuber for learning backend concepts

51 Upvotes

I follow hussein and some system desi smh (hld+lld) from hello interview. However I want to know more YouTubers or blogs where I can learn different concept.

Thank you.

Edit 1: also I am asking this from perspective of sde 1 . Eventually as i grow thing would be more known but having gradual ascend is good I beleive.


r/Backend 1d ago

I'm a js developer and want to take a different path

9 Upvotes

Hello, I'm a nextjs(react) fullstack developer, currently working in a company as a single developer on this position.

\---

In the near future I want to transfer to a big company / team to work on big, enterprise type projects and as we all know most of the worlds big softwares aren't made with ts/js, so i want to learn a mew programming language and follow a new path.

\---

I'm trying to make a choice between: Java, Python or going into mobile development with React Native.

\-

I was also thinking about RUST, but the market doesn't seem that big for it.

\-

I'm not that good with math and I also know that python is often used in companies for data analysis.

\---

I would appreciate any advice from you guys on helping me choose my next path.

Thank you!


r/Backend 1d ago

HELP!! I cant seem to wrap my head around Multithreading in Depth for interviews or Designing Systems, How to learn this conceptually.

6 Upvotes

Title.


r/Backend 1d ago

Backend Project ideas

6 Upvotes

i want some backend project ideas. i know mern stack. was thinking of building a crm system but people said its useless in 2026


r/Backend 1d ago

Overwhelmed in which technologies and tools to use as a beginner.

Thumbnail
1 Upvotes

r/Backend 2d ago

Our token bill was mostly the same failed request running twice

18 Upvotes

We have a JSON mode assistant that looked reasonably priced until I split the cost by attempt instead of by request. Unfortunately, I found that a single missing required field triggers a full retry, so the model rereads the entire system prompt, duplicated retrieval chunks and the whole input before regenerating every field. An uncached timestamp near the top also breaks prompt caching. The first attempt often contains 99% of the right answer but we throw it away and buy another one because a nullable field didn’t arrive. 

We are testing schema repair, stable prompt prefixes, idempotency keys and token attribution by attempt. I still don’t like trusting partial JSON but full regeneration for one absent field feels absurd.

How are you handling structured output failures without turning a tiny validation error into two full generations?


r/Backend 2d ago

Switching from Guidewire to Backend — how do I handle the tech-stack gap?

Thumbnail
1 Upvotes

r/Backend 3d ago

Do I need frontend knowledge for backend development?

18 Upvotes

I've been away from programming for a while due to some psychiatric reasons. My frontend knowledge is limited to just CSS and HTML, and I'd previously worked with .NET MAUI and Blazor. I don't enjoy frontend at all it's not an area I like I'm much more drawn to backend and API work. I wanted to ask what level of frontend knowledge would be enough to get by, given that I focus on backend.


r/Backend 2d ago

Need Serious help in BACKEND DEV and DevOps techs

Thumbnail
0 Upvotes

r/Backend 2d ago

Is everyone on here building apps that somehow require zero backend state, no token budgeting, and zero API integrations, or am I the only one stuck in dependency hell?

0 Upvotes

r/Backend 3d ago

Best way to chunk and structure data for RAG/embeddings?

2 Upvotes

Title: Best way to chunk and structure data for RAG/embeddings?

I'm building a knowledge base for RAG and I'm looking for practical advice from people who have done this in real projects.

How do you usually handle:

  • Chunking: fixed size, semantic, sections/headings, parent-child, etc.?
  • Metadata: what fields are actually useful for filtering/retrieval?
  • Hybrid search: do you combine semantic search with BM25/keyword search?
  • Reranking: do you retrieve from both and rerank the combined results?
  • Updating knowledge: how do you replace/version old information?
  • Scaling: how do you structure things so adding new types of information later is easy?

I'm particularly interested in systems where the knowledge base keeps growing over time.

What approach worked best for you, and what would you do differently if you were starting again?


r/Backend 3d ago

Final-year CS student starting from scratch in backend. What core skills & projects make an entry-level candidate hireable?

26 Upvotes

Hey everyone,

​I'm in my final year of computer science and aiming to break into backend engineering. I haven't built any substantial projects yet, and I want to spend the next few months building a solid foundation instead of following generic clone tutorials.

​For those working in backend roles:

​What core backend concepts (databases, concurrency, API design, caching, system design basics) should I prioritize first?

​What kind of project architecture or problem-solving shows real competence on a junior resume?

​Which language/ecosystem would you recommend investing in right now for someone starting out?

​Any guidance or honest roadmaps would be greatly appreciated!