ActualBuild Start a project

Work / Case study 01

NotLogs

A logging, search and alerting platform for developers who don't have a platform team — designed so customer apps never wait on storage.

Type
In-house SaaS product
Scope
SDK, API, dashboard, billing, AWS infra, CI/CD
Stack
NestJS · Next.js · NATS · ClickHouse · Redis · Postgres
Live
notlogs.site ↗
The NotLogs landing page

01 — The problem

Logging tools assume you have a platform team.

A solo developer or a small startup just wants to send logs, search them, and get a message when something breaks. Instead they get agents to install, YAML to maintain, and per-host billing that's hard to predict.

NotLogs takes the opposite approach: one SDK call to start, flat INR pricing, and an architecture that stays fast and cheap to run. Three constraints shaped every decision:

  1. Customer apps never slow down because of us. Ingestion stays quick no matter what the database is doing.
  2. Search stays fast as data grows, and every query is scoped to one customer.
  3. Running cost stays small — roughly $155–170 a month for the whole production stack, by the Terraform estimate.

02 — The approach

Accept now, write later.

The tempting design inserts each batch straight into the database — which couples every customer's response time to the slowest insert. Instead the API does three cheap checks, hands the batch to a durable queue, and answers 200. Watch one log travel the write path:

NotLogs write path: your app, CloudFront and WAF, ALB, NestJS API, NATS JetStream, worker, ClickHouse; Redis and Postgres as supporting stores.AWS ap-south-1Your appSDK batches logsCloudFront + WAFrate limit at edgeALBHTTPS routingNestJS APIECS FargateNATS JetStreamdurable queueWorkerqueue consumerClickHouselog storageRediskeys · quotasPostgres (Neon)users, plans, rules123456
Write pathGrey lines: reads & counters
  1. 1
    SDK to edge

    Logs are batched in memory and posted over HTTPS. WAF drops abusive IPs before they reach a server.

  2. 2
    ALB to API

    The load balancer routes to the NestJS API on ECS Fargate.

  3. 3
    API publishes

    Key and quota checked, batch published to NATS, 200 returned. The customer app is free.

  4. 4
    NATS holds it

    JetStream keeps the message on disk until a worker takes it.

  5. 5
    Worker writes

    Inserts into ClickHouse, bumps usage counters, feeds alerts and live tail.

  6. 6
    Stored & searchable

    level:error search:timeout — ClickHouse answers from stored rows.

03 — Decisions in numbers

100 / 2s
SDK flush trigger — 100 buffered logs or 2 seconds, whichever comes first.
10 MB · 500 ms
ClickHouse async-insert buffer, after one-insert-per-log caused “too many parts” errors.
3 tiers
API-key checks: in-memory LRU → Redis → Postgres + Argon2id. Invalid keys are cached too.
userId first
The ClickHouse sort key leads with the tenant, so each customer's query jumps straight to their rows.

04 — The product

Sign in, create a key, install the SDK, watch logs arrive.

05 — What broke, and the fix

Duplicate alerts

Symptom Customers got two Slack messages per alert.

Cause Two ECS containers; a plain subscription delivers every event to every subscriber.

Fix A JetStream queue group, so each event goes to exactly one container.

Too many parts

Symptom ClickHouse errors under load.

Cause One INSERT per log creates thousands of tiny data parts.

Fix async_insert with a 10 MB / 500 ms buffer.

Payment modal loop

Symptom The Razorpay popup kept reopening.

Cause useSearchParams without a Suspense boundary; re-renders retriggered checkout.

Fix Suspense, plus a useRef guard on the auto-trigger.

06 — Honest gaps & what's next

  • Single point of failure. ClickHouse and NATS share one EC2 instance — cheap, but the first thing to harden.
  • Per-plan retention. Pricing lists 7–180 days; today there's one global 30-day TTL.
  • Cold storage. Tier older logs to S3 instead of deleting them.
  • Autoscaling and OpenTelemetry. Target-tracking for tasks, and an OTel endpoint so teams can skip the SDK.
  • Benchmarks. k6 load tests exist, but no production throughput numbers are published yet — so we make no throughput claims.
Go deeper — 12 min read The full engineering breakdown: SDK, security, alerts, billing, AWS and deploys →

Have something like this in mind?

We design, build and run products like NotLogs — for ourselves and for clients.

Start a project