SShortSingh.
Back to feed

How Google's Protocol Buffers Cuts Payload Size and Latency in Microservices

0
·3 views

Protocol Buffers (protobuf) is a language-agnostic binary serialization format originally developed by Google, now widely used in infrastructure tools such as gRPC, Kubernetes, and Cloud Spanner. Unlike JSON or XML, protobuf uses a separate schema definition file and compiles it into strongly typed code, enabling backward-compatible API evolution without breaking existing services. The format delivers roughly 3–10 times smaller payload sizes and significantly lower deserialization latency compared to text-based alternatives. In one fintech deployment processing millions of daily transactions, adopting protobuf reduced bandwidth consumption by 35% and improved P99 latency by 240 milliseconds. Protobuf integrates natively with streaming and batch systems like Kafka, Apache Beam, and Spark, and serves as the foundation of gRPC's HTTP/2-based communication layer.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Developer releases 425-byte library to parse partial JSON from streaming LLMs

A developer building an LLM-powered recipe app found that JSON.parse fails on every incomplete token during streaming, since valid JSON only exists once the final closing bracket arrives. To solve this without discarding streaming benefits or relying on fragile regex hacks, they built a minimal open-source library called SoFar. The library exposes two functions — parsePartialJSON and createJSONStream — that return the best structurally complete value available from any partial JSON buffer without throwing errors or guessing incomplete values. It works by scanning the buffer once, tracking open containers and string state, and identifying safe cut points where valid JSON can be reconstructed by appending the necessary closing brackets. At 425 bytes gzipped and zero dependencies, it is designed as a thin complement to the native JSON.parse rather than a replacement.

0
ProgrammingDEV Community ·

Hidden AI Reasoning Tokens Drive Unexpected Billing Costs for Developers

Companies using AI inference services are facing significant billing surprises due to hidden reasoning tokens that are charged as output but not visible during usage. A 2025 study found that these concealed tokens can account for over 90% of total token spend on complex tasks, with a seemingly simple response potentially hiding more than 10,000 reasoning tokens. The problem is expected to grow as Goldman Sachs projects global token usage to reach 120 quadrillion per month by 2030, a 24-fold increase. In response, the Linux Foundation has proposed a Tokenomics Foundation to establish open, vendor-neutral token measurement standards, while providers like Groq and Cerebras have moved toward flat per-token pricing models. Developers are increasingly demanding greater transparency in token accounting as AI costs shift from minor line items to significant operational expenses.

0
ProgrammingDEV Community ·

Security Audit Flags 11 Vulnerabilities in Aave V3, Rates Risk 7.4 out of 10

A security audit of Aave V3, the decentralized lending protocol with approximately $17.7 billion in total value locked, identified 11 vulnerabilities across reentrancy and access-control domains, with three rated Critical. The review, dated September 2026, found improperly guarded external calls in flash-loan and collateral-withdrawal paths, as well as overly broad admin role assignments in the upgrade proxy. Auditors warned that a successful reentrancy exploit on the flash-loan entry point could theoretically allow an attacker to drain up to $1.2 billion before liquidation mechanisms respond. None of the vulnerabilities are currently exploitable on the live mainnet, as existing safeguards such as reentrancy guards and multi-signature governance provide interim protection. However, the audit stresses that any future upgrade or misconfiguration removing those defenses could expose the protocol to significant risk, making prompt remediation essential.