TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: JSON-schema or protobuf?

1 pointsby sourabh86almost 9 years ago
We have been using JSON for our REST APIs and JSON-schema (json-schema.org) to define the data format. We have java and .net generators to create POJO and POCO classes from JSON-schema. Recently, I got to know about Protocol Buffers from Google and was wondering what are the benefits of it over JSON. A simple Google search did not give any satisfactory answer. Hoping to get some insight from people who have used both, better if moved from one to another.

2 comments

PaulHoulealmost 9 years ago
The main benefit of protobufs is performance. It definitely is CPU intensive to write and consume JSON documents.<p>From a software engineering perspective they seem pretty similar to me, particularly in that NEITHER has support for a fixed decimal format which is essential for doing money calculations and getting the right answers.
msoadalmost 9 years ago
Swagger uses json schema. If you want to get free documentation it makes sense to use json schema and quickly put together a swagger description of your api to get free docs for your api. You will also get a lot of good tooling around your api