Advice on setting up the right data structure

I am building a mobile dapp to automatically track places you visit. I have looked at the blockstack storage tutorial and was wondering whether I should store all visits and location info in one visit.json file like this

“arrivalDate”: 1444766800,
“departureDate”: 1444781724,
“latitude”: 37.76315,
“longitude”: -122.4139,
“createdDate: 14447669800,
“location”: {
“name”: Quickcheck,
“address”: 510 Main Street,
“city”: Sayreville,
“state”: NJ,
“zipcode”: 08872,
“country”: USA

or it is better to split them up into an index file with a list of days and separate files that looks more like this


[with all places visited that day]

[with all places visited that day]

[with all places visited that day]

To give more content the initial UI will display all the places someone visited that day in a list and map and allow them to switch days. But in future releases I want to also do some analytics on the data to provide insights. Such as a weekly, monthly and ongoing summary of the most visited places, or top category of places visited, hours spent at home or at work, etc. In the future I might also want to display the pictures you took at a specific place in the app…

So posting this to get some advice for what my options are and best approach to using blockstack storage.


I would probably keep on list of locations with data that (probably) never changes (locations.json)
and then add e.g. one json per day and one file with all days referencing the day jsons

1 Like

Thanks for the response friedger. I do not understand your answer though. Can you clarify what you mean by ‘add e.g. one json per day and one file with all days referencing the day jsons’. Or better yet give an example.

I think he means something like this:


Those would represent each day’s data. Then you’d have a main index file that looks something like:

  days: [
    date: $date, 
    otherInfo: $otherInfo, 
    linkToDayFile: $link

Ok. Thanks.