How do you identify database problems?

Let’s say you’ve got a database, maybe it’s not even that old, but lately, you feel like something is just not up to scratch. How do you identify database problems versus something else like hardware issues? In today’s piece, we’re going to suggest ways to identify and troubleshoot your database, solving this challenge, so you can plan your next steps.

Monitor it

The first step, when you notice something is off, is to look at the vital signs of your database. These include:

  1. Disk space
  2. Memory usage
  3. Query execution time
  4. Error logs
  5. Change logs
  6. Transactions
  7. Locks

You’re looking for resource constraints, bottlenecks or any unusual patterns with processing. Now your vendor might have built-in tools to track this, or you may want to go with a 3rd party tool like Datadog, Prometheus or Grafna for your monitoring needs. For your logs, try analysis tools like Splunk or Logstash to parse, manipulate and visualise what you’re seeing. You want to identify any trends, anomalies or errors that are impacting performance.

Igor Topolski of Sainsuiry’s Digital, Tech and Data explains, “Many database engines, such as MongoDB, will notify you about long-running or unoptimised queries; make sure you leverage them to understand the bottlenecks. Many cloud, managed databases, such as RDS or MongoDB Atlas, will provide you with tools to go through large sets of logs to extract performance information. [And for] self-hosted databases, you can leverage forwarding your logs to logging platforms to make them easily searchable and have them in one location.”

Reproduce issues

To find the cause, you will often need to make the performance issues happen again. You can do this with testing tools like Selenium or Postman. Also, think about if the scope of use for your database has changed since when you first rolled it out. Are you doing new things or are there more users? Are you bursting at the seams on data capacity or processing power? You will also want to run diagnostic queries. The goal is to help you understand what your tables and reports are doing so you can go in and investigate further. You might find you just need to rebuild one index to speed up processing.

Document, document, document

Lastly, you’ll want to put everything down on paper. This will help project teams or external agencies like ours know what conclusions you’ve come to. This LinkedIn piece explains, “Documenting […] can help you track and resolve the issue more effectively and efficiently. You can use tools such as Jira or GitHub to create and manage tickets for your database issues. You can also use tools such as Slack or Teams to communicate and collaborate with your team members. Documenting and communicating the issue can help you avoid confusion, duplication and [speed] escalation of the issue.” This last step takes you from “How do you identify database problems?” to the ‘what’s next’ stage of actually repairing them.

Need help repairing your database? We’d love to support you! Talk to us today about where you’ve gotten to with your own investigation.