They say – “necessity is the mother of invention”. Laminar is our invention born out of
necessity. The first order of business for the engineering team at nurture.farm was to
decide on a tech stack that suits our domain. In the agricultural domain, we often
serve users who might not have great access to the fast and reliable internet and
cellular data on the go, or the luxury of having a high-end mobile phone. We needed a
tech stack that supports the fast transfer of requests and responses.
Around two years back, when the tech team deliberated the tech stack we should
have, we were stuck with a dilemma—should we go with a modern stack that is cutting
edge, or should we stick to where the world is? On the one hand, we wanted to
introduce Go, gRPC, Kubernetes, temporal, and other latest in the world of
programming, while on the other hand, introducing the newest technology would
mean a significant learning curve for engineers at the time when engineering talents
were hard to come by.
Go, being a relatively new language, has only a few experienced engineers in the
ecosystem. We could not afford to have a long training period as that could slow down
our product development timelines. True to our values of owning the outcome and
execution over perfection, we decided to build our own framework. And we called it
Laminar. The nimble start of Laminar has a mammoth vision. We have envisioned
Laminar to be synonymous with Go, much like spring boot is for Java or Rails is for
But what exactly is Laminar?
Laminar generates your gRPC microservice with the required production-grade
boilerplate code in GoLang. Laminar helps you to save a lot of development time and
effort. All you need to do is just upload the three required files, and Laminar will bless
you with the microservice in a ZIP file. This can be extracted and run with some minor
changes in configs. Someone with just the knowledge of SQL and GoLang can easily
generate a gRPC microservice using Laminar!
So, yes! If you know how to write SQL queries, you can create your microservice that is
ready to run on Kubernetes in a matter of minutes. The first version of Laminar was a
command-line tool that connects to a MySQL database instance and then generates
the service. It has evolved from there to a web UI-based tool that does not need
anything more than a few configuration files. Laminar, since its inception, has helped
us develop and launch over 50 microservices already in a short order of time. It has
significantly reduced the learning curve of our engineers as they need to just write SQL
queries that encapsulate our business logic, and whoa, you have a running
microservice within a matter of minutes.
Beats instant noodles
We conducted an internal demo where one of our engineers made a running
microservice within just five minutes. We have been able to save considerable network
costs due to the use of much-optimised gRPC over rest protocol. The standardisation
and automatic generation of boilerplate code ensure that engineers don’t run into any
common problems like DB connection leaks.
Advantages of using Laminar
- Automates boilerplate codc
- Creates microservices using Golang, gRPC, and MySQL with a minimum learning curve
- Quickly upgrades the code by standardizing contracts of generated code with the application layer
How does Laminar generate code?
Abinasha Karana, our chief architect, envisions a world where a bot generates and
commits most of the code in nurture.farm, and Laminar is the first step in that
direction. Laminar’s generated code architecture has two main components—the
Zero-touch folder and the Hook. The Zero-touch folder currently contains the code for
MySQL interaction along with the code to host and run the server. The generated code
comes with basic unit testing integrated for all the zero-touch APIs. The Hook is the
second major part of the generated code. It allows the user to write custom code
after the request is received or before the response is sent. We envision a world where
zero-touch is continuously upgraded with new features and deployed without any
significant effort from the application developer. Laminar also comes out of the box
with the support for Prometheus metrics and logging.
What lies ahead for Laminar?
It has been two years since the day we decided to build our own framework, and we
have come a long way. We are proud that what started as a solution to our internal
challenges is now available to the world as an open-source project. Laminar is the
result of the efforts of so many from our engineering team who have contributed by
suggesting features, contributing to code, and most importantly, having the vision
and pursuing it relentlessly. We have a healthy roadmap to reach the point where
Laminar is more user-friendly and allows integration with multiple databases, among
many other features to make the life of a developer easy and fun.
But, for now, let us celebrate nurture.farm’s very first open source project—Laminar.