API backend should use dataloaders

Data Loaders allow transparent batching of requests to a data provider (e.g. database). More often than not, this leads to reduced latency and better performance without forcing an explicit batching of requests for the API users, for example, your frontend developers. Many programmers relate data loaders to Graph QL for N+1 query patterns. I believe data loaders are a great idea any time you are building an API backend. Let me illustrate the concept with a simple example. And while I am using Go as an example, data loader implementations are available in many languages.

Nillion

Recently, I came across Nillion鈥檚 whitepaper. Nillion at its core is trying to be a new decentralized encrypted data-processing layer. Here鈥檚 how it works.

Generics in Go

Generics in Go were added about a year back in Go 1.18. In my experience they are great and they fix one of the biggest roadblocks in terms of writing reusable code in Go. I鈥檒l illustrate that with an example. First, do ensure that you have at least Go 1.18 Bash 1 2 $ go version go version go1.19.1 darwin/amd64 Let鈥檚 consider a simple case of implementing a Map function in Go that maps an array (well, a slice) to another array (again, actually, a slice)....

Common pitfalls of GitHub Actions

If you create GitHub Actions via GitHub鈥檚 UI by going to the URL of the form `https://github.com///actions/new`, it provides templates for setting up the build. However, the template is broken. There are four problems with the default template

Inheritance in Go language

Go language does not have the concept of a class directly. It, however, has a concept of an interface as well as a struct. I鈥檒l illustrate how this can be used to build most of the inheritance constructs that a language like Java or C++ offers.

GraphQL vs gRPC

RPC calls allow one service to call functions in another service as if it is a part of the same service. And unlike a REST API, one gets strong type checking. The two services can even be in different languages.聽gRPC is a great framework for implementing an RPC service. Another language-agnostic framework for making RPC calls is GraphQL. Many people don鈥檛 think of GraphQL that way, however, it can serve the same purpose....

Android uncaught exception handler and ANR

While trying to install a custom exception handler to catch uncaught exceptions (crashes), I ended up writing

Infinite network timeouts in Java and Go

Java made a huge mistake of having no network timeouts. A network request can block a thread forever. Even Python did the same. The language designers should have chosen some conservative appropriate numbers instead. What鈥檚 surprising is that the Go language repeated it!聽Here鈥檚 a simple demo

Test changes to CircleCI config locally

Rather than pushing the code to a remote branch and then testing via Circle CI servers, it is best to run the tests locally first and make them work. Here鈥檚 how you can do that.

What's the best alternative to Google Play Music and Google Podcasts...

Google Play Music was great. Apart from one missing feature about the inability to upload music from the phone to the Google Play Music library, I had no other complaints. Then it was forcefully shut down.