tRPC vs gRPC vs oRPC — Choosing the Right RPC Style for Your Project
tRPC, gRPC, and oRPC are all ways to build Remote Procedure Call (RPC) style APIs but target different priorities: gRPC focuses on high-performance, language‑agnostic, binary RPC for microservices and systems programming; tRPC focuses on developer ergonomics and end‑to‑end TypeScript type safety for full‑stack TypeScript apps; oRPC sits between them by adding OpenAPI/REST interoperability and richer tooling while keeping TypeScript-first ergonomics.【5】【1】【2】 Essential context and comparison What each project is and its core goals gRPC — a mature, language‑agnostic RPC framework from Google that uses HTTP/2 transport and Protocol Buffers (protobufs) for compact binary serialization and an IDL-driven contract between services【5】【1】. tRPC — a TypeScript‑first RPC library that exposes server procedures directly to TypeScript clients, delivering zero‑boilerplate end‑to‑end type safety and rapid developer iteration (especially inside monorepos and Next.js apps)【1】【3】. oRPC — an evolution of the TypeScript‑first RPC idea that preserves tRPC‑style type safety but adds built‑in OpenAPI generation and optional REST endpoints so APIs are language‑agnostic and easier for external consumers to adopt【2】. Technical differences (transport, IDL, typing, languages) Transport and serialization: gRPC uses HTTP/2 and binary protobuf serialization, giving multiplexing, low overhead, and streaming semantics (client, server, bidirectional)【1】【5】. tRPC typically runs over HTTP/1.1 or WebSocket using JSON (or JSON-like payloads) and depends on the HTTP framework in use (Next.js, Express, etc.)【1】【3】. oRPC commonly exposes RPC endpoints but also generates OpenAPI which can be served as JSON/HTTP REST—transport depends on implementation and hosting, but it prioritizes interoperable JSON/HTTP for external clients【2】. Interface definition and typing: gRPC: explicit IDL via .proto files (Protocol Buffers). Strongly typed across languages, code‑generation required for clients and servers【1】【5】. tRPC: no separate IDL—types flow from server code to TypeScript clients via compile‑time inference (no protobufs, no generated clients)【1】【3】. oRPC: retains TypeScript‑first typing but generates OpenAPI (a machine‑readable contract) so other languages/tools can consume your API【2】. Language ecosystem: gRPC supports many languages (Go, Java, Python, C++, Node, etc.) because of its protobuf IDL and codegen【5】. tRPC and oRPC are TypeScript/JavaScript centric; oRPC bridges the gap for non‑TypeScript consumers by exporting OpenAPI specs【2】【1】. Streaming and advanced RPC features: gRPC supports streaming natively and is designed for streaming and low-latency interservice communication【1】【5】. tRPC mainly targets request/response and real‑time via WebSockets or libraries layered on top; it’s not a drop‑in for gRPC streaming semantics【1】. oRPC focuses on interoperability and type safety rather than replacing streaming semantics; streaming support depends on the specific implementation choices【2】. When to choose each (practical guidance) ...