Getting data based on location and a specified radius

Scenario: I have a large dataset, with each entry containing a location (x,y - coordinates). I want to be able to request every entry from this dataset that is within 100m within this dataset and have it returned as an array.

How does one go about implementing something like this? Are there any patterns or framework that recommended? I've previously only worked with relational or simple key-value type data.

The data structure that solves this problem efficiently is a k-d tree. There are many implementations available, including a node.js module.

Put your data set into PostgreSQL and use an R-Tree index. You can then do a bounding box query to get all points with +-100 miles of any locations. Then calculate the radial distance and accept points within 100 miles. You can roll your own schema and queries or use PostGIS.

Unlike R-Trees KD-trees are not inherently balanced. So depending on how a KD-Tree is built you can get inconsistent performance due to unbalanced trees and the longest path.