what is the best way to store a lot of markers in database?

I want to create a web site using google maps, php, mysql and javascript where users can leave a marker on a map with message so that another users will be able to see thismarker on their map. And all of this in a real time.

I suppose that amount of markers will be huge, so i decided to store markers in database using tiles:

  • Architecture recommendations & guidelines for a Node.js web application?
  • How to update local parse.com database incrementally?
  • How to represent complex and hybrid data
  • What is the best way to store a field that supports markdown in my database when I need to render both HTML and “simple text” views?
  • Accessing an associated table from a Sequelize getter method
  • Relational database design to mongoDB/mongoose design
  • You can see picture explaining this over here

    Google Maps Server-side Clustering with Asp.net C#

    http://www.soak.co.uk/blog/server-side-map-marker-clustering/

    So for example, at the beginning the coordinates of client viewport are determined and the tiles to be loaded from the server are calculated, after that the server determine the markers that are whithin the requested tiles and sends them to the client.

    My question is what is the best way to organise the database that will store markers by tiles?

    Can smn show an example or there is already a standart solution to this problem?

  • Devising a test for a Web Developer
  • Use Javascript to Extract Data in Given Format
  • Storing object references in JSON
  • Accessing an associated table from a Sequelize getter method
  • Followers - mongodb database design
  • How to update local parse.com database incrementally?
  • 2 Solutions collect form web for “what is the best way to store a lot of markers in database?”

    I think you are over-complicating this. If the only thing you are storing is the markers (lat & lon), then a single database table will do.

    Something like:

    • id
    • user_id
    • tile_id
    • lat
    • lon
    • message

    If you are planning to work with a large amount of markers, definitely take a look at google fusion tables:

    https://developers.google.com/fusiontables/

    And you can read more about it here:

    https://developers.google.com/maps/articles/toomanymarkers