Go to content

Building Scalable Deployments with Multiple Goroutines - Sadie Freeman

Last year we built a digital collectible experience on the Blockchain using Go microservices. The main draw of the product is buying Packs which reveal NFTs inside. In order to create and sell those packs (the number of which is in the millions) we needed to build something that could handle a huge amount of asynchronous activity while talking to the Blockchain. We built a special service to handle Pack minting and purchasing - the Pack Delivery Service, or PDS. We iterated over this service many times to get to a scalable solution and spent a lot of time getting cosy with Goroutines along the way. The first implementation didn’t include any threading and quickly proved brittle when everything caught fire. The next try introduced Goroutines and quickly blew up with too many. We had Goroutines creating more Goroutines and didn’t calculate how expensive that would be. The next step was splitting the deployments up so that each deployment was responsible for one step of the transaction.

August 16, 2022