46°F

Aaron Parecki

  • Articles
  • Notes
  • Photos
  • Why not JSON?

    January 22, 2015

    People often wonder why I am hesitant to bake JSON into specs I write such as IndieAuth and Micropub. Here is the short answer.

    While JSON is currently a well-accepted data serialization format, so was XML in its time. Do you really want to be using a spec that forces you to use JSON in 10 years when there is some other new hotness? If you're skeptical that anything could ever replace JSON, keep in mind that many people felt the same about XML back in the day.

    Take a look at a Google search for "alternatives to JSON", and you'll find at least half a dozen implemented alternatives and proposed new specs.

    msgpack

    msgpack.org

    MessagePack is an efficient binary serialization format. It lets you exchange data among multiple languages like JSON. But it's faster and smaller.

    TOML

    www.drdobbs.com/web-development/after-xml-json-then-what/240151851

    Frustration with JSON has spurred examination and proposal of entirely new schemes. Perhaps one of the most interesting is TOML from Tom Preston-Werner, a cofounder of GitHub.

    Cap'n Proto - Encoding/Decoding Speed

    capnproto.org/

    Cap'n Proto is an insanely fast data interchange format and capability-based RPC system. Think JSON, except binary.

    Protocol Buffers - Schemas

    developers.google.com/protocol-buffers/docs/overview

    There is a certain painful irony to the fact that we carefully craft our data models inside our databases, maintain layers of code to keep these data models in check, and then allow all of that forethought to fly out the window when we want to send that data over the wire to another service.

    blog.codeclimate.com/blog/2014/06/05/choose-protocol-buffers/

    Bandwidth Concern

    blog.gradientstudios.com/2012/08/15/cutting-down-bandwith-with-json-alternatives/

    Cutting Down Bandwidth with JSON Alternatives

    JSON Extensions

    blogs.perl.org/users/steven_haryanto/2013/10/json-and-alternatives-and-an-extension-proposal.html

    The problem with JSON is that it's too simple. It lacks features. Yesterday while working on an API that is supposed to return PNG images, I was again reminded by the fact that JSON does not handle binary data. Let's see what else JSON does not support: Inf & NaN, differentiating normal hashes vs objects, Regexps, circular references, ... (some people might want to add comments and trailing commas to that list).

    So go ahead and design your standards with JSON, and come back in 10 years and see how the standard feels.

    Thu, Jan 22, 2015 12:09pm -08:00 #data #json #indieweb #xml
    4 mentions

    Other Mentions

    • Dawn. A. Alderson twitter.com/dawn_alderson
      another Tortoise and the Hare situ: Why must ti be JSON? RE: today's DDOSaaronparecki.com/2015/01/22/8/w…
      Fri, Oct 21, 2016 8:49pm +00:00 (via brid-gy.appspot.com)
    • Ben Roberts Ben Roberts ben.thatmustbe.me
      Hey #indieweb, the coming storm of webmention Spam may not be far away. Those of us that have input fields to send send webmentions manually may already be getting them. Look at the mentions on http://aaronparecki.com/articles/2015/01/22/1/why-not-json
      Sat, Jan 31, 2015 9:07am -05:00
    • Offer Your blog.offeryour.com/?author=1
      1p – Why not JSON? Links 31st January 2015 - ...
      Fri, Jan 30, 2015 4:22pm -08:00
    • ExplodingAds.com blog.explodingads.com/?author=1
      1p – Why not JSON? Startup News 31st January 2015 - ...
      Fri, Jan 30, 2015 4:19pm -08:00
Posted in /articles

Hi, I'm Aaron Parecki, Director of Identity Standards at Okta, and co-founder of IndieWebCamp. I maintain oauth.net, write and consult about OAuth, and participate in the OAuth Working Group at the IETF. I also help people learn about video production and livestreaming. (detailed bio)

I've been tracking my location since 2008 and I wrote 100 songs in 100 days. I've spoken at conferences around the world about owning your data, OAuth, quantified self, and explained why R is a vowel. Read more.

  • Director of Identity Standards at Okta
  • IndieWebCamp Founder
  • OAuth WG Editor
  • OpenID Board Member

  • 🎥 YouTube Tutorials and Reviews
  • 🏠 We're building a triplex!
  • ⭐️ Life Stack
  • ⚙️ Home Automation
  • All
  • Articles
  • Bookmarks
  • Notes
  • Photos
  • Replies
  • Reviews
  • Trips
  • Videos
  • Contact
© 1999-2025 by Aaron Parecki. Powered by p3k. This site supports Webmention.
Except where otherwise noted, text content on this site is licensed under a Creative Commons Attribution 3.0 License.
IndieWebCamp Microformats Webmention W3C HTML5 Creative Commons
WeChat ID
aaronpk_tv