Geospatial Indexing with Redis & Sinatra for Facebook App

I am rebuilding Lovers on Facebook with Sinatra and Redis and I want:

  • Establish operations to manage requests and user relationships
  • Geospatial indexing to display neighboring users of the application.

Current Redis Implementation

Each user has two ordered sets of Redis ( reqSentand reqRecv) that store uids. SCOREwhich we order with requests is time(a UNIX timestamp) the request has been made. I use ordered sets instead of lists, because the user can only do. The request type (rid) is encoded as a number and appended to the uid. (rid | uid) For example, for a user with uid = 100 we can have:

100:reqSent => ["1|123", "2|123", "2|134"]  # format: ["rid|tid"]
100:reqRecv => ["3|343", "5|142", "4|2224"] # format: ["rid|uid"]

MongoDB supports geospatial indexing natively, so I'm thinking of switching to this.

Otherwise, how do I implement geospatial indexing using Redis? Should I do this with Sunspot (localsolr)? Apparently you can use Sunspot with Redis .

+3
2

- redis. redis. lat/long , , , , , . , , , , /.

, , redis - ad hoc- .

+6

Redis , , MongoDB . . , , Mongo.

Mongo, Redis . , , - . , , , , . .

, Sunspot, Redis? Solr, ? , Redis, , , MongoDB.

+4

Source: https://habr.com/ru/post/1784313/


All Articles