a curated list of database news from authoritative sources

September 03, 2023

Finding Domains That Send Unactionable Reports in Mastodon

One of the things we struggle with on woof.group is un-actionable reports. For various reasons, most of the reports we handle are for posts that are either appropriately content-warned or don’t require a content warning under our content policy–things like faces, butts, and shirtlessness. We can choose to ignore reports from a domain, but we’d rather not do that: it means we might miss out on important reports that require moderator action. We can also talk to remote instance administrators and ask them to talk to their users about not sending copies of reports to the remote instance if they don’t know what the remote instance policy is, but that’s time consuming, and we only want to do it if there’s an ongoing problem.

I finally broke down and dug around in the data model to figure out how to get statistics on this. If you’re a Mastodon admin and you’d like to figure out which domains send you the most non-actionable reports, you can run this at rails console:

# Map of domains to [action, no-action] counts
stats = Report.all.reduce({}) do |stats, r|
  domain = r.account.domain
  domain_stats = stats[domain] || [0, 0]
  action = r.history.any? do |a|
    # If you took action, there'd be a Status or Account target_type
    a.target_type != 'Report'
  end
  if action
    domain_stats[0] += 1
  else
    domain_stats[1] += 1
  end
  stats[domain] = domain_stats
  stats
end

# Top 20 domains, sorted by descending no-action count
stats.sort_by do |k, stats|
  stats[1]
end.reverse.take(20)

For example:

[[nil, [77, 65] ; nil is your local instance
 ["foo.social", [3, 52]],
 ["mastodon.oh.my.gosh", [40, 24]],
 ...

August 31, 2023

Horizontal sharding for MySQL made easy

Historically, there has been the belief that you cannot horizontally scale and shard MySQL, learn how Vitess has made MySQL sharding at the database layer a reality.

August 29, 2023

Deploying multiple schema changes at once

Why PlanetScale deploys branch changes near-atomically, and how it applies concurrency and dependency resolution without impacting production databases.

August 25, 2023

Real-time Personalization: Choosing the right tools

Real-time personalization is the pathway to better user experiences. But it often feels like you must choose between complex DIY and expensive SaaS. Here's the happy middle path.

August 24, 2023

August 23, 2023

August 22, 2023

Vitess for us all

Learn how middleware technology works, the pitfalls of application-level sharding, and how Vitess enables horizontal sharding of MySQL for near infinite scale.