JSON Has a Cost

JSON seems to be everywhere these days. Many application developers like it across all sorts of languages, C#, JAVA, Python, and more. They use it for transferring information between systems, and are comfortable serializing hierarchical object data into JSON from text and de-serializing it back into its various elements.

For those of us working in relational databases, JSON seems like a blob of information that isn’t easily queried, indexed, or stored. We prefer working with a relational set of data, which brings us into conflict with software developers. We’d like them to convert their objects to a relational structure, and they’d like us to just work with JSON.

SQL Server has added new JSON functions in SQL Server 2025, expanding the JSON capabilities from previous versions. PostgreSQL has JSON types for a few versions, as has Oracle. Lots of applications are storing JSON data in databases. Unlike XML, however, JSON seems to be working well (overall) as a data storage mechanism.

Or is it?

At a recent conference, one of the speakers noted that we do a lot of data movement these days, and there can be a high cost to this as we pay for both compute and network. This data movement often incurs a query cost to get information from the source system. JSON can exacerbate this issue as we may send more data than necessary, and we might find our compute engines don’t support predicate pushdown. Even if we index the JSON, we might still end up querying more data from disks to get what we need. Especially as we move a lot of data to warehouses and lakehouses.

Using JSON can slow things down. It’s nice for storing a bunch of information quickly and easily, but as we need to work with specific parts of a JSON document, we would likely be better off de-serializing the important pieces into more structured formats that prevent duplication, are easily indexed, and can achieve quick query performance. Everything becomes a little smoother.

JSON is great, and I do like it, but it’s not a substitute for relational systems and relational models.

Steve Jones

Listen to the podcast at Libsyn, Spotify, or iTunes.

Note, podcasts are only available for a limited time online.

Unknown's avatar

About way0utwest

Editor, SQLServerCentral
This entry was posted in Editorial and tagged , . Bookmark the permalink.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.