Production Grade Web Services with Go - Tying it Together

Note : This is part four of a series of posts describing how to write “Production Grade Webservices in Go”. Here’s Part - 1, The Service , Part - 2, The Store , Part - 3, Transports. In part-3, we built a working HTTP service that passed the tests. But we’re still lacking the option to actually “run” it. While, this may appear like a trivial task, it’s actually quite important to get this right. Something I feel rather strongly about is the need to avoid package level variables and global state in Go programs. Like plenty of other things, Peter Bourgon says it perfectly in this post: ...

August 16, 2020 · 5 min · Tanmay Chaudhry

Production Grade Web Services with Go - Transports

Note : This is part three of a series of posts describing how to write “Production Grade Webservices in Go”. Here’s Part - 1, The Service and Part - 2 The Store if you haven’t read those. We’ve reached a point where we have properly laid out the business logic and the storage implementation for our service. Now, we’re going to move on and talk about transports. As the name suggests, a transport is essentially transporting data over the network in a pre-defined format. JSON over HTTP is one such transport. gRPC is another. We’re going to start with JSON over HTTP simply because of how popular it is. I may write a separate post that adds a gRPC transport to this very service later, but for now, HTTP-JSON. ...

July 4, 2020 · 7 min · Tanmay Chaudhry

Production Grade Web Services with Go - The Store

Note : This is part two of a series of posts describing how to write “Production Grade Webservice in Go”. Here’s Part - 1, The Service if you haven’t read it. The previous post ended with a defined structured for our service and some basic testing. It was, however, lacking what is a very important component for most webservices, a datastore. If you’ve used frameworks to write services in the past, you’re probably familiar with abstractions like Hibernate/DjangoORM etc. While Go has the option of working with similar alternatives (GORM, Pop), I generally find building a simple custom abstraction over the database to be better. Unless you have a lot CRUD like APIs with plenty of models, direct is, in my opinion, better. See this post for more information. ...

June 8, 2020 · 5 min · Tanmay Chaudhry

Production Grade Web Services with Go - The Service

Production Grade is a term thrown around a lot these days. Every organization seems to have it’s own definition for what qualifies as “Production Grade” or “Production Ready”. In these series of posts, I’m going to present my take on the topic and the bare minimum of what I think qualifies under this definition. These posts assume a working knowledge of Go and are not meant for total beginners to the language. ...

June 7, 2020 · 5 min · Tanmay Chaudhry