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

时间:2021-01-04 20:06:20

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.

我正在寻找可以让您向用户交付数据的方法。这可能是从XML到平面文件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 ?

在发布这篇文章之前,我做了一些谷歌搜索,指向SQLite。你对此有何看法?

3 个解决方案

#1


1  

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.

您可能会更好地设置SOAP/XML-RPC服务,并在服务器上运行数据,并在一段时间内将其发送到客户端。这可能是“最快”的方式,因为您不必将大型文件传输到手持设备上。它可能对你不起作用,但值得一提。

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. 考虑到整个文件的大小,例如,尽可能使用尽可能少的元数据描述来传达数据的意义。
  3. 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.
  4. 利用服务器和设备之间的数据的某种类型的压缩(例如gzip)。考虑到侵略性的压缩可能需要更长的时间来解压,并且对不太积极的方法产生相反的效果。
  5. 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.
  6. 考虑到数据将如何从服务器的存储中取出(它在数据库中吗?)能否将数据缓存到传输表单中?)如果设备插入数据所需的时间要比下载到设备所节省的时间长三倍,那么尽量压缩传输速度最终可能会适得其反。
  7. Test. Test. Test.
  8. 测试。测试。测试。

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.

你可以将它作为CSV或json格式的文件,这是极简主义的;他们不使用大量的数据来描述数据。XML不是最快的,因为它通常是非常具有描述性的,但是有其他优点。另一个选项可能是用SQL insert语句发送文本文件。

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.

SQLite是一个在许多移动平台上运行的RDBMS。它有它的局限性,但它可能是你所需要的一切。这是一个不错的选择。

#2


1  

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

如果您希望移动设备对数据(如脱机处理)进行预处理,我认为sql lite是一种解决方案。

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

如果处理过程是在线进行的移动设备最适合显示并且将处于“始终在线”的环境中,那么Web服务将用于请求和处理数据,然后使用后端sql服务器

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

在性能方面,它是这样的:大量的数据=大量的在线流量,所以如果真的有大量的数据,如你所说的行,那么我认为脱机是一种方式,否则通信量只会扼杀性能

#3


1  

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, ..).

如果您正在处理数以百万计的行,并且希望在移动设备上一次显示小样本(几乎不可能),那么您肯定应该在服务器端进行处理,最好使用RDBMS。它们是用来处理数百万行的。Sqlite快速而简单,但在百万分之一的范围内,您最好使用PostgreSQL或商业品牌之一(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.

您可以使用web服务或直接访问数据库,这要视情况而定。您可以在本地进行一些处理,但是必须在服务器上进行行选择。

#1


1  

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.

您可能会更好地设置SOAP/XML-RPC服务,并在服务器上运行数据,并在一段时间内将其发送到客户端。这可能是“最快”的方式,因为您不必将大型文件传输到手持设备上。它可能对你不起作用,但值得一提。

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. 考虑到整个文件的大小,例如,尽可能使用尽可能少的元数据描述来传达数据的意义。
  3. 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.
  4. 利用服务器和设备之间的数据的某种类型的压缩(例如gzip)。考虑到侵略性的压缩可能需要更长的时间来解压,并且对不太积极的方法产生相反的效果。
  5. 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.
  6. 考虑到数据将如何从服务器的存储中取出(它在数据库中吗?)能否将数据缓存到传输表单中?)如果设备插入数据所需的时间要比下载到设备所节省的时间长三倍,那么尽量压缩传输速度最终可能会适得其反。
  7. Test. Test. Test.
  8. 测试。测试。测试。

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.

你可以将它作为CSV或json格式的文件,这是极简主义的;他们不使用大量的数据来描述数据。XML不是最快的,因为它通常是非常具有描述性的,但是有其他优点。另一个选项可能是用SQL insert语句发送文本文件。

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.

SQLite是一个在许多移动平台上运行的RDBMS。它有它的局限性,但它可能是你所需要的一切。这是一个不错的选择。

#2


1  

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

如果您希望移动设备对数据(如脱机处理)进行预处理,我认为sql lite是一种解决方案。

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

如果处理过程是在线进行的移动设备最适合显示并且将处于“始终在线”的环境中,那么Web服务将用于请求和处理数据,然后使用后端sql服务器

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

在性能方面,它是这样的:大量的数据=大量的在线流量,所以如果真的有大量的数据,如你所说的行,那么我认为脱机是一种方式,否则通信量只会扼杀性能

#3


1  

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, ..).

如果您正在处理数以百万计的行,并且希望在移动设备上一次显示小样本(几乎不可能),那么您肯定应该在服务器端进行处理,最好使用RDBMS。它们是用来处理数百万行的。Sqlite快速而简单,但在百万分之一的范围内,您最好使用PostgreSQL或商业品牌之一(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.

您可以使用web服务或直接访问数据库,这要视情况而定。您可以在本地进行一些处理,但是必须在服务器上进行行选择。