Skip to main content

Case Study

Updated: 2026-10-01

SocialHub — Event-Driven Social Platform

A full-stack social media ecosystem featuring a NestJS GraphQL backend with Prisma and Redis Pub/Sub, a responsive Next.js web application with Apollo Client and Zustand, and a cross-platform mobile client.

Scope: full stackBackend EngineerDuration: 3 monthsYear: 2025Architecture: distributed-system

Key Engineering Facts & Architecture Specs

Structural Invariants

graphql modules

Fact

8 Modules

database models

Fact

12 Prisma Models

pubsub broker

Fact

Redis Pub/Sub

clients

Fact

Web (Next.js) + Mobile

Architecture View

Processing state: architecture signal graph is initializing...

Architectural Decision Log

Trade-Off Analysis

Code-first GraphQL with Apollo + graphql-ws

Single source of truth (TypeScript types -> schema), tight integration with NestJS dependency injection and guards.

Trade-off: Faster developer experience and type-safety vs larger generated schema artifact; requires extra care to keep DTOs/resolvers performant (no schema stitching).

Prisma ORM (Postgres) for data layer

Strong TypeScript integration, migration history, and expressive relation modeling. Unique/index constraints (e.g., @@unique([postId, createdById])) encode idempotency rules.

Trade-off: Abstraction simplifies queries but can hide SQL optimizations; for complex reporting queries raw SQL or materialized views may be required.

Redis Pub/Sub for cross-instance subscriptions

Enables multi-instance deployment without in-process pubsub; Redis offers low-latency fan-out and familiar operational model.

Trade-off: Redis cluster adds operational cost; developer must ensure message topology and retention are managed; subscriber reconnection semantics must be hardened.

Architecture Narrative

Challenge

Provides a single backend service that manages social data (profiles, feed, chat, notifications) with realtime updates and strong type safety for clients.

Solution

Monolithic, modular NestJS application using an event-driven style internally (CQRS + EventEmitter) with external real-time delivery via Redis Pub/Sub and GraphQL Subscriptions.

Result

Key measurable signals: Prisma migrations (8), DB models (11), GraphQL schema types (approx) (~50).

Trade-off Matrix

DimensionSelected OptionImpactCompromise
API protocolGraphQL (code-first) + websocket subscriptionsStrong typing, flexible client-driven queries, native realtime pushMore complex server-side resolver performance concerns and over-fetching prevention must be managed
Data accessPrisma ORM on PostgreSQLType-safe queries, fast iteration, migrations versionedComplex analytical queries may need raw SQL or separate OLAP store

Failure Modes & Resilience Analysis

Degradation Protocol

Failure Path & Recovery Invariants

DB outage: Behavior: Prisma client throws; PrismaService retry logic attempts reconnect and eventually surfaces error.

What I'd Do Differently & Evolution

+

Add distributed tracing (OpenTelemetry) and metrics (Prometheus) to correlate GraphQL operations, DB queries, and Redis pub/sub latency.

+

Introduce a durable background job queue (e.g., BullMQ / Redis Streams) for side effects (email, push notifications, heavy denormalizations) to improve resiliency and allow retries with dead-lettering.

Source Repositories & Access Endpoints

Verified Codebases

Estifanos Kebede

System Engineer & Full Stack Developer

Social

SYSTEM: ESTIFANOS.PORTFOLIO

STATUS: OPERATIONAL

LAST_UPDATED: 2026

© 2026 Estifanos Kebede. Built with precision and intent.