I've put a littleproject on Github written in Go. It's a little database system that allows
writing and reading objects, and do GraphQL queries on them. The main principle
is that objects have a arbitrary String ID that is like a path, separated by
slashes, and deleting an item with a given ID deletes also items with
"children" ids.
For fun, I used
Cassandra as the main data store, since it's optimized for fast writes and
loads of data; we never delete anything, we just keep every state of an object
as history. Text searches are done on the last version of objects using
Elastic. GraphQL support allows to follow object namespace relationships.
I've used the
following main libraries:
- https://github.com/gocql/gocql for the Cassandra client
- https://github.com/olivere/elastic for the Elastic client
- https://github.com/graphql-go/graphql for GraphQL.
I also provide
Dockerfiles to deploy either just the database systems for testing, or the
whole application.
I'm not sure this
can be useful as is for anybody, but this was for me to try Go on a real-life
project. Apart from the gotchas I've wrote about before, it was a rather
painless and enjoyable experience.
Happy Go Hacking!