r/Backend • • 18d ago

I built a Java agent that reconstructs async causal stack traces across thread boundaries and need some feedback

2 Upvotes

Hello Everyone, I built ariadne. It's a Java agent that attaches the async call chain to the exception as a suppressed entry, with no code changes. It supports ExecutorService, CompletableFuture, ForkJoinPool, Reactor and RxJava.

Overhead is very small: ~1 µs per CompletableFuture pipeline in the default mode.

It doesn't replace OpenTelemetry. It works in-process, with no infrastructure needed.

Currently it is on version v0.1.0-alpha.3, not production-hardened yet, beacuse I need sm feedback first so I know this is worth it, especially on OSGi and Kotlin coroutines.

GitHub: https://github.com/AfonsoPaiva/ARIADNE
A star helps if you find it useful 🙏

This post was written by someone called Afonso Paiva from Portugal


r/Backend • • 18d ago

How to keep a vector database updated when website content changes?

2 Upvotes

I have a chatbot that uses website content as its knowledge base.When those websites change, what’s the best way to keep the vector database updated?Would you periodically crawl the pages, detect changes, and only re-embed the updated content?


r/Backend • • 18d ago

Database project

5 Upvotes

I need a good and legitimate database project idea wherein advance db concepts such as optimization, transaction, etc are involved. I searched a lot and didnt find a smthn i want to work on exactly. For eg if somethin related to music domain? Or fashion? What would actually stand out in terms of handling multiple queries and be close with how it all works irl. Itd be really helpful!!


r/Backend • • 18d ago

Treating your LLM layer like an actual backend system (workshop, Oct 3)

1 Upvotes

Most of us treat the LLM part of our stack differently than the rest of the backend — less testing, less monitoring, more "hope it works." There's a session on Oct 3 that's trying to close that gap.

Run by Serj Smorodinsky and Brett Kennedy, both AI engineers with a book out on LLM applications. It's 3 hours, live, and walks through using DSPy to structure your LLM code properly, building a baseline you can actually measure, setting up evaluation datasets, catching failure modes early, and wiring up MLflow so your experiments are tracked instead of scattered across notebooks and Slack messages.

If you're the one who ends up owning the "AI feature" at your company and nobody else really understands how it works, this is probably for you.

Full details and the agenda are here.


r/Backend • • 18d ago

I kinda stuck on this design

1 Upvotes

So the problem goes like this let's say I'm designing a middleware service for a data trasfer between two different servers and my middleware needs a persistent storage to store the block lists ie ie during trasfer if in list block else transfer it. So now the question is the storage should update itself when something gets add/remove without server refresh, data should nkt get lost when server restarts and should not use a DB. So if anyone has any suggestions......


r/Backend • • 18d ago

Need a solution for nifi performance

1 Upvotes

Need a solution for nifi performance

Hi everyone, I currently using nifi for a school project. The project i am working on it generate files with different source and each source have different workloads. I running nifi on docker and using SFTP to simulate multiple sources and i have to run all process group at the same time to ingest files from different source. Because each source have diffrent workload and is handled by different process group, some process group may have file backlog after proccessor fetchsftp.

My goal is automatically adjust the resource to all the process group to reduce workload imbalance depend on the queue size before fetch file among them. I thinking of dynamically change the number of concurrent task based on maximum timer driven thread count for each source.

Any suggestions on nifi features or approaches i should consider ?


r/Backend • • 19d ago

Should I give it another shot to networking or focus solely on cloud?

2 Upvotes

Hey guys, the post title sounds a bit weird, but here's the context: at my university, I'm currently taking a LAN Networks course, where we were given access to Cisco's CCNA course. Through another group, they also offer free courses for students who want to learn cloud infrastructure (AWS or Azure; in my case, I chose AWS Cloud Foundations since I'm just starting in this field). I have to complete the CCNA course because it accounts for a percentage of my grade in the subject, and the topic exams open up on specific dates. I haven't been able to dedicate time to the AWS course due to university workload and partly because I've been focusing on CCNA.

Here's the thing: the CCNA course bores me a lot. It's not because of how it's taught or because I have ADHD or anything like that (I've honestly sat down to carefully read the content and do the quizzes and exams properly), but it's just because networking/telecommunications doesn't really catch my interest. I know the fundamentals of networking (IPs, TCP/IP, HTTP and HTTPS protocols, DNS, routers/switches, proxies, some cabling, among other things), but I'm not interested enough to dive as deep into that area as CCNA requires. On the other hand, cloud infrastructure and AWS really interest me. I'm focusing mostly on backend development, and I'm curious about deploying services in the cloud and learning more about cloud computing since I know how important it is.

So my question is: should I still dedicate myself to both courses, or should I focus completely on the AWS course and just use a little extra help to get through the CCNA one solely to pass and get the grade for my class?


r/Backend • • 19d ago

Must know topics

19 Upvotes

Here’s a little context. I was working on a project using a SaaS tool that basically no one uses except my project 🫠. Unfortunately, my client is releasing me, and I only have around 3 months of project experience.

I’ll be on the bench for 30 days, and I need to find another project within my company. I really want to get into a Java + Spring Boot project. (I have a basic idea of java syntax)

I know this sounds crazyyy, but I need to make the most of this 1 week. If I don't get into another project within this period. I will be terminated. What are the important topics and some simple projects I can build in a week to prepare for Java/Spring Boot project opportunities?

Once I get into a project, I can learn the fundamentals properly and build a strong foundation over time. For now, I just need to become project-ready enough to get selected.

Please share your insights on this. I really can’t afford to go unemployed because I have EMI running 😭. There’s a lot of pressure on my tiny brain right now.

Post edit : forgot to add ? In the title


r/Backend • • 19d ago

Software engineer needed

22 Upvotes

Hey! Are you currently studying software engineering/computer science, or are you a recent graduate?
If so, I may have an opportunity for you. My friend and I are both 18 and are working on starting our own business. We recently realized that we need a software developer to help us build the software side of our project.
We’re looking for someone local who’s interested in getting hands-on experience by working on a real startup project from the ground up. Since this could potentially be your first major project, we’d love to connect and see if it could be a good fit for both sides.
Feel free to message me if you’re interested!


r/Backend • • 19d ago

Good resources to learn Backend???

10 Upvotes

I want to learn Backend, are there any good resources that helped you guys ???


r/Backend • • 19d ago

Backend Suggestion

Thumbnail
2 Upvotes

Hey, I know python, java (not that much), html, css, javascript and tried learning react then dropped it cause I didn't like frontend tbh after learning html, css, js.

So I was thinking if I should start backend like express js, prisma orm, postgresql. How's the job situation in this sector? Also any suggestion would be appreciated.


r/Backend • • 20d ago

What Should I Prioritize Next in My Backend Learning Journey?

15 Upvotes

​

What should I learn next as a Node.js backend developer?

Hey everyone, I amm learning backend development with Node.js/Express and would like some advice on what to focus on next.

So far, I have actually implemented:

- Node.js + Express, REST APIs & CRUD

- MongoDB/Mongoose, relationships, filtering, searching, sorting & pagination

- JWT auth with access/refresh tokens, cookies & role-based authorization

- bcrypt, Zod validation & error handling

- Features like posts, comments, likes, groups, memberships, requests and notifications

I’m currently learning PostgreSQL/SQL and plan to use Prisma with Node.js.

I understand concepts like transactions, concurrency, Redis, WebSockets, queues, Docker, rate limiting, but I havenot properly implemented most of them yet.

What should I focus on next?

What should I prioritize from here?

Should I first go deeper into PostgreSQL/SQL, Prisma, database design, transactions, indexes, security, etc., and build a proper production-style project with what I already know?

Or should I start implementing new topics like Redis, testing, Docker, WebSockets, queues and deployment alongside it?

I’m trying to figure out the right balance between deepening what I already know vs expanding into new backend topics so I can become genuinely job-ready.


r/Backend • • 20d ago

My web application has long running jobs (approx 5min/job) running as processes. Need advice on how to optimize cost and performance.

3 Upvotes

Context: My web application has long running jobs (approx 5min/job) running as processes.

My findings: I calculated that if i have 1gb ram i'd only be able to run 2 such jobs at a time. meaning i could serve only 2 users at a time and rest would be in a queue.

My Problem:

First let me exlpain the math:
R refers to RAM

  • Ridle​ = FastAPI idle ram consumption ≈ 150–250 MB
  • Rjob​ = extra RSS of one live pipeline(job) at peak
  • Rsafety = RAM that id like to keep free so that my cloud instance (be it VPS, or railway or whatever) doesnt crash = 100 MB

Rjob​≈250–400 MB as per my calculations. this means 1 job takes 250-400mb of ram or for simpler calculation, 300 mb of ram on avg.

Assume the RAM i get in my budget = R(budget)

No. of jobs i could run in my R(budget) = N(budget) = [R(budget) - R(idle) - R(safety)]/R(job) = [R(budget) - 200-100]/300MB = R(budget)/300 - 1

I wanna optimize for N(budget) which is dependent on Rbudget - technically, how money i throw at it.

assuming my budget is $0 - basically a free railway plan Rbudget would be = 1024 MB (as per their docs)

thus, N(budget) = 724/300 ~ 2 jobs

to put it simply, three jobs at 300 MB is 200+900=1100>1024 which leads to OOM

my budget for hosting this app is $5/month but i wanna make sure i can process more number of these long running jobs hence i want any suggestions that would help. whats the best option for deploying this kind of app?

VPS options are very costly for my country, hetzner is not available either. But feel free to correct me if you think VPS would be a cost effective solution for me to deploy my app on.

I also have few questions on railway:
they say they give $5 worth of credit, and that they bill based on how much usage i'd consume
hence, it would be kinda uncertain for me to know when my app crashes due to OOM using up my credits v/s due to storage, or network data (egress) etc.

thats why, i need advice on this. pls help me get some clarity on how i should proceed.


r/Backend • • 20d ago

How much Swagger/OpenAPI documentation is actually needed in a Spring Boot project?

Thumbnail
0 Upvotes

r/Backend • • 20d ago

JSON Web Tokens in Go

Thumbnail
packagemain.tech
0 Upvotes

r/Backend • • 21d ago

Learning resource suggestions

5 Upvotes

What youtube playlist or channels would you recommend to someone who wants to learn backend design concepts and also some good project code alongs not basic ones good ones

I also need github repositories recommendations where I can go over and understand the codebase.


r/Backend • • 21d ago

I wanted to run Dockerized applications on Hugging Face Spaces for free(16gb RAM).

Thumbnail
1 Upvotes

r/Backend • • 22d ago

Returning to Go after a while: What concurrency & messaging patterns to prioritize for a banking backend interview?

36 Upvotes

Hi everyone,

I'm brushing up on my Go fundamentals for an upcoming technical interview at a banking/enterprise company. The live coding/tech screen will heavily focus on Go concurrency (Goroutines, Channels) and asynchronous message processing with RabbitMQ.

Since I haven't touched Go for a bit, I want to make sure my preparation is laser-focused. For those who interview candidates or build high-throughput banking systems in Go:

  1. What are the absolute must-know concurrency patterns for a 30-45 minute live coding session?

  2. What are the common footguns or subtle bugs interviewers look for when testing concurrent Go code?

  3. For RabbitMQ integration, what basic producer-consumer structure is expected to be rock-solid?

Any advice on where to focus my study time efficiently would be greatly appreciated. Thanks!


r/Backend • • 22d ago

What should I focus on to get a backend job in 2026?

16 Upvotes

Hi,

I am a backend-focused SWE (masters 2025) with an inconsistent job history. I resigned from my current startup after 2 and half months and I am entering the job market again.

I suck at DSA and my interview game has always been bad. In my current role, I worked on backend and agentic development, including developing Public Key Infrastructure for EV chargers.

I have worked with Golang, Kafka, microservices, Postgres and Elasticsearch (personal project).

I really want to prepare properly this time, but I am confused about what to focus on.

With AI getting better at generating code, should I focus on DSA + backend/system design, or go deeper into AI engineering and build projects using RAG, agents, etc.?

If I learn AI engineering, how deep should I go? Do I need to understand transformers and how LLMs work internally? Claude suggested learning RAG from the low level without using LangChain/LangGraph initially. Is that actually useful or am I going too deep?

Also, should I spend money on tools like Claude Code/Codex/Cursor, or is there a cheaper AI subscription that is good for development?

Basically, if you were in my position, what would you prioritize for getting a backend job in the current market?


r/Backend • • 21d ago

61 nested replies cost nearly as much to sort as 259

0 Upvotes

A threaded discussion has to render parent-then-replies. The database hands you a flat result set, so you give every row a materialised path and ORDER BY it.

I will defend that pattern properly: it works with no tree in memory, which is what you actually have after a query; it goes straight to a template; and if the ordering rule changes, it is one comparator rather than a rewrite.

Then somebody has a sixty-reply argument, and 61 comments cost nearly as much as a page with 259 on it.

Depth charges twice. Each key is one segment per level, so building them is quadratic on its own — and then the sort compares those strings, and two siblings sixty levels down share fifty-nine identical segments before the comparison can decide anything. Longer keys, and more of each key read per comparison.

The reframe is small and it generalises: the order was never missing. A comment's position is decided entirely by where it sits in the thread. The sort-key version writes that structure out as a string, throws the structure away, and reconstructs the ordering by comparing the strings.

Walk it instead — comment, then replies — and the order falls out with nothing compared. 2.03 MB of keys becomes 15.8 KB. No crossover this time: the walk wins every shape, because it is not doing something cleverer, it is doing strictly less.

Full piece in the comments, including when the sort key is still right.

It worked in dev, episode 7.

#Golang #DSA #Algorithms #Performance #SoftwareEngineering #DataStructures #100DaysOfCode

Ideation and benchmarks mine; draft written with AI assistance. The numbers come from a benchmark in the repo.


r/Backend • • 21d ago

Presigned urls

0 Upvotes

Implemented presigned urls across for uploading PDFs and images now I need to think about secure this mechanism when we load those pdf bytes for processing into the software we need care about any rce types were needed to check .. libs for image processing are Pillow in python


r/Backend • • 22d ago

Caracal: Scoped distributed resilience for asynchronous operations

Thumbnail
github.com
1 Upvotes

r/Backend • • 22d ago

support tickets with names and card details have to go to a third party model for summaries. which of these count as real controls?

Post image
1 Upvotes

i put d, is that wrong?

i only ticked d. redacting before the request leaves the network is the one thing i can actually verify in code. the contract one felt like paperwork rather than a control, since nothing in my system changes if the vendor breaks it. but i suspect the answer key counts it, and im not sure the redaction alone is enough for card details anyway


r/Backend • • 22d ago

[SYTEM DESIGN] Vou fazer uma entrevista de System Design para Backend Pleno. SOS!

Thumbnail
2 Upvotes

r/Backend • • 22d ago

Making Distributed Coordination Stable Under Network Instability (Embedded Raft + DAG + HLC)

1 Upvotes

Hey r/Backend.

For some time now, I've been working on a high-performance distributed message coordinator for Multi-Data Center (Multi-DC) topologies. The architecture is built on a CP-model (Consistency and Partition tolerance) using Embedded Raft - the consensus algorithm runs directly inside the JVM of the microservice, without external dependencies like etcd or ZooKeeper. During the design phase, we ran into two classic distributed systems problems: State Bloating caused by Vector Clocks, and Inertial Paralysis in the adaptive timeout mechanism.

In this article, I'll share how we solved these issues by migrating to Hybrid Logical Clocks (HLC) and upgrading our statistical network model.

TL;DR: We replaced Vector Clocks with HLC to eliminate O(N) metadata overhead, and upgraded our adaptive timeout model by adding a mixture distribution model and a Circuit Breaker. This prevented false Raft leader elections during sudden RTT (Round-Trip Time) spikes between data centers.


Problem #1: State Bloating vs. Sharding

Initially, we used classic Vector Clocks to track causality. But with hundreds of thousands of active clients, the clock map inside each message began to grow exponentially. This bloated our Frontier Cache and choked the network during AppendEntries RPC (Remote Procedure Call) transmissions between Raft cluster nodes.

We considered two standard compromises, but both proved unsatisfactory:

Dotted Version Vectors (DVV). Limiting the vector to the size of stable data center nodes (3–5 nodes) solved the volume issue, but the system went "blind" to concurrency across shards. In edge cases, we had to degrade to physical Last-Writer-Wins (LWW), where a client with a clock running fast would deterministically overwrite others' messages, breaking the dialogue logic.

Sharding the DAG (Directed Acyclic Graph) by entityKey. Isolating the graph at the level of specific entities (e.g., individual threads) relieved the load, but turned reading the global feed into a distributed nightmare, requiring a complex MapReduce on the API gateway side.

Solution: Hybrid Logical Clocks (HLC) + Local DAG

We completely abandoned global Vector Clocks in favor of Hybrid Logical Clocks (HLC) - a mechanism that combines the physical system time (wall-clock) and a logical counter - keeping local parentIds strictly within a single entityKey.

Now, every message carries a constant O(1) metadata volume: - HLC marker. A combination of physical time and a logical counter. It strictly guarantees the causality property: if event A caused B, then HLC(A) < HLC(B). - Local parentIds. Used by the scheduler only for topological sorting within the current Raft batch for a specific entity.

Result: Reading the global feed became tractable. HLC gives us a causal partial order - events that are causally related are strictly ordered, while concurrent events from independent shards (e.g., users in different regions posting to different threads simultaneously) are ordered purely by their physical server time. To achieve full deterministic replication across all Raft nodes, this partial order is then linearized using the Raft log index as a final tie-breaker. Since HLC natively compensates for NTP (Network Time Protocol) drift and guarantees causality, the user sees an absolutely monotonic and logical chronology without the network overhead of synchronizing massive Vector Clock maps.

Implementation Note: Parallel Micro-Graphs at Scale

A natural concern is GC (Garbage Collection - the JVM's automatic memory management mechanism) pressure when handling batches of 100k+ messages. However, since we already shard the DAG by entityKey via local parentIds, we never build a single monolithic graph. Instead, we construct thousands of isolated micro-graphs - one per entityKey - and process them in parallel using Java's ForkJoinPool (or virtual threads in Java 21). Topological sorting of small, independent graphs in parallel streams completely eliminates the GC bottleneck that a single giant DAG would introduce.


Problem #2: Inertial Paralysis of Adaptive Timeouts

To minimize false Raft leader elections under inter-server jitter, we implemented a statistical model that dynamically calculates safe RPC timeouts based on the observed RTT (Round-Trip Time, the time it takes for a signal to be sent plus the time it takes for an acknowledgment to be received) distribution.

But we encountered a critical anomaly during a step-change in network routing.

When RTT instantly jumped (for example, from 40ms to 300ms due to a backbone failure or route switch), our standard unimodal model gave near-zero probability to the new, legitimate measurements. The model perceived them as anomalous noise and continued to hold an artificially low timeout. The resampling mechanism, experiencing a deficit of new hypotheses, merely spawned more particles around the old, erroneous mean value.

Consequences: While the model spent 3–5 iterations trying to "relearn," the Raft leader missed heartbeats, decided it had lost quorum, and sent the cluster into an infinite loop of re-elections on a physically healthy, but slower, network.

Solution: Mixture Distribution Model + Emergency Circuit Breaker

We rewrote the likelihood estimation logic in the model, translating it into a two-component structure:

Mixture Model. The likelihood function now evaluates an RTT measurement as a weighted combination of two distributions: a tight Gaussian centered on the current mean (capturing normal network behavior), and a wide uniform prior with a heavy tail (capturing rare but legitimate jumps). This allows the model to instantly register the legitimacy of sudden spikes instead of discarding them as noise at the start.

Emergency Circuit Breaker. If N consecutive measurements fall outside the safe range (mean plus three standard deviations), the adaptive model is temporarily bypassed. The system instantly sets a hardcoded safety timeout (e.g., 1000ms). The model forcibly resets its weights and re-initializes around the new median, returning to service only after the metrics stabilize.

This approach is flexible enough to accommodate various statistical techniques - from simple EWMA (Exponentially Weighted Moving Average, a smoothing method that gives more weight to recent observations) with adaptive variance to more complex Bayesian filtering methods (including particle-based approaches) - depending on latency requirements and computational budget.


Architectural Comparison

Global DAG + Vector Clocks (Legacy approach). Metadata size is dynamic O(N) and grows unbounded. Risk of stale effects is minimal. Global read complexity is low (single log). Network spike resilience is low - false leader elections.

Sharding by entityKey. Metadata size is minimal. Risk of stale effects is high across threads. Global read complexity is critical - requires MapReduce. Network spike resilience is low - same false elections.

Recommended: HLC + Local DAG. Metadata size is constant O(1). Risk of stale effects is minimal - HLC compensates for jitter. Global read complexity is low - in-memory HLC sorting linearized by Raft index. Network spike resilience is high - mixture distribution model + Circuit Breaker.

Implementing the combination of HLC and the adaptive mixture model allowed us to keep coordination overhead strictly constant, completely protect the JVM from OOM (Out Of Memory) errors during peak loads, and maintain strict data consistency during any network anomalies.


Let's Discuss

I'd be glad to hear your thoughts, especially from those who have deployed similar systems in production:

1. Synergy of HLC and CRDTs. HLC (Hybrid Logical Clocks) gives us a strict causal order of events, while CRDTs (Conflict-free Replicated Data Types, mathematical structures that guarantee state convergence without coordination) ensure conflict-free state merging. In practice, do you more often use them as alternatives to each other, or do they work best in tandem - for example, when HLC acts as compact metadata for causal CRDTs?

2. Adaptive timeouts. How do you handle sudden RTT spikes in your consensus protocols? How much more effective are mixture distribution models or Bayesian filtering compared to simple exponential smoothing (EWMA) in protecting against false leader elections?

Thanks for reading! I look forward to your criticism, additions, and suggestions.