向移动设备传输数据最轻/最快的方式是什么?

发布于 2024-12-09 01:53:13 字数 187 浏览 0 评论 0原文

我正在寻找可以将数据传递给用户的方法。这可能是从 XML 到平面文件数据库再到关系数据库。

该数据库将保存在服务器中,并将根据请求为手持设备、智能手机和平板电脑提供服务。我主要关心的是显示数百万行所请求信息的速度以及如何轻松更新数据。

在发布本文之前,我进行了一些 Google 搜索,将我引向了 SQLite。您对此有何看法?

I am looking for methods that let you deliver data to a user. This may be from XML to a flat-file DB to a relational DB.

This DB will be saved in a server and will serve handheld devices, smartphones and tablets on request. My main concern is the speed of displaying the requested info over millions of rows and how the data can be easily updated.

Before posting this, I made some Google searches pointing me to SQLite. What is your opinion about this ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

来日方长 2024-12-16 01:53:13

您可能最好设置 SOAP/XML-RPC 服务并在服务器上处理数据并将其一次发送到客户端,同时进行缓存。这可能是“最快”的方式,因为您不必将大文件传输到手持设备。它可能不适合你,但值得一提。

这本质上只是一个文件下载,由传输格式的输出和移动设备数据存储的输入组成。我想你正在描述类似字典的东西,相当静态的东西。

您想要实现的方法需要:

  1. 考虑总体文件大小,即,利用尽可能少的元描述来传达数据的意义。
  2. 在服务器和设备之间使用某种类型的数据压缩(例如 gzip)。请考虑,激进的压缩可能会在设备上花费更长的时间来解压缩,并且与速度明显更快的不太激进的方法产生反作用。
  3. 考虑数据如何从服务器的存储(是否在数据库中?可以将数据缓存到传输形式吗?)进入设备的数据存储系统(即 SQLite)。如果设备插入数据的时间比下载到设备所节省的时间长三倍,那么不遗余力地显着压缩传输速度最终可能会适得其反。
  4. 测试。测试。测试。

您可以将其作为 CSV 或 JSON 格式的文件,这非常简约;他们不会使用大量数据来描述数据。 XML 并不是最快的,因为它通常具有很强的描述性,但它还有其他优点。另一种选择是发送包含 SQL 插入语句的文本文件。

当然,另一个“选择”可能是使用更新机制并将其作为“更新”推出。我对此的想法是,许多使用移动设备的人都知道更新非常耗时并且下载量通常很大,因此他们在执行此操作时会连接到计算机。这只是一个想法;我不确定这是否真的会更好,但我想我会把它扔掉。

SQLite 是一种在许多移动平台上运行的 RDBMS。它有其局限性,但它可能是您必须处理的全部内容。这是一个不错的选择。

You would probably be better off setting up a SOAP/XML-RPC service and working the data on the server and sending it to the client pieces at a time, caching as you go. This is going to be potentially the "fastest" way, since you don't have to transmit a large file to a handheld. It may not work for you, but it's worth mentioning.

This is essentially just a file download bracketed by an output to a transport format and an input to the mobile device's datastore. I imagine you're describing something like a dictionary, something that is fairly static.

The approach you're going to want to achieve will need to:

  1. Take into account overall file size, ie, utilize as little meta description as you can get away with to communicate the data's meaningfulness.
  2. Utilize some type of compression (gzip, for instance) of the data between the server and device. Consider that aggressive compression may take longer on the device to uncompress and be counter-productive to a less aggressive approach that's significantly faster.
  3. Take into account how the data will get out of your server's storage (Is it in a database? Can you cache the data into the transport form?) into the device's data storage system (ie, SQLite). Going out of your way to compress the transfer speed significantly may in the end be counter-productive if the device has to work three times longer to insert the data than the time that was saved in downloading to the device.
  4. Test. Test. Test.

You could serve it as a CSV or JSON-formatted file, which are very minimalistic; they don't use a lot of data to describe the data. XML is not the fastest because it is generally very descriptive, but has other advantages. Another option may be send a text file with the SQL insert statements.

Another "option", of course, may be to use the update mechanism and push it out as an "update". My thought on this is that many people with mobile devices know updates are time consuming and are often very large downloads, so they connect to their computer when doing so. This is just a thought; I'm not sure if this would actually be any better, but thought I'd throw it out there.

SQLite is an RDBMS that runs on many mobile platforms. It has it's limitations, but it may be all you have to work with. It's a good option.

生生漫 2024-12-16 01:53:13

如果您希望移动设备对数据执行操作(例如离线处理),我认为 sql lite 是最佳选择。

如果处理无论如何都会在线进行,并且移动设备最适合显示并且处于“始终”在线的环境中,那么用于请求和处理数据的 Web 服务以及后端 sql 服务器将是最佳选择

泪流满面的表演是这样的:
大量数据 = 大量在线流量,因此,如果确实有大量数据,如您所说的数百万行,那么我认为离线是正确的选择,否则流量只会破坏性能

if you want the mobile devices to preform actions on the data(like offline processing) I think sql lite is the way to go.

if the processing gonna happen online anyway and the mobile device would be most for displaying and will be in an environment where you are "always" online then Web services for requesting and processing the data and then a backend sql server would be the way to go

In tearms of preformance it is like this:
alot of data = alot of online traffic so if really alot of data like you said milions of rows then I think offline is the way to go otherwise the traffic would just kill the preformance

末が日狂欢 2024-12-16 01:53:13

如果您正在处理数百万行,并且希望在移动设备上一次显示小样本(其他方法几乎不可能),那么您绝对应该在服务器端进行处理,最好使用 RDBMS。这些是为了处理数百万行而设计的。 Sqlite 快速且简单,但在数百万行范围内,您最好使用 PostgreSQL 或商业品牌之一(Oracle、MS SQL Server,..)。

您可以使用 Web 服务或直接访问数据库,具体取决于情况。您可以在本地进行一些处理,但行的选择必须在服务器上进行。

If you are dealing with millions of rows and you want to display small samples at a time (anything else is hardly possible) on mobile devices, you should definitely do the processing at the server side, best using an RDBMS. Those are made for handling millions of rows. Sqlite is fast and simple, but in the millions-of-rows-range you'd better reach for PostgreSQL or one of the commercial brands (Oracle, MS SQL server, ..).

You can use a web service or direct access to the database, that depends. You can do some processing locally, but the selection of rows has to happen at the server.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文