Using a JSON File as a Database Safely in Go
There are definitely problems with using a json file as a database, but sometimes the simplicity of no extra dependencies makes it an attractive option. The two biggest problems are performance and managing concurrent reads and writes. We can’t do much about performance, but with Go, managing concurrent reads and writes is a breeze! Below is a walk through of a method for managing file access so that a json file can safely be used as a database.