Skip to content
Start In Cloud

Tech Stack

HitKeep is built with a deliberate, minimal stack chosen for performance, auditability, and operational simplicity. Every dependency earns its place.

The application server, ingest pipeline, background workers, and CLI are written in Go. HitKeep ships as a single Linux binary and does not require external database or queue services on the target system.

Why Go:

  • Ships as a single Linux binary for linux/amd64 and linux/arm64
  • Current Linux release binaries target a glibc 2.34+ baseline (for example Amazon Linux 2023, Ubuntu 24.04+, Debian 12+)
  • Excellent standard library for HTTP servers, crypto, and concurrency
  • CGo is used only for DuckDB (the embedded database) — no external services
  • Low memory overhead: ~45–64 MB RSS for a typical single-site deployment

DuckDB is an in-process analytical database engine embedded directly in the Go binary via duckdb-go/v2. It replaces the PostgreSQL + ClickHouse combination required by most analytics platforms.

Why DuckDB over ClickHouse or PostgreSQL:

DuckDB (HitKeep)PostgreSQL + ClickHouse
Process count12–3
Network sockets required02–3
BackupCopy the HitKeep data directory (hitkeep.db plus any tenants/*/hitkeep.db)Dump multiple databases
Query typeColumnar OLAPRow + columnar split
Storage efficiency~120 MB / million hitsVaries; typically higher with overhead
Direct query accessDuckDB CLI or any Parquet toolpsql / clickhouse-client

DuckDB’s columnar storage engine is purpose-built for analytical queries — aggregations, time-bucketing, and filtering over large event tables — which is precisely the workload analytics generates. HitKeep now also uses DuckDB’s appender API on the ingest path, so incoming hits and events are flushed in micro-batches instead of one SQL INSERT per message.

NSQ is an in-process message queue that decouples the HTTP ingest path from the DuckDB write path. The HTTP handler enqueues each hit in microseconds; background consumers resolve the target tenant store, group messages by store, and write them to DuckDB in micro-batches at a pace that suits the database.

Why NSQ is embedded (not Kafka):

  • Zero external broker to manage or monitor
  • Binds to 127.0.0.1 loopback only — never exposed externally
  • Absorbs traffic spikes without database back-pressure
  • Lets the write path acknowledge messages only after a successful DuckDB batch flush
  • Configurable loopback ports if you run multiple HitKeep instances locally

For high-availability deployments, HitKeep uses Memberlist (the library behind Consul and Serf) for node discovery and Leader election. One node holds the DuckDB write lock (Leader); followers proxy ingest requests to it.

This enables Kubernetes StatefulSet deployments with automatic Leader failover when a pod is rescheduled.

HitKeep uses Go’s standard net/http mux, not an external framework. This minimizes the attack surface and keeps the binary lean.


The dashboard is a Single Page Application built with Angular v21. State management uses Angular Signals throughout — no NgRx, no RxJS BehaviorSubjects for local state.

Why Angular (not React or Vue):

  • Strong TypeScript integration out of the box
  • Angular CLI + ng build --configuration production produces heavily optimized, tree-shaken bundles
  • PrimeNG’s component library has first-class Angular support
  • Change detection with OnPush + Signals eliminates unnecessary re-renders

PrimeNG provides the component library: data tables, charts, dialogs, forms, and navigation. It is styled via the PrimeUI theming system and Tailwind CSS utility classes.

Utility-first CSS framework for layout and spacing. Used in the dashboard alongside PrimeNG’s design tokens for a consistent visual system.

The hk.js tracking snippet is minified using esbuild — the same bundler Angular uses internally — keeping it under 2 KB with no additional toolchain dependency.

The snippet is served from your HitKeep instance — no third-party CDN, no cross-origin request from your visitors’ browsers.


DependencyRole
duckdb-goEmbedded OLAP database
go-nsq + nsqEmbedded message queue
memberlistCluster gossip / Leader election
golang-jwt/jwtJWT session tokens
go-mailSMTP email delivery
mjml-goMJML email template rendering
phuslu/iplocIP geolocation (offline, embedded)
golang.org/x/cryptoargon2id, WebAuthn crypto primitives
golang.org/x/timeToken bucket rate limiter

Zero cloud SDKs. Zero external service clients (beyond the optional SMTP server you configure). Zero analytics or telemetry libraries.


The full source — Go backend, Angular dashboard, tracker snippet — is on GitHub under the MIT license.