-
Notifications
You must be signed in to change notification settings - Fork 11
Compression
Paul Stovell edited this page Apr 15, 2020
·
19 revisions
JSON documents can be big! When JSON is stored as text (in an nvarchar(max)
column), Nevermore comes up with different strategies for reading it, based on whether the table always has smaller documents (<1K) or not.
However, Nevermore also supports compressing the JSON. You can use this if you use SQL Server 2016 or higher.
To use compression:
- Change the JSON column type to
varbinary(max)
. (See tips on migrations below). - In your
DocumentMap
, setCompressed
totrue
.
That's it!
When inserting or updating data, Nevermore will use GZIP to write the compressed data to the table. When reading, Nevermore will use GZIP to read it back.
If you are querying in SQL, and want to use JSON_VALUE
for example, you still can. Just call the DECOMPRESS
function in SQL 2016 or newer, and cast it to a string.
select cast(DECOMPRESS([JSON]) as nvarchar(max)) from dbo.BigObjectCompressed
Overview
Getting started
Extensibility
Misc