Python Forum
Database that can compress a column, or all data, automatically?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database that can compress a column, or all data, automatically?
#1
I have a Sqlite3 database that I use to store testing data. Most of the columns are small but one column can be HUGE as it stores the JSON results from our test. This column can be up to 500KB is size, with the average being around 62KB. My database is about. My file is about 80MB after about a months usage.

I've done some testing using ZLIB to compress the data in that large column and I can get a 500% compression ratio using it. That means my current database would go from 80 MB to 16MB, which is a great savings in disk space.

What I want to know is, are there are any databases available to python that you can specify to compress a column, or that does data compression, in the background?
Reply
#2
I believe SQL Server can store data compressed, but I have no experience with it.
But why don't you just compress the JSON with the gzip or zlib modules and then store it in your database? Of course you wil have to store the compressed data in a BLOB-type column.
Reply
#3
also, you can vaccum the database to get rid of 'dust'.
Reply
#4
(May-16-2023, 07:54 AM)ibreeden Wrote: I believe SQL Server can store data compressed, but I have no experience with it.
But why don't you just compress the JSON with the gzip or zlib modules and then store it in your database? Of course you wil have to store the compressed data in a BLOB-type column.
I think going to the trouble of maintaining a MS database is overkill for our project.

I will most likely compress the JSON before storing it to the database. I just didn't want to re-invent the wheel if there was something out there already.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Returning Column and Row Data From Spreadsheet knight2000 0 449 Oct-22-2023, 07:07 AM
Last Post: knight2000
  How to detect abnormal data in big database python vanphuht91 5 1,152 Jun-27-2023, 11:22 PM
Last Post: Skaperen
  Code for pullng all data in a column EmBeck87 5 1,119 Apr-03-2023, 03:43 PM
Last Post: deanhystad
  Basic SQL query using Py: Inserting or querying sqlite3 database not returning data marlonbown 3 1,392 Nov-08-2022, 07:16 PM
Last Post: marlonbown
  split txt file data on the first column value shantanu97 2 2,447 Dec-29-2021, 05:03 PM
Last Post: DeaD_EyE
  Retrieving a column from a data set using a function Bayle 6 2,361 Oct-06-2021, 08:52 PM
Last Post: Bayle
  I need help parsing through data and creating a database using beautiful soup username369 1 1,718 Sep-22-2021, 08:45 PM
Last Post: Larz60+
  Python Pandas: How do I extract all the >1000 data from a certain column? JaneTan 0 1,569 Jul-17-2021, 09:09 AM
Last Post: JaneTan
  SaltStack: MySQL returner save less data into Database table columns xtc14 2 2,183 Jul-02-2021, 02:19 PM
Last Post: xtc14
  How to filter out Column data From Multiple rows data? firaki12345 10 5,144 Feb-06-2021, 04:54 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020