How to store GPS coordinates in a PHP web application?

Asked

Viewed 1,032 times

-1

I am making a web application that will monitor the displacement of individuals through receiving every 5 seconds of GPS coordinates.

I can receive the coordinates and plot on the screen with the Google Maps API, however, I need a way to store the data for audit, to later verify the path traveled in a certain period of time.

Initially I thought about Mysql, but this seems a bit expensive, by default, I calculate 1Gb per device, annually.

I’ve also been reading about file-oriented solutions like Mongodb, Cassandra and Hypertable. I even considered XML file storage, with rotation and backup in compressed files.

  • Have you thought of any kind of compaction or overriding repeated coordinates? Could put a sample of coordinates and the fields you would need to save?

  • I don’t see any problem using Mysql for this solution. I have databases that hold 10 or 20 GB a day and work well.

  • Perhaps it would be better for you to send in small intervals (10s) only when the difference passed a certain limit, and when they were coordinates within a predefined radius of the one sent last, send in a longer interval (30s, for example). And yet, in the second case, it would even be to check if the signal is alive only, because you instead of storing again, would only update the date/time in DB.

2 answers

0

looks like a really cool project, I would use a faster database, type sqlite, the database could be on a server with I/O ssd drive high and then makes an api to insert and fetch records from that server, to power your application.

would also make a way to have different sqlite databases for each device, and would store the access data(address) of the sqlite in any database, whether mysql or postgres.

to do a lot of things, to form several different, this was the idea I had, good luck

0

Interesting project model, I believe mysql would not have problems in saving this amount of data, but a Nosql database I believe would be a more appropriate solution!

Also review this interval of 5 seconds to send the coordinates, what kind of communication? 3G? SMS? Radio?

Unfortunately the infrastructure of our country mainly with internet is still precarious, remember that it will not always have a good signal, and maybe the time of receiving your messages by the service can take more than 5 seconds, queuing and hindering the reception process!

All this is clear, depending on the type of communication you are using, and what the real need is to have this data every 5 seconds. I did something like, it worked and it filled every need with a 30-second interval.

Big hug

Browser other questions tagged

You are not signed in. Login or sign up in order to post.