Carving the UUID space into non-overlapping partitions

In Chapter 6, Building a Persistence Layer, we mentioned that the caller of the Links and Edges methods that are exposed by the link-graph component is responsible for implementing a suitable partitioning scheme and providing the appropriate UUID ranges as arguments to these methods. So, how can we go about implementing such a partitioning scheme?

Our approach exploits the observation that the link (and edge) IDs are, in fact, V4 (random) UUIDs and are therefore expected to be more or less evenly distributed in the massive (2128) UUID space. Let's assume that the total number of workers (that is, the number of partitions) available to us is N. For the time being, we will treat the number ...

Get Hands-On Software Engineering with Golang now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.