压缩文本,然后存储在mysql数据库中 [英] compress text before storing in mysql database

查看:923
本文介绍了压缩文本,然后存储在mysql数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用php和MySQL开发一个web应用程序。我使用gzcompress()php函数压缩文本,然后存储在MySQL数据库/在数据库中存储压缩形式的文本。我的问题是这是好吗?存储压缩形式?或者这种方法会为我创造麻烦或不是吗?我正在压缩文本以节省磁盘空间。

I am developing a web application using php and MySQL. I am compressing the text using gzcompress() php function before storing in MySQL database / storing compressed form of text in database. My Question is that is this OK? to store compressed form? Or this method will create trouble or not for me? I am compressing text for saving disk space.

推荐答案

我真的没有看到存储压缩文本的任何实际好处。当然,你可能节省一些空间,但如果你的文本是如此之大,以便从压缩它获得实际的好处,我认为你需要更多地担心你的服务器的CPU有压缩/解压缩的巨大文本,每当访问者访问页面(更不用说可搜索的文本意味着您必须将其解压缩才能搜索)。

I honestly don't see any practical benefits of storing compressed texts. Sure you could probably save some space, but if your text is so big that you get a practical benefit out of compressing it, I think you need to worry more about your server's CPU having to compress / uncompress the humongous text whenever a visitor visits your pages (and not to mention searchable text means you gotta uncompress it to search).

这篇关于压缩文本,然后存储在mysql数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆