title: Are node.js data structures volatile/when to use a database over data structure?
body: <p>I am considering using node.js to build an API like service but am having trouble understanding whether to use a data structure vs. storing information in a database/text file.</p>
  
  <p>Basically the program would allow for a user to come on line and collect that users geo-coded location. Then the service would store that information in either a javascript data structure or store it into a database or text file. Then another user would log on and I would connect them with a user who is closes to them.</p>
  
  <p>My question is, if I have a datastructure (some sort of custom implemented sorted list based off of geo-codes) would all of that information be volatile and I would loose it if the program crashed?  </p>
  
  <p>Would it be more preferable to store the information in a text file or database even though the access and write of that information would take longer?</p>
  
  <p>Also, if I was using the data structure approach, would that make it more difficult to scale the application if I needed to expand to additional servers?</p>
  
  <p>Any thoughts?</p>