Townsourced Tech Blog

Tech musings from a local development agency

BoltDB vs Badger: A Comparison of Go Key-Value databases

  • 29
  • Jan
  • 2019
When I first started working on BoltHold (a simple querying and index engine that sits on top of BoltDB), Badger didn’t yet exist, and BoltDB was the clear leader of the pack for key-value, pure-go, embeddable databases. Then Badger was released, and it was shown to be more than just a pure-go version of LSM-tree stores like RocksDB / LevelDB, it actually was faster than RocksDB. Much faster. I knew I wanted to build something with Badger in the future, and when an issue was opened to add Badger support to Bolthold, I jumped on it.

When Naming Is Important, and When It's Not

  • 30
  • Jul
  • 2018
Like Neanderthals Grunting and Pointing at Cave Paintings The other day a junior dev walked up to my desk and ask for some help troubleshooting a deadlocking issue he was seeing. I wasn’t familiar with the details of his process, so he proceeded to explain to me how the data was modeled, and how it flowed from one process to the next and was modified along the way. The process was complicated enough that I wasn’t able to build a clear picture of the process in my head.

Choosing A Library to Embed Static Assets in Go

  • 26
  • Apr
  • 2018
One of the oft-touted benefits of Go is that applications written in it are easily deployed because they are statically complied. A lot of this benefit goes away if you need to manage the location and permissions on a bunch of files needed to run a web application. The solution is to compile any necessary files into the application binary itself. This can be done in Go by using a byte slice literal containing the string representation of the bytes in a file.

Townsourced Open-sourced

  • 28
  • Nov
  • 2017
TLDR: Grab the code here: https://github.com/timshannon/townsourced and run docker-compose up My goal with Townsourced was first and foremost to build something useful for local, small communities. I felt local communities were very under-represented online, and the social networks available catered either to large communities or niche communities of shared interest. My target audience was small, local communities: small towns, college campuses, neighborhoods, churches, schools. I wanted to build something that handled the overlap between those local communities better than existing options.

Anatomy of a Go Web App - Part 2: Authentication

  • 15
  • Jan
  • 2017

This is part two of a set of posts breaking down some of the decisions I made when putting together the web server for townsourced. The first part is here.

Instead of a general overview, like part one, this post will focus specifically on User Authentication, i.e. how to handle passwords (if at all) and session management.

Anatomy of a Go Web Application

  • 4
  • Dec
  • 2016

When building a web application from scratch, there are a lot of decisions to make. The goal of this guide is to give one more example of how you can go about building a web application in the Go language, as well as to give you an idea what things you need to start thinking about and plan for before you get started.

This guide is not intended to be exhaustive, nor is it absolute. It is a compendium of the things I thought about and how I dealt with them when building townsourced.com. Hopefully you’ll find it useful.