Saturday, May 9, 2015

bootstrapping go web projects

At first I thought that this was going to be a good idea. Some sort of opinionated framework was going to bootstrap whatever project I might be working on... and voila. But that was before I started looking at the details and now I have a different opinion.

It's a bad idea to base my next project on this sort of framework.

Part of my opinion is intuition and the other part is experience. While the authors have made some excellent choices and they will work in most cases they are not going to work in all cases and without a more general plug-in strategy you're better off knowing and understanding the ideas and the glue. Implementing your own strategy.

The authors have clearly just glued a bunch of 3rd party packages together. It's not a bad thing but you need to understand the code before you blindly incorporate it. The Go Authors are very clear on this point as the stdlib is fairly feature complete.

here is their list and my objections:

  • PostgreSQL is chosen for the database.
    • as much as I dislike CAP there are use-cases for document and key/value storage
  • bcrypt is chosen as the password hasher.
    • crypto is a huge risk for any system; I think bcrypt has been cleaned by the openbsd team so it's a good choice
  • Bootstrap Flatly is chosen for the UI theme.
    • can't argue with this as it's clearly pluggable
  • Session is stored inside encrypted cookie.
    • good
  • Static directory is located under /static.
    • ok
  • Model directory is located under /dal (Database Access Layer).
    • not certain this is a good idea. models and packages and CRUD are strong ideas but there is something to be said for generators which is missing.
  • It does not use ORM nor installs one.
    • good
  • Test database is automatically created.
    • meh
  • A minimal Dockerfile is provided.
    • since this is a go program it should have been built on the scratch container
  • is chosen to manage dependencies.
    • godep is the current gold standard but gb is on it's way
  • is chosen to connect to a database.
    • this is a clear winner
  • is chosen for a lot of the HTTP plumbings.
    • not a chance.  This is a core and important system. You should implement your own.
  • is chosen as the middleware library.
    • see previous note
  • is chosen to enable graceful shutdown.
    • this cannot possibly work properly. Do it yourself and integrate your project with haproxy, vukcand etc...
  • is chosen as the database migration tool.
    • schema migration is the hardest part of any deployment. This might be a good tool but it requires some investigation. Commercial ventures make a good living doing this sort of thing.  An open source version of the same quality and versatility would be a great win (depending on the licencing)
  • is chosen as the logging library.
There are a few missing packages... go-bindata and bindata-assetfs. And a good Makefile/Dockerfile. Taking a page from the Apcera gnatsd project they provided a Dockerfile that is the makefile. 

The last thing that is missing is a license dependency tree.  Just what exactly are the challenges here... if there is a single license that includes the GPL-A then you have a number of commercial licensing issues. Any corporate attorney would require this evaluation so you are better off doing it for yourself before you get started.

Good luck.

** know your stack!!! 

No comments:

Post a Comment

another bad day for open source

One of the hallmarks of a good open source project is just how complicated it is to install, configure and maintain. Happily gitlab and the ...