如何在数据库中存储8000亿个GPS标记 [英] How to store 800 billion GPS markers in database

查看:357
本文介绍了如何在数据库中存储8000亿个GPS标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要存储用户记录到数据库的GPS轨迹。轨道将由每5米运动一个标记组成,用于在地图上绘制线条。我估计200公里的轨道,这意味着40,000 lnlt标记。我估计每个用户最少50,000用户和20条200公里的轨道。这意味着至少400亿lnlt标记。

I need to store GPS tracks that users record into a database. The tracks will consist of a marker every 5 meter of movement for the purpose of drawing a line on a map. I am estimating 200 km tracks which means 40,000 lnlt markers. I estimate 50,000 users minimum and 20 pieces of 200 km tracks for each. That means at least 40 billion lnlt markers.

这还需要扩展,因此对于100万用户,我需要80000万个GPS标记的容量。

This needs to scale too, so for 1 million users I need capacity for 800 billion GPS markers.

因为每组40,000个标记属于单个轨道,所以我们谈论1到20百万记录/组的GPS轨迹。

Since each set of 40,000 markers belong to a single track, we are talking 1 - 20 million records/sets of GPS tracks.

要求:
用户将请求在移动应用程序中的Google地图顶部查看这些轨道。

Requirements: Users will request to view these tracks on top of a Google map in a mobile application.

关系:
我目前有2个表。表一具有:[trackid],[userid],[comment],[distance],[time],[top speed]。

Relations: I currently have 2 tables. Table one has:[trackid], [userid], [comment], [distance], [time], [top speed].

表2有[trackid] [经度] [纬度],这是所有GPS标记都存储的地方。

Table 2 has [trackid] [longitude] [latitude] and this is where all GPS markers are stored. What is an efficient way of storing this volume of GPS data while maintaining read performance?

新信息:

将GPS数据存储在KML文件中,以便将其显示为Google地图顶部的轨道,这是节省数据库空间的一个很好的解决方案。将KML压缩为KMZ(基本上是带有KMZ扩展名的压缩KML)大大降低了文件大小。 KMZ加载速度比GPX快得多,并且可以作为KML图层与Google Maps API集成。 从Google查看此信息,以获取进一步的帮助。

Storing the GPS data in a KML file for the purpose of displaying them as a track on top of a Google map is a good solution that saves database space. Compressing the KML into a KMZ (basically a zipped KML wit a KMZ extension) greatly reduces file size further. KMZ loads much quicker than GPX and can be integrated with the Google Maps API as a KML layer. See this information from Google for further assistance. This seems to be the best solution so far for the intended requirement.

推荐答案

一直以来,特定数据库的选择是绑定到你想要如何存储信息和如何使用它。因此,在不知道项目的确切需求以及数据的关系的情况下,最好的做法是对主题做一些阅读,以确定什么特定的产品或存储模型最适合

The choice of a particular database, as always, is tied to how you want to store the information and how you want to use it. As such, without knowing the exact requirements of your project, as well as the relationships of the data, the best thing to do would be to do some reading on the topic to determine what particular product or storage model is best suited to you.

一个好的开始是阅读比较数据库的性能和用途的博客(见附件):

A good place to start is reading blogs that compare the performance and uses of the databases (see attached):

http://kkovacs.eu/cassandra -vs-mongodb-vs-couchdb-vs-redis

这篇关于如何在数据库中存储8000亿个GPS标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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