Martijn Spent half an hour figuring out how to use SQL to find a specific record and also get X records above and Y records below it. In hindsight the solution was so obvious.
Login or register your account to reply
Eric When I was 16 I put together a website which got quite popular but I built it avoiding an Sql database and used a separate txt file for each record as an experiment, in hindsight that was a terrible mistake. As the site grew in features there too grew a huge net of folders holding hundreds of txt files coordinated by a Php script. I pray I have the source somewhere still.. 4 years ago now!!
7y, 39w 2 replies
Mark Dain Funnily enough, I always started with SQL and recently I've been drifting towards flat files. So long as you're very read-heavy (almost no writes) and you don't need to search data too much, it's extremely nice. You can, at-least in Go, define all your structures and just use JSON marshal/unmarshal. The file system provides timestamps, permissions, hierarchy (in directories) and of course, it plays well with tools like git and rsync. I still use SQL for bigger projects but all my recent stuff has been flat files.
7y, 39w 1 reply