Architecture picks: 4-region active-passive with a Redis-backed event bus.
💬

Architecture picks: 4-region active-passive with a Redis-backed event bus.

Category:IM Chat System Free Downloads:0

When a single cloud provider stumbles, dozens of consumer apps can go dark in minutes — exactly what happened recently when one provider’s us-central1 region hit problems and Spotify, Discord, Snapchat, and OpenAI all spiked on outage trackers within the same hour. It’s a harsh reminder that any 通讯系统 in production today needs more than a single happy-path deployment.

That’s the gap this source code download on dajian168 tries to close. It is a ready-to-deploy, multi-region communication system built around an active-passive failover core, a queue-backed event bus, and pluggable transport adapters (WebSocket, gRPC, HTTP/2). You get the full backend, an admin console, and a small reference client so you can stand it up locally in an afternoon.

Architecture picks: 4-region active-passive with a Redis-backed event bus.

When I first wired this up I expected the docs to push a single-region layout. Instead the repo ships with a 4-region topology template — primary in us-east, standby in us-west, ap-southeast, and eu-west — coordinated through a Raft-backed metadata layer. Each region holds its own PostgreSQL 15 replica and a Redis 7 stream that handles message fan-out, which is how the system keeps a chat session alive while traffic shifts to a healthy region in under 30 seconds.

What I like is that the failover decision isn’t hardcoded. There’s a /health/probe endpoint on every node that reports back to the orchestrator every 5 seconds; if a region misses 3 probes, the orchestrator promotes the standby and rewrites DNS via the included API helper. Actionable takeaway: before you go live, set the probe interval and the failure threshold in config/orchestrator.yaml to values that match your actual p99 latency, not the defaults.

3 features you’ll actually use on day one.

  • End-to-end message ordering. Kafka 3.6 transactional producers with a single partition key per conversation. In testing I saw 0 reordering incidents over a 72-hour soak at roughly 12k msg/s.
  • Pluggable transport. WebSocket, gRPC, and HTTP/2 long-poll adapters sit behind one interface. Switching transports is a 1-line config change; no recompile needed.
  • Admin console with rate-limit dashboard. Surfaces per-tenant QPS, error budgets, and live connection counts. There’s a setting in the admin panel (/admin/quotas) to override the default 100 req/s per token before traffic reaches the load balancer.

Deployment: 7 steps to a working dev cluster.

  1. Provision 2+ Linux VMs (Ubuntu 22.04, 2 vCPU / 4 GB RAM minimum per region).
  2. Clone the repo and run make deps to pull Go 1.22, Node 20, and the protoc toolchain.
  3. Copy .env.example to .env and fill in DB DSNs plus Redis URLs for each region.
  4. Run make migrate against every PostgreSQL instance to apply the 14 schema migrations.
  5. Boot the orchestrator with docker compose -f deploy/orchestrator.yml up -d.
  6. Start the gateway nodes: for r in us-east us-west; do ansible-playbook -i $r playbooks/gateway.yml; done.
  7. Hit https://<your-host>/admin/cluster and confirm all 4 regions show green before pointing traffic at them.

Deployment environment

Original Reference

Original title: 谷歌云服务意外故障引发系列连锁反应,致使 Spotify、Discord、OpenAI 等平台短暂瘫痪 – 热点资讯

Original excerpt:

搭建168 6 月 13 日消息,北京时间今天凌晨,
谷歌
云服务突发故障,波及众多在线服务,自美东时间下午 2 点起,谷歌及其他平台陆续传出服务中断报告。尽管谷歌旗下应用已基本恢复运行,但多家企业仍有部分用户面临连接问题。
据外媒 Engadget 报道,谷歌在声明中表示,已找到故障根源并采取缓解措施,除美国中部地区(us-central1)外,其基础设施已在各地恢复。依赖受影响设施的
谷歌云
服务也正逐步恢复。
谷歌指出,工程师已掌握 us-central1 及 multi-region / us 区域仍存在用户受影响的情况,正在推进全面修复,但尚无具体完成时间表。
Spotify、Discord、Snapchat、Etsy、UPS 和
OpenAI
都在 DownDetector 上出现大量异常报告,部分平台向用户通报了中断情况,连多款宝可梦游戏也受到波及。Snapchat 在官网确认服务异常,OpenAI 则称登录困难是因“多家外部网络服务供应商出现问题”。
亚马逊
AWS 同期也报告量激增,不过亚马逊对 Engadget 表示其服务运行正常,并建议用户参考 AWS Health Dashboard,而非 DownDetector,以判断服务状态。
截至目前,大部分服务已恢复。Spotify 首页已能正常访问,DownDetector 上的报告数量也趋近常态。Snapcha

Original screenshots:

Download link not configured yet. Please contact admin.

Follow Our WeChat

WeChat Public Account