Skip to Content
数据压缩入门
book

数据压缩入门

by Colt McAnlis, Aleks Haecky
April 2020
Intermediate to advanced
210 pages
4h 47m
Chinese
Posts & Telecom Press
Content preview from 数据压缩入门
162
|
第
13
章
13.1
 了解常见的使用场景
清楚地了解序列化内容是怎样使用的很重要,因为这会对你决定如何压缩数据产生很大影
响。我们下面来看看序列化数据最常见的使用场景。
13.1.1
 服务器动态生成的数据
这是现代移动应用程序中最常见的序列化数据类型。客户端通常会向服务器发出查询请
求,可能请求的是数据库操作的结果,服务器计算出结果,将其内容序列化后再发送给客
户端,由客户端进行反序列化。在这个过程中,
HTTP
协议栈通常会对序列化数据进行进
一步的压缩(例如使用
GZIP
),从而使文件变得更小。考虑到节省的空间相当可观,因此
客户端付出的解压时间开销是值得的。
13.1.2
 服务器拥有的静态数据
虽然动态生成的数据很常见,但是应用程序同样也有静态的序列化内容,例如,向客户端
发送最新的配置文件。开发者会在服务器上不定期地更新这些文件,而且通常是离线进行
的。这样,服务器就可以认为这些文件是静态的,并在客户端请求时将其发送过去。同
样,这些文件也会被
HTTP
协议栈进一步压缩。
13.1.3
 客户端动态生成的数据
在很多情况下,客户端也会向服务器发送信息,其中就有客户端本身生成序列化信息的情
形。这就意味着序列化操作以及数据压缩过程的所有开销都完全由客户端设备来承担。对
便携式计算机或台式计算机来说,这可能不是问题,但对移动电话、平板计算机和可穿戴
设备来说,久而久之可能就会造成大麻烦。此外,由于这些设备往往电量有限,因此一般
不倾向于将客户端的资源花在要上传的数据的压缩上。这就形成了一种独特的平衡行为,
即开发人员需要解决他的应用程序面临的此类问题。 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

人工智能技术与大数据

人工智能技术与大数据

Posts & Telecom Press, Anand Deshpande, Manish Kumar
解密金融数据

解密金融数据

Justin Pauley
神经网络算法与Java编程

神经网络算法与Java编程

Posts & Telecom Press, Fabio M. Soares, Alan M. F. Souza

Publisher Resources

ISBN: 9787115534170