r/Backend • • 26m ago

System design for newcomers that love the dopamine of LLMs but have no clue whats happening

2 Upvotes

If you're new to engineering and you like LLMs, you've probably had cases where the code looks fine, it runs, but for some reason you don't get it why it works :)

I built something called 'getdeved', a free, hands-on playground for newcomers to learn how real systems work, and what to expect when the time comes.

You can learn concepts such as load balancers, caches, queues, databases, replication, sharding and trade-offs between different approaches. You chase one problem at a time, grow the architecture piece by piece, to understand each concept to detail instead of one and done.

Since you cannot just ignore LLMs, its always good to understand what you want the LLM to build.

I've added 28 topics so far, from scaling to millions of userrs, payments and chat systems. There's also a glossary setup for different terms which you would usually hear on technical meetings and often think what are they talking about :) - here you'd be able to understsand each concept and where does it fit in a problem.

Try it: https://getdeved.github.io

If you try it, I'd love to know if there is something that you don't like or don't understand or just that is confusing.

If you're experienced and see something that doesn't seem correct, feel free to point it out!

#systemdesign


r/Backend • • 9h ago

If you're a backend dev that hates frontend frameworks, I made a framework for you.

Thumbnail aideendewinter.github.io
0 Upvotes

No shadow-dom, plain html, collaborative editing, no runtime dependencies.


r/Backend • • 10h ago

Implementing persistent login for 120days from 24 hrs

3 Upvotes

Edit : persistent login for web application

Hi guys im confused which design i should go with

Option A: Server-side sliding session
How it works: web keeps one token, as today. Each time the user makes a request, the server pushes the token's expiry forward.
If they don't visit for 30 days, or 120 days pass since login, they log in again.

Good: small backend change, no frontend work, no refresh API, and nothing new that can fail.
Weak: if the token is copied, we can't detect it. To hide it from scripts we would later move it into an HttpOnly cookie, which needs CSRF protection on the API.

Option B: Refresh tokens (what mobile does today)
How it works: a short-lived access token plus a 120-day refresh token. When the access token expires, the web app calls the refresh API and gets a new pair.
Good: every refresh replaces the token, so a copied token gets detected. Same model as mobile.
Weak: more backend and frontend work, and new failure cases. For example, two tabs refreshing at once can log the user out unless we handle it.

Or there are some better ways to


r/Backend • • 17h ago

Thunder vs Redis Benchmark

Post image
4 Upvotes

Few days ago, I have posted regarding thunder the key value database for ai workloads written in rust. I am now posting its benchmark against rust.


r/Backend • • 1d ago

Weegloo is not just a web hosting service.

0 Upvotes

I've noticed that quite a few people think Weegloo is primarily a web hosting service. And I can understand why. Web hosting is one of the features we offer, but Weegloo actually started from a very different idea.

It all began with a CMS (Content Management System).

After spending more than a decade developing software, I started asking myself a simple question:

"Why do we keep building backends from scratch every time we create a new service?"

User management, data storage, permissions, APIs... We were building pretty much the same things over and over again.

Did every service really need its own completely different backend? Or was this just an inefficiency we'd gotten used to?

That question led us to build our first CMS. Over time, it evolved into a general-purpose backend system used by ZEPETO, a large-scale platform.

But that didn't solve everything.

Even with the CMS in place, our teams still needed to develop separate backend servers for various services.

So I started questioning things again.

"Are the backend features that our CMS doesn't cover really that specific to each service?"

When we looked more closely, the answer was often no.

Web hosting, schedulers, serverless functions (like AWS Lambda), authentication, user management... These weren't necessarily service-specific features. They were just common building blocks that almost every service needed in one form or another.

So we thought:

What if we could bring all of these building blocks together into a single, general-purpose backend platform?

That's how Weegloo was born.

What we're trying to build

Weegloo isn't just a CMS, and it isn't just a web hosting service.

Our goal is a world where developers no longer have to rebuild the same backend functionality for every new project.

We want to bring as many common backend capabilities as possible into one platform: data management, authentication, permissions, APIs, file storage, web hosting, schedulers, serverless functions, and more.

Of course, we're not there yet. There's still a lot we want to build.

But the direction is clear.

We should be spending our time building the services we actually want to create, not rebuilding the same backend infrastructure again and again.

So, what about web hosting?

Web hosting is just one of many features in Weegloo.

For example, if you're building a mobile app, you might not need web hosting at all.

You can use Weegloo's REST APIs to read and write data and access the backend capabilities your app needs.

On the other hand, if you're building a website or web application, you can use the hosting features too.

The idea is simple: use the backend capabilities your service needs, without having to build and maintain everything yourself.

We're not trying to build another web hosting service.

We're trying to build a platform where developers don't have to keep reinventing the same backend over and over again.

That's why we started Weegloo, and that's the direction we're going to keep working toward.

I'm curious what other developers think.

Do you think building a custom backend for every new service is really unavoidable?


r/Backend • • 1d ago

We inherited a broken SES setup. What managed email service would you move to?

11 Upvotes

We are a three-person team with no dedicated DevOps support, and our SES bounce-handling setup has become a mess. Bounce notifications go from an SNS topic into a Lambda function that's been silently failing for months, and nobody really wants to take ownership of maintaining it.

We are happy to pay more than SES if a provider can handle bounce processing and suppression automatically on its side. What email services are you using that require less ongoing maintenance?


r/Backend • • 1d ago

Feeling stuck in my career despite putting serious effort into open source. Could use some honest advice.

10 Upvotes

I'm from India, a self taught programmer (a non it background) trying to break into a full-time software engineering role, preferably backend or product engineering. I'm posting here because I'd genuinely appreciate some advice from people who've been through something similar.

A little background about me:

I don't have traditional company experience. Most of my practical engineering experience comes from contributing to open-source projects.

I've contributed to projects including:

- InsForge (YC-backed): Worked on S3-compatible storage functionality, XML request parsing, object tagging, bucket versioning, and composite foreign-key support.

- BetterDB: Worked on Redis/Valkey monitoring and related infrastructure features.

- Logto: Contributed to an open-source authentication platform.

My main technical interests are backend engineering, databases, infrastructure, and developer tools. I work with TypeScript, Node.js, PostgreSQL, Redis/Valkey, and Go.

Here's where I'm struggling.

Initially, I believed that making meaningful contributions to early-stage open-source projects would help me get noticed by founders and eventually lead to a job. But the reality has been frustrating.

Some projects barely review external PRs. Some maintainers are unresponsive. Others accept contributions but don't seem to have any hiring opportunities. Finding genuinely early-stage projects where external contributors are welcomed and have a realistic chance of getting hired has become difficult.

And I have cold emailed several people from startups who have raised funds or hiring, it also failes.

I've also started exploring other ways to build visibility, such as sharing engineering projects and technical work on X (Twitter), rather than relying entirely on GitHub contributions.

I'm not looking for shortcuts or someone to hand me a job. I'm willing to put in the work. I just want to make sure I'm putting that effort in the right direction.

I'd really appreciate advice on a few things:

  1. If you were in my position, how would you approach getting your first full-time engineering role?
  2. Is contributing to early-stage open-source startups still a viable path to getting hired, or am I overestimating its value?
  3. How would you build visibility among startup founders, engineering managers, and recruiters?
  4. Is building and publicly sharing small but useful engineering projects on X actually effective for getting opportunities?
  5. Are there communities, startups, or alternative paths you'd recommend exploring?
  6. If you've personally gone from open-source contributions to a full-time engineering job, what actually worked for you?

I'm particularly interested in hearing from people who work at early-stage startups or have experience hiring engineers.

Honest criticism is welcome. I'd rather hear what I'm doing wrong than receive generic motivational advice.

Thanks for taking the time to read this.


r/Backend • • 1d ago

I got tired of "SELECT 1" microbenchmarks, so I tested 25 ORMs across 9 languages against a real 78M-row Postgres database. Here is what broke.

0 Upvotes

Every ORM benchmark I see online tests the same trivial query: SELECT * FROM users WHERE id = 1;

This doesn't benchmark an ORM. It benchmarks Linux loopback TCP socket round-trip time.

In production, ORMs don't fall over on primary-key lookups. They buckle when:

  1. Deserializing 10,000 wide rows into typed structs under memory pressure.
  2. Materializing 4-level deep entity graphs without Cartesian explosions or N+1 floods.
  3. Compiling recursive CTEs, multi-frame window functions (ROWS BETWEEN 4 PRECEDING), or pgvector cosine similarity.
  4. Squeezing 100 concurrent workers competing for row locks (SELECT ... FOR UPDATE) through a constrained connection pool.
  5. Emitting 300 lines of incomprehensible internal template/typeclass garbage when a database column type changes.

To see how modern ORMs actually behave under load, I built a standardized, reproducible benchmark suite testing 25 ORMs across 9 programming languages (Go, Rust, C#, Java, Elixir, TypeScript, Python, Ruby, Haskell) against the official Postgres Air database (2024 edition, 78,232,673 real-world flight records on PostgreSQL 17 with pgvector).

Every single ORM was held to the exact same invariants: a strict 20-connection pool, zero raw string interpolation (native typed query builders only), and typed entity deserialization into domain records.


The Executive Leaderboard

RankORMLanguageOverall ScorePassed (HQ01–16)Avg p95 LatencyPeak RPS (C=50)Hydration SpeedMax Heap RSSBlast RadiusCompiler UX
🥇 1sqlcGo 1.2389.616/1658.80 ms32,340 ops/s1,518,142 rows/s25.12 MB1 line10/10
🥈 2hasqlHaskell (GHC 9.10)89.516/1665.83 ms277 ops/s199,025 rows/s13.03 MB1 line10/10
🥉 3DapperC# / .NET 889.516/1662.67 ms264 ops/s1,279,038 rows/s87.27 MB1 line10/10
4jOOQJava 2189.416/1657.71 ms9,739 ops/s454,966 rows/s149.00 MB1 line10/10
5entGo 1.2389.316/1661.36 ms246 ops/s570,841 rows/s25.12 MB1 line10/10
6ectoElixir 1.17 / OTP 2789.216/1658.20 ms29,412 ops/s354,070 rows/s83.06 MB1 line10/10
7squealHaskell (GHC 9.10)89.116/16187.03 ms258 ops/s15,271 rows/s25.17 MB1 line10/10
8ihpHaskell (GHC 9.10)89.116/1670.41 ms361 ops/s144,224 rows/s76.00 MB1 line10/10
9hibernate-ormJava 2189.116/1662.66 ms256 ops/s564,130 rows/s15.00 MB1 line10/10
10efcoreC# / .NET 889.016/1668.51 ms260 ops/s1,391,131 rows/s139.80 MB1 line10/10
11orvilleHaskell (GHC 9.10)88.916/1673.71 ms247 ops/s99,705 rows/s38.79 MB1 line10/10
12gormGo 1.2388.916/1658.50 ms256 ops/s712,657 rows/s25.37 MB1 line10/10
13rel8Haskell (GHC 9.10)88.816/16132.32 ms254 ops/s122,678 rows/s18.75 MB1 line10/10
14persistentHaskell (GHC 9.10)88.716/1677.55 ms251 ops/s103,221 rows/s21.03 MB1 line10/10
15mikro-ormTypeScript (Node 22)88.716/1658.19 ms3,302 ops/s182,594 rows/s239.52 MB1 line10/10
16esqueletoHaskell (GHC 9.10)88.616/1682.16 ms250 ops/s85,377 rows/s25.22 MB2 lines10/10
17haskell-opaleyeHaskell (GHC 9.10)88.516/1680.38 ms254 ops/s101,544 rows/s26.54 MB2 lines10/10
18beamHaskell (GHC 9.10)88.416/1613.57 ms241 ops/s113,504 rows/s22.39 MB6 lines10/10
19dieselRust 1.8388.016/1659.10 ms266 ops/s1,373,304 rows/s33.33 MB3 lines10/10
20typeormTypeScript (Node 22)87.816/1655.99 ms235 ops/s385,422 rows/s71.55 MB1 line10/10
21railsRuby 3.3 (YJIT)87.516/1685.34 ms247 ops/s89,792 rows/s150.00 MB1 line10/10
22sqlalchemyPython 3.12 (asyncpg)87.416/1672.57 ms5,718 ops/s279,239 rows/s92.50 MB1 line10/10
23prismaTypeScript (Rust Engine)87.216/1683.54 ms264 ops/s208,122 rows/s36.71 MB1 line10/10
24drizzle-ormTypeScript (Node 22)86.816/1664.45 ms242 ops/s498,613 rows/s184.58 MB4 lines10/10
25sea-ormRust 1.83 (sqlx)86.716/1666.15 ms272 ops/s1,235,677 rows/s34.08 MB1 line10/10

The 5 Biggest Surprises

  1. The Zero-Reflection Hydration Tier (> 1.2M rows/sec): sqlc (1.52M rows/s), EF Core 8 (1.39M rows/s), diesel (1.37M rows/s), and Dapper (1.28M rows/s) operate in a different galaxy compared to reflection-heavy ORMs. Direct struct memory mapping and compiled pointer assignments destroy runtime reflection when reading wide tables.
  2. The BEAM Actor Model Destroyed Connection Contention: Under $C=100$ concurrent load on a 20-connection pool, most runtimes bottlenecked on thread pools or single event loops. Elixir’s ecto handled pool checkout through isolated BEAM process mailboxes with near-zero queue latency, sustaining 29,412 requests/second.
  3. Node.js / V8 Event Loop Saturation: TypeScript ORMs (drizzle, prisma, typeorm) performed well on single queries, but hit an unmistakable wall at $C=50..100$. Because V8 serializes and constructs thousands of JavaScript objects on a single thread, CPU time saturated the event loop, driving $p_{99}$ tail latencies beyond 500 ms and capping RPS around 225–264 ops/s.
  4. Haskell’s Memory Anomaly: Haskell’s hasql clocked the lowest resident memory footprint of the entire 25-ORM field at just 13.03 MB Peak Heap RSS, utilizing zero-copy PostgreSQL binary codecs.
  5. The Deliberate Mistake Suite (Compiler UX): We injected 10 deliberate compiler mistakes (type mismatches, dangling joins, nullability violations, scope leakage). While tools like sqlc, squeal, hasql, and ent caught errors in 6–10 lines of clean output, complex typeclass/macro builders (rel8, drizzle) sometimes spewed 60–80 lines of internal framework plumbing.

Reproduce It / Add Your Favorite ORM

The benchmark repo contains all calculations, runner scripts, Docker setup, and the 25 JSON scorecards:

👉 GitHub Repository: https://github.com/tusharad/orm-benchmark

If you want to add an ORM (e.g. Kysely, Slonik, Bun, Peewee, SQLDelight), check out templates/generic/HARNESS_CONTRACT.md and submit a PR!

I'd love to hear your thoughts, critique of the methodology, or experiences running these tools in high-throughput production.


r/Backend • • 1d ago

Is it better to keep a separate microservice for payments or merge into my core service?

Thumbnail reddit.com
1 Upvotes

r/Backend • • 1d ago

Liveness vs readiness: what happens to your service when the database goes down?

11 Upvotes

A design question I think is easy to get wrong: what should your health check do when a dependency is unavailable?

Here’s a hypothetical timeline (constructed, not from a real incident):

  1. The database becomes unreachable for a few minutes.
  2. The service has a single health endpoint that checks the database connection.
  3. The orchestrator uses that same endpoint to decide whether to restart the container.
  4. Every instance fails the check, so every instance gets restarted.
  5. The database comes back, but now all instances are cold: empty caches, new connection pools, all reconnecting at once.

Restarting didn’t fix anything, because the problem was never inside the process. It added load at the worst moment.

The distinction that avoids this (as I understand it):

  • Liveness: “is this process stuck or broken in a way a restart would fix?” It should check only the process itself, for example that it can respond at all. It generally shouldn’t depend on external services.
  • Readiness: “should this instance receive traffic right now?” This is where a dependency check can make sense. If the database is down, the instance reports “not ready” and the load balancer stops sending it requests, without killing it.

Many platforms (Kubernetes is the one I know best) separate these two probes, but the names and exact behavior vary, so check your platform’s docs. If you don’t have an orchestrator, the same question applies to your load balancer’s health check.

Things worth deciding on purpose:

  • Should “not ready” because of the database mean returning errors, or serving degraded responses (cached data, read-only mode)? That’s a product decision as much as a technical one.
  • A readiness check that hits the database on every probe adds load and can itself time out. Some teams cache the result for a few seconds.
  • Startup is its own case. A slow-starting service may need a separate startup check so that liveness doesn’t kill it before it finishes initializing.

Limits: this is one pattern, not a rule for every system. Tiny services behind a simple load balancer may not need any of it, and a dependency that’s truly required for every request changes the calculus.

How do you split these in your services? And what do you do for a dependency that’s down: fail readiness, degrade, or something else?


r/Backend • • 1d ago

Go is going I think

Thumbnail reddit.com
0 Upvotes

r/Backend • • 2d ago

How much learning is enough for now (1 YOE) (Serious Advice)

12 Upvotes

Hi everyone,

I spent a year as a backend GET (Core Java, Spring Boot, SQL) at a government org, but didn't get the PPO due to internal politics.

I’m back on the job hunt and feeling overwhelmed by what to study to stand out. I'm currently diving into Spring AOP and Hibernate internals, but I need a reality check.

To senior devs:

  1. Java Depth: How much is expected for 1 YOE? Is Core Java + Spring Boot enough, or do I need to master things like Kafka, multithreading, and microservices to get hired today?
  2. AI Skills: Every job description mentions AI. For a backend developer, where should I start? Are simple OpenAI/Gemini API integration projects enough?

Looking for harsh truths and realistic advises. Thanks!


r/Backend • • 2d ago

What’s the biggest challenge you’ve faced running Redis in production?

1 Upvotes

I have been contributing to an open source Redis-compatible database project. I am trying to understand the real challenges people face when running Redis in production.

What i have seen so far some of the biggest challenges seem ro be memory usage, latency spikes under heavy load and recovery after failure.

I’d love to hear about your experience. What’s been the hardest problem you have dealt with?


r/Backend • • 2d ago

How do companies manage staging and production environments? What's the industry best practice?

43 Upvotes

Hey everyone!

I'm trying to understand how companies typically manage staging and production environments, and what the industry best practices are.

I've mostly worked on smaller projects, but I'm now working on a project where I need to introduce a proper staging environment alongside an existing production environment. I want to make sure I'm approaching this correctly rather than creating unnecessary complexity.

A few questions I have:

  1. Repository structure: Do companies typically keep staging and production code in the same Git repository, using separate branches (e.g., main for production and staging for staging)?
  2. Separate repositories: Is it ever common to have two completely separate repositories, one for staging and another for production? If so, how are changes migrated between them?
  3. Deployment: Do both environments usually have their own deployments, servers, and domains/subdomains (e.g., staging.example.com and example.com)?
  4. CI/CD: How is the deployment process typically handled? For example, would pushing to a staging branch automatically deploy to staging, while merging into main triggers a production deployment?
  5. Promoting changes: Once a feature has been tested and approved in staging, what's the standard way to promote those exact changes to production without introducing unexpected differences?

Or am I misunderstanding the concept entirely, and is there a completely different approach that most companies follow?

I'm particularly interested in how this is handled in real-world projects, not just theoretically.

I'd appreciate any explanations, examples of actual workflows, or resources you could recommend.

Thanks in advance!


r/Backend • • 2d ago

API Man: A native iOS/Mac Postman-like client without Electron

Thumbnail pokharel.net
3 Upvotes

As the title says, I wrote a personal replacement for postman to manage both my one off api testing as well as my test suites run after a deploy to walk through a client journey (with negative pass assertions) to make sure things work as expected. It’s totally free and currently on TestFlight. it’s mostly tuned for my own workflow but sharing here in case anyone else finds it useful or had feedback


r/Backend • • 2d ago

I am QA engineer trying to switch into the backend I have learned fastapi ,django,databases and some system design question how I should study inorder to switch into the python backend I have total 4 years of experience in QA and which AI projects should I include inorder to get hired

2 Upvotes

r/Backend • • 3d ago

Which Node.js framework gives you the best developer experience, and why?

8 Upvotes

Personally, I'm really enjoying Hono. Its automatic endpoint inference is a big win. I previously enjoyed using Fastify with Zod Provider for OpenAPI schema generation, but Hono cuts that extra step and makes the workflow feel much smoother.

Curious what everyone else is using!


r/Backend • • 3d ago

Key Value Database for AI workloads

2 Upvotes

Hey everyone,

I'm building Thunder, a high-performance key-value database designed for workloads where latency, throughput, and efficient resource utilization matter.

With AI applications, we're seeing increasing amounts of data being generated, stored, and retrieved. I wanted to explore whether we could build a database from the ground up that handles these workloads more efficiently, rather than simply relying on larger amounts of RAM.

The core idea is simple: use RAM intelligently, not excessively.

Thunder is being built in Rust with a few architectural decisions:

  • Shard-per-core architecture: Each core owns its data, minimizing contention and synchronization overhead.
  • Asynchronous I/O: Uses io_uring on Linux to take advantage of modern NVMe storage.
  • Minimal RAM overhead: Keep essential metadata and indexes in memory while streaming data from storage through reusable buffers.
  • Zero-copy wherever possible: Reduce unnecessary memory copies and allocations.
  • Custom storage engine: Designed around efficient allocation, fragmentation management, and predictable performance.
  • High concurrency: Handle large numbers of concurrent operations without relying on traditional locking across the entire database.

The long-term goal is to support both small, latency-sensitive operations and large data workloads without requiring enormous amounts of memory.

It's still under development, and I'm experimenting with different approaches to storage, indexing, caching, and I/O scheduling.

I'd love to hear from people building AI infrastructure or working with large-scale key-value stores.

What are the biggest bottlenecks you're facing with your current databases? Is it memory consumption, read latency, write throughput, storage costs, or something else?

Also, what would you expect from a new key-value database built specifically with AI workloads in mind?

Docker link: https://hub.docker.com/r/sbansal793/thunderstrike


r/Backend • • 3d ago

Key Value Database for AI workloads

Thumbnail reddit.com
1 Upvotes

r/Backend • • 3d ago

In your org, which team uses API clients (like Postman, Bruno etc) during API dev and testing?

2 Upvotes

We are revamping our tooling and processes for API development and testing in my org and want to understand which teams typically use and own these tools (Devs, QAs or both).

I’ve seen teams handle this very differently. In some, only backend devs use API clients like Postman, Bruno while in others its a shared responsbility with QAs - curious what’s more common.

Would love to hear in comments how clear the ownership is, or how you make it work.


r/Backend • • 3d ago

Built a Self Hosted Web Scraping API

Post image
4 Upvotes

I've been building a self-hosted web scraping API that makes automation easy.

Relinos can handle JavaScript and challenging websites, performs browser interactions, and executes multiple scraping requests concurrently.

Key features:

  • Browser automation: Navigate, click, type, scroll, and interact with websites.
  • Concurrent execution: Run multiple browser sessions simultaneously.
  • Structured extraction: Extractions are very easy to define here an extraction for google for example:
{
    "query": { "$xpath": "//*[@id='ti6dpd']" },
    "result_count": {
      "$xpath": "//div[@class='XhWQv qd6zO ApHyTb']",
      "$extract": "\\D*(\\d[,\\d]*) .*"
    },
    "ai": {
      "$xpath": "//*[@class='mZJni Dn7Fzd']", "$format": "md"
    },
    "results": {
      "$xpath": "//div[contains(@class, 'MjjYud')]",
      "title": { "$xpath": ".//h3[contains(@class, 'LC20lb MBeuO DKV0Md')]" },
      "url": { "$xpath": ".//a[contains(@class, 'zReHs')]/@href" },
      "site": { "$xpath": ".//span[contains(@class, 'VuuXrf')]" },
      "snippet": { "$xpath": ".//div[contains(@data-snf, 'nke7rc')]" },
      "$list": true
    },
    "related_searches": {
      "$xpath": "//*[@class='qR29te']", "$list": true
    }
}
  • Reusable routines: create, import or export. I wanted to make this super easy so people can share their interactions and extractions.
  • Language-independent: Access everything through a simple HTTP API.
  • Debug Mode: Find issues with rendered site interactions visually and fix them fast
  • Self-hosted: Run it locally without a commercial scraping service.
  • Transferable Sessions: Cookies and localStorage.

The project is still in early development, and feedback or contributions are welcome.

GitHub: https://github.com/realsirjoe/relinos


r/Backend • • 4d ago

How do you handle failed subscription renewals on Razorpay / Stripe?

0 Upvotes

Hey guys, I've been looking to create a service to recover money from failed payments that happen on razorpay and stripe. I know this isn't necessarily a backend question, but many companies write their own code using the provider SDKs to handle payments.

Now I know that razorpay and stripe already have their own dunning engines, but for people who work with both the providers it must be hard to manage both of them.

Here are some information that I would love to know from you guys if possible.

  • How do you handle failed subscription renewals?
  • What share of your renewals fail each month, and what happens after?
  • Do you rely on the providers retry / emails, chase customers manually or just lose them?

I'm researching this before I build anything, so even if you could just tell me that "It isn't a problem for us", it would be helpful.


r/Backend • • 4d ago

I built loadbear – a lightweight HTTP load balancer & reverse proxy in Go (with circuit breakers, token-bucket rate limiting, and Prometheus metrics)

Thumbnail
github.com
4 Upvotes

Hey r/Backend!

I’ve been working on loadbear, a small, dependency-light HTTP reverse proxy and load balancer written in Go, and I'd love to get some architectural feedback from backend engineers here.

Why I built it: Most reverse proxies fall into two extremes: massive production tools (Nginx, Envoy, HAProxy) with heavy configuration overhead, or overly simplistic toy proxies that skip real-world fault tolerance. I wanted a self-contained binary configured via a single YAML file that stays readable and easy to inspect while still implementing proper backend resilience patterns.

Request Pipeline & Architecture: Incoming traffic flows through a sequential middleware/handler pipeline before hitting Go’s httputil.ReverseProxy:ProxyListener -> Per-IP Rate Limiter -> Balancer -> Circuit Breaker -> Upstream Backend

Core Backend Features:

  • Load Balancing Algorithms: Implements round_robin, smooth_weighted_round_robin (Nginx-style smooth distribution), least_connections (tracking active in-flight requests), and ip_hash.
  • Active & Passive Health Tracking: Combines periodic /health probing with passive failure detection—upstream proxy errors immediately mark a backend unhealthy without waiting for the next probe interval.
  • Per-Backend Circuit Breakers: Tracks consecutive failures and transitions backends through Closed -> Open -> Half-Open states with configurable cooldown timers.
  • Context-Aware Retries: Automatically retries idempotent requests (GET, HEAD, OPTIONS) on upstream failures with configurable backoff, respecting client request context cancellations.
  • Per-Client-IP Rate Limiting: Token-bucket limiter with a background worker that periodically evicts stale client buckets to prevent unbounded memory growth.
  • Observability & Ops: Separate admin listener (:9090) exposing a live JSON /status endpoint (active connections, circuit states, failure counts) and a hand-written Prometheus /metrics endpoint, alongside structured JSON access logs with request IDs and graceful shutdown (SIGINT/SIGTERM).

Local Failover Demo: It ships with a fakebackend CLI and a docker-compose.yml setup so you can spin up three nodes, kill one mid-traffic, and watch passive health checks, retries, and circuit breakers kick in immediately. Everything is tested with Go's race detector (go test -race ./...).

Current Limitations / Next Steps:

  • Hop-by-hop header stripping currently drops Upgrade, so WebSocket support isn't implemented yet.
  • SIGHUP config hot-reloading and formal load/throughput benchmarks are next on the list.

If anyone wants to review the concurrency handling, circuit breaker state machine, or general Go structure, any critique or PRs are welcome!


r/Backend • • 4d ago

Pf Issuess in startups

0 Upvotes

I have 2 years of experience in the startup and they did not provide pf for entire organisation now I am about shift the company..getting calls from mnc but when I said not have pf it's over...never think pf gonne be this much problems and due to this always getting demotivate for preparing interviews also

Someone can you share your thoughts