压缩数据库中的数据
快速提问,鉴于我到目前为止在谷歌上(缺乏)发现,这可能是一个愚蠢的问题。
我有一个数据库。 该数据库中有一个包含一些数据的表。 数据是一个大的 BLOB,但无法压缩(由于我无法控制的原因)。
我有一个与该数据库通信的应用程序。 我真的希望能够确保数据在传输过程中被压缩。
据我了解,数据库提供程序将处理压缩等。
是这种情况吗? 常见的设置(例如 SQL Server)是否有启用压缩的设置?
Quick q, could be a silly one given my (lack of) findings on Google so far.
I have a Database. In this database is a Table with some Data. The Data is a large BLOB but can't be compressed (for reasons out of my control).
I have an Application that talks to this Database. I would really like to be able to ensure that the Data is compressed during transit.
As I understand it, the Database Provider would handle compression etc.
Is this the case? Are there settings on common ones, say SQL Server to enable compression?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对于 SQL Server,我找到了此“连接”条目,但没有:我认为 TDS 目前没有被压缩。 您可以(尽管我不太喜欢)使用 SQL-CLR 在 .NET 代码中压缩它,但它可能会产生太多开销。
我知道在这种情况下(从问题中)这不是一个选项,但通常最好以您想要的方式存储 BLOB。 因此,如果您想压缩它们,请将它们压缩存储。 SQL 不是操作二进制的好工具;-p 这样的策略还意味着您没有使用特定于供应商的功能 - 只是存储不透明 BLOB 的能力。
For SQL Server, I found this "connect" entry, but no: I don't think TDS is currently compressed. You could (although I don't like it much) use SQL-CLR to compress it in .NET code, but it could have too much overhead.
I know it isn't an option in this case (from the question), but it is usually preferable to store BLOBs the way you want to get them. So if you want to get them compressed, store them compressed. SQL isn't a good tool for manipulating binary ;-p Such a strategy also means that you aren't using vendor-specific features - just the ability to store an opaque BLOB.
如果您的数据库访问层不提供压缩,您可以在数据库服务器和应用程序主机之间设置 VPN 链接。 最重要的 VPN 解决方案会压缩传输中的数据。 OpenVPN 是一个简单且易于设置的解决方案,用于快速创建隧道。 数据在传输过程中被压缩。 可能不会像本机压缩那样有效,但它是一个可能的解决方案。 并且您可以免费获得加密:)。
If your database access layer does not provide compression, you can set up a VPN link between the database server and the application host. Most serious VPN solutions compress data in transit. OpenVPN is a simple and easy to set up solution for quickly creating a tunnel. Data is compressed in transit. Probably won't be as efficient as a native compression, but it's a possible solution. And you get encryption thrown in for free :).
SQL Server 2008 是第一个原生支持备份压缩的 SQL Server 版本。 2008 年之前,您需要使用第三方产品来完成此操作。
SQL Server 2008 is the first version of SQL Server to natively support compression of backups. Pre 2008, you need to do it with third party products.