Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For someone who hasn't invested much time into looking beyond the basic syntax of Go, can you give us a little info on what your stack looks like?

I haven't gotten to the point where I've looked into things like web frameworks, templating engines, Postgres adapters, anything like that. But I'm interested in it.



Niflet is my first foray into modern web development (I'm a database developer by day), so I kept it simple, just Go and SQLite. I'm using Go's webserver, which is basic but wasn't hard to extend to do compression and other niceties. Templating is via Go's template package. SQLite gets embedded, making the entire app a single 5 MB file. A free Dropbox account is used for nightly backup, handled by a scheduled goroutine (Go's concurrency feature).

For a heavyweight web app that needs to scale to multiple machines I would've done things differently. It turns out that Go is so fast that needing to scale would be a luxury problem for me. In theory I can serve 70M users spread over a 10-hour day for < $100 a month.


The standard library templating in Go is one of my favorite features. Between html.template and text.template, I probably use it in over half of the programs I've written.


I love the context aware escaping in html/template. I haven't seen this in other template engines before.


How did you embed your templates into the binary?


The templates are on disk and their contents passed to the template function on initialization. So yes, the app is not a single file. I forgot about these files because they rarely change, hence are rarely deployed.



For development, I have:

Nginx as a front facing server. Go listening to a specific port. MySQL for general database operations. MongoDB to pass some data around.

Shoot me an email. I'll get you up to speed quickly.


I'd like a copy-paste of that email as well! I'm learning Go by following the Tour and making some dumb 'university' level examples to get a feel for the language and I'd like to actually build a website with it.

Sent you an email


Can you do a blog post instead? Would help lot of developers like me who are looking into Go as the next programming language to learn.


Real question; why do you put Nginx in front of Go? Is it because you have many apps?


Its a search engine, and I have many services working together.


I don't know why the parent comment does it but with nginx you can leverage things like caching out of the box. (Would mostly be used on static files, either generated or pre-made).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: