Rewriting my blog in Go
It has been over two years since I have moved my blog off of tumblr and wrote my own software to support it.
I have a couple of projects that I am writing services for using Go. If you haven’t heard of the Go language, you can check out the project from http://golang.org. The software stack for this blog is pretty simple.
Operating System | FreeBSD |
Programming Language | Go |
Web Framework | None |
Database | |
ORM |
Nada just straight SQL |
I ended up rewriting in Go from Python due to the high memory usage on a small VPS ( 512 mb ). I also decided against using any web framework ( primarily to learn the base Go language feature set ) and to use straight SQL ( I hadn’t written just pure SQL in years ). The results are interesting. Whereas django takes up anywhere between 100-150MB of ram, the go server is plugging along at roughly 8MB of memory. Using straight Sql I was able to implement features such as pagination and full text search without much difficulty.
So far features include:
- Custom metaweblog api implementation ( allows me to post using MarsEdit )
- Full Text search on article content and titles.
- Custom URL shortener.
- Page through all published posts, by year, year and month and all archived posts.
- Easy deployment ( cross compile the blog binary and upload it to the server and launch it ).
- Automatic image uploads to S3.
- RSS.
So far my experience with Go has been pretty positive and I will continue to use Go for new web/api projects.
https://hasani.me/Be