A Simple JSON Database in Golang — Scribble.

Steve Domino
2 min readNov 17, 2015
Image by dryicons

Isn’t there some saying about “Theres as many PHP frameworks as developers”? Or maybe it was javascript... Either way, a JSON flat file database isn’t anything new, so why Scribble?

Yoke, a project I have worked on recently, needed a very small database to keep track of the states of different nodes in a postgres cluster. After googling something like “simple golang database” I couldn’t really find anything that fit.

There are great projects like boltdb, ledisdb, and tiedot, but they are all way more than what I needed. I wanted was a tiny, dead simple, database. So I did what every other developer does when they can’t find the right tool for the job. I made one.

Scribble was designed with one thing in mind. Simplicity. It’s small, easy to use, and effective. Scribble wont work for everything, but when you need it for what it’s designed for, it’s great.

If you look at the repo, you’ll see that Scribble is only one file thats roughly 250 lines long, making it very easy to understand. It’s also equally easy to use:

I am intentionally not handling errors here for brevity, but it’s something you should always do when implementing Scribble yourself.

Scribble doesn’t really do anything ground breaking, it’s just a very small, simple JSON flat file store. It wasn’t really designed to be used on large distributed systems, but when all you need is simple data storage, Scribble gets the job done!

--

--

Steve Domino

Husband, father, and tech enthusiast. I’m passionate about finding, using, and creating awesome stuff. Currently creating awesome stuff at https://getdivvy.com/