tachyean
(Ionut Moldoveanu)
octombrie 28, 2014, 6:09pm
1
Salut,
Ce tip de baza de date recomandati pentru query-urile de tip spatial. Care ar fi cea mai rapida pentru a cauta un numar de N puncte de exemplu aflate in jurul unei coordonate pe o raza de X unitati se masura? Ma refer la tipuri de baze de date ce s-ar putea folosii pentru un proiect web.
Sau poate exista servicii pentru asa ceva?
1 Like
Salut,
ElasticSearch. Nu am pus in productie, insa tin minte ca am testat si functiona OK. Cautarile sunt foarte rapide.
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-geo-distance-filter.html
1 Like
iamntz
(Ionuț Staicu)
octombrie 28, 2014, 6:44pm
3
Pentru că a trebuit să caut ce înseamnă query spațial și pentru că sunt sigur că nu sunt singurul care habar n-avea de asta:
A spatial query is a special type of database query supported by geodatabases and spatial databases. The queries differ from non-spatial SQL queries in several important ways. Two of the most important are that they allow for the use of geometry data types such as points, lines and polygons and that these queries consider the spatial relationship between these geometries.
The function names for queries differ across geodatabases. The following list contains commonly used functions built into Pos...
și
A spatial database is a database that is optimized for storing and querying data that represents objects defined in a geometric space. Most spatial databases allow the representation of simple geometric objects such as points, lines and polygons. Some spatial databases handle more complex structures such as 3D objects, topological coverages, linear networks, and TINs. While typical databases have developed to manage various numeric and character types of data, such databases require additional f...
3 Likes
navaru
(Eugen)
octombrie 28, 2014, 7:38pm
4
1 Like
tachyean
(Ionut Moldoveanu)
octombrie 28, 2014, 7:53pm
5
So Elasticsearch, Mongo, Mysql care il recomandati?
Unul dintre ele sau altul?
Recomand ElasticSearch pentru ca am lucrat cu el Nu am lucrat cu Mongo, Eu folosesc atat mysql cat si elasticsearch pentru aceleasi date.
Poti folosi si postgresql - mie unul nu imi place ( no reason for that)
mie imi pare ca trebuie sa suporte db-ul tipul asta de query, mysql si elasticsearch nu stiu sa suporte, do they?
tachyean
(Ionut Moldoveanu)
octombrie 29, 2014, 8:29am
9
De elastic search a dar Catalin un exemplu mai sus cat despre mysql: http://www.percona.com/blog/2013/10/21/using-the-new-spatial-functions-in-mysql-5-6-for-geo-enabled-applications/
Postgis hmm, nu am folosit ever postgre dar asta nu e un motiv de a il exclude
Revin dupa ce mai fac niste research.
pai no. incearca cu mysql mai intai, pare cel mai la indemana. Pt elasticsearch iti trebuie JAVA, serverul nu trebuie sa fie public, e mai complicat.
mysql: sper sa mearga. Cand l-am testat nu stia o gramda de operatii
postgresql: e OK pentru ca folosesti o singura baza de date
elasticsearch: e prea cool ca sa nu il folosesti. Problema poate aparea la sincronizarea datelor, insa nu e nimic de speriat. Poate fi si un server public (ii inchizi portul). Poti face si autentificare cu nginx in fata lui: http://www.elasticsearch.org/blog/playing-http-tricks-nginx/
pghoratiu
(Gabriel Horatiu Petchesi)
octombrie 29, 2014, 10:12am
12
Pentru viteza evita operatiuni de genul
SELECT … ORDER BY DISTANCE(…)
pe un set mare de date deoarece este consumatoare de timp.
O filtrare initiala e necesara pentru a face acest calcul pentru un set restrans de date.
Cateva linkuri utile care mi-au fost de mare folos de pe blogul lui Derick Rethans:
http://derickrethans.nl/spatial-indexes-mysql.html
http://derickrethans.nl/spatial-indexes-solr.html
Personal am folosit mysql fara nici o extensie.
Pentru ce ai tu nevoie cred ca cel mai ok e SOLR + facets pe distanta variabila.
1 Like