Go I/O Readers, Writers, and Data in Motion
The io.Reader and io.Writer interfaces are probably some of the most common tools. Today, we’re kicking off the I/O series by taking a look at a lot of these readers and writers, and pointing out some common mistakes — like using io.ReadAll in ways that can backfire.
Go sync.Map: The Right Tool for the Right Job
Go’s sync.Map isn’t a magic bullet for all concurrent map needs. It’s got some good tricks up its sleeve, like handling reads without locking, but it’s not always the best choice. This article dives into how sync.Map works under the hood, from its two-map system to the bottom line of expunged entries.
Inside Go's Unique Package: String Interning Simplified
When you’ve got several identical values in your code, you only store one copy. Instead of having several copies of the same thing, they all just point to this one version, which is a lot more efficient. It’s a process often called ‘interning’ in programming circles.
Go Singleflight Melts in Your Code, Not in Your DB
What singleflight does is ensure that only one of those goroutines actually runs the operation, like getting the data from the database. It allows only one ‘in-flight’ (ongoing) operation for the same piece of data (known as a ‘key’) at any given moment.
Go sync.Cond, the Most Overlooked Sync Mechanism
In Go, sync.Cond is a synchronization primitive, though it’s not as commonly used as its siblings like sync.Mutex or sync.WaitGroup. That said, as a Go engineer, you don’t really want to find yourself reading through code that uses sync.Cond and not have a clue what’s going on.
The Rise of Open Source Time Series Databases
Time series databases are essential tools in any software engineer’s toolbelt. Their development has been shaped by user needs and countless open source contributors, leading to the healthy ecosystem of options we see today. In this article, you’ll see how time series databases came about, and why so many are open source.
Go sync.WaitGroup and The Alignment Problem
When we’re spinning off many goroutines to do their thing, we want to keep track of them so that the main goroutine doesn’t just finish up and exit before everyone else is done. That’s where the WaitGroup comes in. Each time one of our goroutines wraps up its task, it lets the WaitGroup know.
Community Question: High Churn Rate Without New Time Series?
My VictoriaMetrics cluster has a very high churn rate at 0:00 every day. However, when I enable -logNewSeries
, I find that these ’new’ time series were actually seen before. Why is this happening?
Slices in Go: Grow Big or Go Home
Slices are way more flexible than arrays since they’re basically a layer on top of an array. They can resize dynamically, and you can use append()
to add more elements.
Open Source Software Licenses vs Revenue Growth Rates
A software license change may have a short term impact on revenue, but the long-term damage can be consequential and take time to fix. Read our CTO’s take on open source software licenses vs revenue growth rates.