Which Protocol Should I Use?

HTTP, gRPC, WebSocket, SMTP, DNS — each protocol is optimized for a different communication pattern. This decision tree walks you through the key requirements of your use case to recommend the most appropriate protocol for your application.

Decision Steps

Do you need real-time, bidirectional communication (server can push data to clients at any time)?

Is this for a browser-based application (JavaScript in a browser needs to connect directly)?

Is this a server-to-server or microservice scenario where you control both client and server?

Is your use case about sending or receiving email messages (notifications, newsletters, transactional email)?

Is your use case about resolving domain names to IP addresses or querying DNS records?

Do you need efficient streaming of large data or long-lived request/response streams?

Do you need strongly-typed contracts (Protobuf), built-in load balancing, and high-performance binary transport?

Are you building an internal microservice or RPC API (not a public web API) with strict performance requirements?

Possible Outcomes

200-ok HTTP/REST for web APIs and CRUD
0-ok gRPC for internal microservices and streaming
1000-normal-closure WebSocket for real-time browser apps
421-service-unavailable SMTP for sending and receiving email
0-noerror DNS for hostname/record resolution

Related Status Codes

Related Terms