Static static static
When I first made a tentative foray into web development a few years ago, I did so with the help of this great book from O’Reilly. It had flying squirrels on the cover, and provided a very gentle introduction to the world of dynamic websites.
I did get it set up, and things were great until Amazon decided to start charging me $20/month for a database that was rarely used. Faced with this issue I started to brainstorm other solutions– how could I query all the addresses by town, convert to GeoJSON, and then load that into the webmap? My first thought was MongoDB: I could host it on my server, and given that it’s designed to handle JSON documents, it seemed like a natural fit. I was all set to proceed when a quick check on my available disk space (all of 2 GB) ruled out this option.
I was doing some work with geojson.io and noticed that one way to save your features was to write them to a Github Gist. This got me thinking about keeping static .geojson files on my server. I could add all these features to a map– no need to build the GeoJSON string from scratch each time. And it’s not like the addresses change very often, nor do I really need to update them if they do. A database-oriented system certainly has the advantage in this respect, but I wasn’t changing the data, and can update it just as easily by replacing the GeoJSON files on the server if need be.