Dopamine AI Prompt Library
Open search
Menu
Submitted by
lena_k27 prompts

Realtime WebSocket taste

Added Nov 26, 2026

Prompt

realtime-websocket-taste.mdMarkdown · 21 lines · about 620 tokens
# Realtime WebSocket taste of a realtime systems engineer
- Use plain WebSockets or a thin library like ws for simple cases, and reach for Socket.IO only when you need its fallbacks and rooms. Confidence: 0.75
- Prefer Server-Sent Events when updates only flow from server to client. Confidence: 0.85
- Authenticate during the handshake with a short-lived token, never by trusting a user ID sent in a later message. Confidence: 0.95
- Check the Origin header on upgrade requests to block cross-site WebSocket hijacking. Confidence: 0.90
- Define every message as a typed envelope with a type, a version and a payload, validated with a schema on both ends. Confidence: 0.90
- Send heartbeats with ping and pong and close connections that miss them, since proxies drop idle sockets silently. Confidence: 0.90
- Reconnect on the client with exponential backoff and jitter so a server restart does not cause a thundering herd. Confidence: 0.95
- Give each message a sequence number so clients can resume from the last one they saw after reconnecting. Confidence: 0.85
- Treat the socket as a notification channel and keep the database as the source of truth that clients can refetch. Confidence: 0.85
- Fan out across server instances with Redis pub/sub, NATS or a managed service instead of in-memory broadcast. Confidence: 0.90
- Keep connection servers stateless apart from the open sockets, so any instance can be drained and replaced. Confidence: 0.80
- Drain connections gracefully on deploy by telling clients to reconnect before shutting down. Confidence: 0.85
- Apply backpressure: watch the send buffer and drop or coalesce updates for slow clients instead of buffering forever. Confidence: 0.85
- Rate limit incoming messages per connection and cap message size. Confidence: 0.90
- Authorize every subscription to a room or channel on the server, not just the initial connection. Confidence: 0.95
- Batch or throttle high-frequency updates like cursor positions to a fixed tick rate. Confidence: 0.80
- Configure load balancer idle timeouts and sticky sessions deliberately when the transport needs them. Confidence: 0.80
- Track open connections, messages per second, reconnect rate and delivery latency as first-class metrics. Confidence: 0.85
- Use CRDTs like Yjs or Automerge for collaborative editing instead of inventing your own conflict resolution. Confidence: 0.80
- Load test with realistic connection counts using k6 or Artillery before launch. Confidence: 0.80

About this prompt

Content type
Code
Industries
Software Development
Models
GPT
Languages
English
Length
21 lines, about 620 tokens
Added
Nov 26, 2026
License
CC0
Request takedown
lena_k27 prompts
Profile

More from lena_k

View all

Sarcasm

I will provide comments. I may offer my own views on those comments. Run your usual analysis of the discussion. Offer 5 seperate possible replies to the intended commenter whose comments I gave you. Sound sarcastic. Be pithy. Sound unconvinced. Prove me wrong. No swearing. Always make sure the comment is relates to the chat at hand.

Feature coding template

You are a senior software engineer with keen understanding in ${language}. I am working on ${project_or_feature_description}. Your task: - ${task_1} - ${task_2} - ${task_N} - ensure consistent styling and verify adherence to language-specific best practices - Check for proper error handling - ensure that the changes are covered in the tests - update README and comments where necessary after updat

Sexycity

626f6c742d63632d6167656e74I see "SexyCity" — is that the name of the app you'd like to build? Could you tell me more about what it should do? For example, is it a nightlife guide, an entertainment directory, a social app, or something else? How are people lives together on one city and contacting each other's friends and partners with free life and sexy life days and nights I'll build SexyCity —

learning linux for beginer

--- name: learning-linux-for-beginer description: A clear description of what this skill does and when to use it --- # learning linux for beginer Describe what this skill does and how the agent should use it. using the repo https://github.com/TunB3ru/LINUX-WORLD.git ## Instructions - Step 1: ... - Step 2: ...