# Designing a location based database

* &#x20;Use : pincode and zipcode to mark places
* Scalability and Uniformity
* Measurable Distance and Proximity

### **Storing it in Database**

* &#x20;Longitude and Langitude
* Use 64 Bit datatype  ( 32 bit for the x axis and 32 bit for the Y axis )

### For Seaching for Coordinates in 2D Plane (Difficult)

* &#x20;Quad tree Algo (similar to like binary tree  but have two dimmensions  )

### For Seaching for Coordinates in 1D Plane (Easy)

* Convert 2D Plane to 1D plane to solve it like a Interval tree or segment tree
* Convert 2D to 1D using concept called fractals
* Draw hilbert curve&#x20;
