A
AWS load balancer that distributes incoming HTTP/HTTPS/WebSocket traffic across multiple EC2 instances. Operates at Layer 7 (application layer), enabling path-based and host-based routing. Used to switch traffic between Blue and Green environments during deployments.
In use: ALB routes 100% traffic to Blue target group, then switches to Green after smoke tests pass. Rollback = flip the listener rule back. Takes <30s.
Tools like Datadog, New Relic, or custom middleware that trace every request through a system — measuring latency, error rate, and throughput. Used to compute percentile latency (P50/P95/P99) across millions of requests in production.
In use: Express middleware using process.hrtime.bigint() records request duration on res.finish. Aggregated into percentiles to verify <200ms P95 claim.
AWS feature that automatically adds or removes EC2 instances based on demand. A target tracking policy watches a metric (e.g., CPU utilization) and adds instances when it exceeds the target (60%), removes them when demand drops.
In use: min=2 (for AZ redundancy), max=10. Scale-out cooldown=300s to prevent flapping. Scale-in protection for instances with active WebSocket connections.
An immutable, append-only record of every significant action in the system — who did what, to which resource, from which IP, and what changed. Required for compliance, debugging, and forensics.
Schema: { userId, action, resource, resourceId, ip, userAgent, diff: {before, after}, timestamp }. TTL index auto-deletes logs older than 1 year.
B
Flutter state management pattern where UI dispatches Events, the Bloc processes them and emits States. Enforces strict separation between UI and business logic. Well-suited for complex state machines like 7-stage order tracking.
Flow: Widget dispatches OrderSubscribeRequested(orderId) → Bloc fetches + subscribes to WebSocket → emits OrderLoaded(order) or OrderError(msg) → BlocBuilder rebuilds only affected widgets.
A zero-downtime deployment strategy using two identical production environments (Blue = live, Green = new version). Traffic is shifted from Blue to Green after smoke tests pass. Rollback = shift traffic back to Blue instantly.
Rollback time: <30s (ALB listener rule change). Deployment pipeline auto-rolls back if Green's health checks fail within 2 minutes of cutover.
C
Caching pattern where the application checks the cache first; on miss, reads from the DB and writes to the cache for future requests. The application code manages the cache — it's "aside" from the main data flow. Most common Redis pattern.
Pattern: Check Redis → hit: return → miss: query MongoDB → write to Redis with TTL → return. On data update: invalidate Redis key immediately.
In Kafka, a named group of consumers that together consume all partitions of a topic. Each partition is consumed by exactly one consumer in the group at a time. Scale by adding consumers up to the number of partitions.
In Tredye: rsi-calculator consumer group reads from candles topic. Adding a second instance splits partitions — both process in parallel without duplicate processing.
AWS Content Delivery Network (CDN). Caches static assets at 400+ edge locations globally, serving them with ~5ms latency vs 100-300ms to origin. Also integrates with WAF for DDoS protection and supports signed URLs for private content.
Cache strategy: /public/* → TTL=1 year. /catalog/* → TTL=5 min. /api/* → TTL=0 (no cache, forward all). Invalidation triggered on catalog updates.
Maintaining a pool of pre-established database connections reused across requests, avoiding the overhead of opening a new TCP connection (5-30ms) per query. Mongoose's default pool is 5; increased to 20 for production workloads.
Config: maxPoolSize: 20, minPoolSize: 5. Pool exhaustion → requests queue until a connection frees. If queue waits >5s → 503 error.
D
Email authentication standards. SPF (Sender Policy Framework): DNS record listing which servers can send email for your domain. DKIM (DomainKeys Identified Mail): cryptographic signature on outgoing emails proving they weren't tampered with. DMARC: policy specifying what to do with emails failing SPF/DKIM (reject, quarantine, or allow).
In use: Required for SES transactional email to avoid spam folders. DKIM with 2048-bit key, DMARC policy=quarantine, SPF includes amazonses.com.
A technical analysis signal where price and RSI move in opposite directions. Regular bullish: price makes lower low, RSI makes higher low → bearish momentum weakening → potential upward reversal. Regular bearish: price makes higher high, RSI makes lower high → bullish momentum weakening → potential downward reversal.
In Tredye: Detected by comparing ZigZag pivot points of price series vs RSI series. Streamed as signals via Redis pub/sub to browser in real-time.
E
System design where components communicate by producing and consuming events, rather than direct synchronous calls. Producers don't know who consumes their events. Enables loose coupling, independent scaling, and natural audit trails.
In TingTing: Order placed → order.created event → triggers: inventory deduction, push notification, rider assignment, analytics recording — all independently, without the order service knowing about any of them.
MongoDB compound index field ordering rule. Put Equality fields first (exact match, highest cardinality reduction), then Sort fields (eliminates in-memory sort), then Range fields (inequality: $gt, $lt). Wrong order means the index can't cover all three operations.
Example: { storeId: 1, status: 1, createdAt: -1 } — storeId (equality), status (equality), createdAt (sort). Query: find orders for storeId X with status PENDING, sorted by date.
Retry strategy where wait time doubles with each failed attempt (1s → 2s → 4s → 8s → …), capped at a maximum. Prevents overwhelming a struggling service with rapid retries. Combined with jitter (random offset) to prevent thundering herd when many clients retry simultaneously.
Flutter WebSocket: retry delay = min(2^n * 1000 + random(0-1000), 30000)ms. At attempt 5: ~32s wait ± jitter. Max 10 retries before giving up.
G
Total monetary value of all orders processed through the platform — what customers paid in total. GMV ≠ Revenue. Revenue = GMV × platform take rate (typically 3-5%). GMV is the standard scale metric for commerce platforms.
₹1.5Cr GMV = ~₹150,000,000 total order value processed through TingTing over ~32 months. At 3% take rate ≈ ₹4.5L in platform revenue.
Flutter routing package providing declarative, URL-based navigation. Supports deep links (open a specific screen from an external URL), route guards (auth redirects), and named routes. Works identically on mobile (custom scheme) and web (real URLs).
Deep link: zoober://orders/abc123 → user taps SMS link → app opens directly to OrderDetailScreen with orderId=abc123. Route guard checks if user is logged in, redirects to login if not.
MongoDB index type for GeoJSON data (Points, Polygons, LineStrings). Enables efficient proximity queries like "find all stores within 5km of this coordinate" using geohash-based B-tree traversal instead of full collection scan.
Query: $near: { $geometry: {type:'Point', coordinates:[lng,lat]}, $maxDistance: 5000 } returns stores sorted nearest-first. Without index: O(n) scan. With index: O(log n). Result: <100ms at 30+ stores.
System design principle where a component failure causes reduced functionality rather than total failure. The system continues operating at a lower capability level instead of crashing entirely.
Payment fallback: Juspay fails → try PhonePe directly → try Razorpay → all fail → hold order in PENDING, notify admin. Customer sees "retry" instead of error, not stuck.
H
Cryptographic mechanism to verify both the integrity and authenticity of a message. Computed as HMAC-SHA256(secret, message). The shared secret ensures only someone who knows it can produce a valid HMAC — used to verify that webhook payloads genuinely came from the payment gateway.
Razorpay webhook: Gateway sends X-Razorpay-Signature header. Server computes HMAC of raw request body with shared secret and compares using crypto.timingSafeEqual() to prevent timing attacks.
Periodic ping-pong exchange between WebSocket server and clients to detect broken "zombie" connections. Without heartbeat, a TCP connection that dropped without a clean close looks alive to the server indefinitely — consuming memory and slots. Server sends ping every 30s; no pong = terminate.
Memory impact: At 1000 connections × 40-60KB each = 40-60MB. Without heartbeat cleanup, zombie connections accumulate until process OOM-kills.
J
Compact, URL-safe token format for representing claims between parties. Consists of three base64url-encoded parts: Header (algorithm), Payload (claims: sub, role, tenantId, exp), and Signature (HMAC of header+payload). Stateless — server verifies without a DB lookup.
Access token: 15-min TTL (short-lived to limit stolen token window). Refresh token: 30-day TTL, stored in Redis. Stateless access = no DB hit per API request = major performance benefit at scale.
Indian payment orchestration platform that provides a unified API over multiple underlying gateways (Razorpay, PhonePe, Paytm, etc.). Routes each transaction to the best-performing gateway based on real-time success rates. Handles PCI DSS compliance, retry logic, and UPI.
Why primary: India's UPI failure rate is ~2-3%. Juspay's smart routing picks the gateway with the highest success rate for the user's bank at that moment. One integration → multiple gateway coverage.
K
Distributed event streaming platform. Publishers produce messages to topics; consumers read from them. Topics are split into partitions for parallelism. Messages are retained on disk (log) for a configurable duration — consumers can replay past events.
In Tredye: 4 topics: raw-ticks, candles, indicators, signals. Each stage is a separate Python service — completely decoupled. If the RSI calculator restarts, it resumes from its last committed offset.
Kafka's built-in consensus protocol (from Kafka 2.8+, production-ready in 3.3) that replaces ZooKeeper for cluster metadata management. Controllers use Raft consensus to maintain metadata quorum, eliminating ZooKeeper as a separate dependency.
Benefit: Fewer systems to operate (no ZK cluster). Faster controller election. Higher partition limit (millions vs ~200K with ZK). Kafka 4.0 removes ZK support entirely — KRaft is the future.
M
Open standard by Anthropic for connecting LLMs to external data and tools. Like USB-C for AI — any MCP-compatible LLM (Claude, GPT, Gemini) can use any MCP server (database, API, file system) without custom integration per pair. Supports SSE and STDIO transports.
MCPVave: MCP engine built in Flutter, connects to Zoober backend via SSE. LLMs can call tools like get_inventory, forecast_demand, route_order — enabling AI-powered commerce management.
Architecture where a single application instance serves multiple customers (tenants), with their data logically isolated. Three approaches: separate DB per tenant (expensive, strong isolation), schema-per-tenant (complex migrations), shared DB + tenantId field (simplest, chosen for Zoober/TingTing).
Enforcement: BaseService class injects { tenantId: req.user.tenantId } into every MongoDB query automatically. Impossible to read another tenant's data without bypassing the service layer intentionally.
O
Standard candlestick data format for financial time series. Each candle aggregates all trades within a time interval (1m, 5m, 15m, 1h) into five values: opening price, highest price, lowest price, closing price, and total volume.
In Tredye: candle-builder service consumes raw ticks from Kafka and aggregates them into OHLCV candles per symbol per timeframe, then produces to the candles topic for RSI calculation.
Concurrency control where a version field (__v in Mongoose) is included in update conditions. The update only succeeds if the document hasn't changed since it was read. If two processes try to update simultaneously, only the first succeeds; the second finds no matching document (version mismatch) → conflict detected.
Order state machine: findOneAndUpdate({ _id, __v: currentVersion }, { $set: {status}, $inc: {__v: 1} }). Returns null if version changed → throw ConflictError. Prevents duplicate WebSocket events from double-transitioning an order.
P
Latency percentiles. P50 = median: 50% of requests are faster than this. P95: 95% of requests complete within this time — the industry standard SLA metric. P99: slowest 1% — often represents GC pauses, cold paths, or lock contention. P95 is preferred over P99 for SLOs because the last 1% is expensive to optimize.
Claim: <200ms P95 means 95% of API responses complete in <200ms. At 80K orders, 4,000 requests were slower — typically catalog refreshes or first-time cold queries.
MongoDB index that only indexes documents matching a filter expression. Smaller index = faster writes and less RAM. Ideal for collections where queries always include a condition matching the filter (e.g., only index isActive: true stores).
createIndex({tenantId:1, location:'2dsphere'}, {partialFilterExpression: {isActive:true}}) — indexes only active stores (~30% of total). 70% smaller index, faster geo queries.
Flutter's bridge between Dart code and native Android (Kotlin/Java) or iOS (Swift/ObjC) code. Used when Flutter's built-in APIs don't cover a native feature — biometrics, native payment SDKs, background location, Bluetooth.
Used for: Juspay's native Android SDK (UPI intent flow requires native code), biometric authentication (fingerprint/face ID), background location tracking for riders.
Temporary, signed URL for a private S3 object. The server generates it (using AWS credentials) and gives it to the client. The client can then upload/download directly from S3 for a limited time window — without the server proxying the file or exposing AWS credentials.
Rider document upload: App requests presigned PUT URL → backend generates 5-min URL → app uploads JPEG directly to S3 → backend updates DB with S3 key. Server never touches the file data.
R
Authorization model where permissions are assigned to roles, and users are assigned roles. Each API endpoint specifies required permissions; middleware checks if the user's role has those permissions. Cleaner than per-user permission management at scale.
Roles: ADMIN, MERCHANT, RIDER, CUSTOMER. PATCH /orders/:id/status requires order:update-status permission → only ADMIN, MERCHANT, RIDER have it. CUSTOMER gets 403.
Routing read queries to MongoDB replica secondaries and writes to the primary. Distributes load — catalog browsing (reads) don't compete with order updates (writes) on the same node. Replication lag (~10-500ms) is acceptable for catalog reads, not for financial/order state reads.
Mongoose: .read('secondaryPreferred') on store/product queries. Primary-only for order state transitions, payments, and sessions where strong consistency is required.
In-memory data store used as cache, pub/sub broker, and distributed lock manager. Sub-millisecond read/write latency. Persistence options: RDB (periodic snapshot) or AOF (append-only file for durability). Single-threaded core — operations are atomic by design.
Used for: Cache-aside (catalog), session storage (JWT refresh tokens), WebSocket event replay (sorted set), rate limiting (INCR+EXPIRE), distributed locks (SETNX), pub/sub (order broadcasts).
Momentum oscillator (0-100) measuring the speed and magnitude of price changes. RSI > 70 = overbought (potential sell), RSI < 30 = oversold (potential buy). Calculated as 100 - (100 / (1 + RS)) where RS = average gain / average loss over N periods (typically 14).
Wilder's smoothing (used in Tredye): incremental calculation — only needs previous avg_gain and avg_loss. O(1) per tick vs O(n) for full recalculation. Avoids processing 300+ candles on every market tick.
Ensuring every database query is scoped to the current tenant's data. Implemented at the service layer (not DB layer) — a BaseService class automatically injects { tenantId: req.user.tenantId } into every query filter, making cross-tenant data access structurally impossible through normal code paths.
S
AWS managed email sending service. Used for transactional emails (order confirmations, OTPs, admin alerts). Requires DKIM/SPF/DMARC setup for deliverability. Monitors bounce and complaint rates — high rates trigger sending limits or account suspension.
Google's compression algorithm optimized for speed over ratio (~1.5-2x compression). CPU overhead is negligible vs gzip (2.5-3x ratio but much slower). Best for high-throughput systems where decompression speed matters more than maximum compression ratio.
In Tredye: Market tick JSON is repetitive numeric data — Snappy compresses ~40%. Reduces Kafka broker network bandwidth and disk I/O with near-zero CPU cost. Chosen over gzip because the pipeline processes thousands of ticks/second.
HTTP-based protocol for server-to-client streaming. A single long-lived HTTP GET connection; the server pushes text events. Simpler than WebSocket (plain HTTP, no upgrade) but unidirectional — client can't send data back over the same connection.
MCP SSE transport: Flutter app connects to GET /mcp/sse and keeps it open. Server streams MCP protocol messages. Client sends tool calls as separate POST /mcp/messages requests.
System with a finite set of states, explicit transitions between them, and guards that validate whether a transition is permitted. Prevents invalid state changes (e.g., DELIVERED → PENDING) by making only legal transitions possible.
7-stage order machine: PENDING → CONFIRMED → PREPARING → READY → PICKED_UP → DELIVERED → COMPLETED. CANCELLED reachable from most states. findOneAndUpdate with __v optimistic lock makes transitions atomic.
Inter-process communication via standard streams (stdin/stdout). The MCP STDIO transport runs the MCP server as a child process; the parent (Flutter app) communicates via piped stdin/stdout. Fast, no network overhead, works offline — but requires process spawning, which is only possible on desktop platforms.
Desktop only: Flutter on Windows/macOS/Linux can spawn a local MCP server process. On Android/iOS/Web, STDIO isn't available — SSE transport is used instead.
T
When many clients simultaneously experience the same failure (e.g., server restart) and all retry at the same time, creating a traffic spike that overwhelms the recovering server. Solved with jitter — adding random delay to backoff intervals so retries are spread across a time window.
At 1000 WebSocket clients: Server restarts → all 1000 retry after exactly 2s (no jitter) → 1000 simultaneous connections in <1s → server overwhelmed → crashes again → loop. With jitter: retries spread over 0-3s → ~333 connections/s → manageable.
Side-channel attack where an attacker infers information by measuring how long a comparison takes. Regular string comparison short-circuits on first differing byte — comparing "abc" vs "abd" takes longer than "abc" vs "xyz". Mitigated with constant-time comparison (crypto.timingSafeEqual) that always compares all bytes.
Rate limiting algorithm. A bucket holds tokens (max = capacity). Each request consumes one token. Tokens refill at a fixed rate. When empty → requests rejected (429). Allows bursting up to bucket capacity while enforcing average rate. Implemented in Redis using INCR + EXPIRE per key.
Login rate limit: capacity=5 tokens, refill=1/min per IP. A user can make 5 rapid login attempts, then must wait 1 min per attempt. Prevents brute-force without penalizing normal usage.
MongoDB index that automatically deletes documents after a specified time. MongoDB scans TTL indexes every 60 seconds and removes expired documents. Used to auto-clean sessions, rate limit records, webhook deduplication keys, and audit logs older than a year.
createIndex({ expiresAt: 1 }, { expireAfterSeconds: 0 }) — deletes documents when expiresAt date passes. Alternative: createIndex({ createdAt: 1 }, { expireAfterSeconds: 86400 }) — deletes 24h after creation.
U
Percentage of time a system is operational. 99.9% uptime = 8.76 hours/year max downtime. Achieved through redundancy (multi-AZ, replica sets), zero-downtime deploys (blue-green), health check auto-recovery, and graceful shutdown on process restart.
99.9% operationally means: A deployment that takes 5 minutes counts as 5 minutes of "downtime" unless zero-downtime deploy is used. Blue-green + PM2 graceful reload keeps this at effectively 0 for users.
W
Filters and monitors HTTP requests before they reach your servers. Blocks common attacks (OWASP Top 10: SQLi, XSS, LFI, RCE) and enforces rate limits at the CDN edge (CloudFront layer) — before traffic hits EC2. AWS WAF uses managed rule groups updated by AWS security team.
Rules active: OWASP Core Rule Set, SQLi rule set, custom rate rule (100 req/5min per IP per route). Triggered during a scraping incident — geo-blocking was temporarily added.
Protocol providing full-duplex communication over a single persistent TCP connection. Starts as an HTTP request then upgrades. Enables true bidirectional real-time communication — server can push data to client at any time without the client polling. ~40-60KB memory per connection.
In Zoober: Customer app receives order status updates. Rider app sends location updates. Merchant app receives new orders. All via the same WebSocket server — 1000+ concurrent connections on a single t3.medium Node.js process.
When a single logical write triggers multiple physical writes to disk/memory. In a commerce context: order placed → write order doc, write payment doc, update inventory, write notification, write audit log, update analytics = 6+ writes per user action. Avoided by batching, caching hot reads, and using Redis to absorb read traffic so MongoDB only handles actual writes.
Z
Technical analysis algorithm that filters price noise to identify only significant swing points (local highs and lows) where price moved at least N% from the previous pivot. Produces a simplified zigzag line through major price swings, used to find meaningful highs/lows for divergence comparison.
In Tredye: 2% threshold — only pivots where price moved >2% from last pivot are recorded. Applied to both price series and RSI values, then corresponding pivot pairs are compared to detect divergence.