Databases Demystified

A PM’s Tech Toolkit

Siddarth Kengadaran
The Product Guy
Published in
3 min readApr 29, 2024

--

In our ongoing series, ‘PM’s Tech Toolkit, ‘ we’ve explored various aspects of our tech ecosystem. But as a product manager, have you ever wondered about the origin of the data that APIs circulate? For instance, where do songs, playlists, and user profiles reside? The answer lies in databases, a crucial component of app development.

What is a Database?

Imagine a database as a meticulously organized warehouse for your app’s information. Just like a library keeps books neatly arranged, a database ensures our music app’s data is stored and managed efficiently for easy access.

https://unsplash.com/photos/photo-of-5-story-library-building-PkbZahEG2Ng

Types of Databases: Finding the Right Fit

Relational Databases:

These structured data are in tables with rows and columns, like spreadsheets. They excel at managing well-defined data.

Example (Music App): A “Songs” table with columns like “Title,” “Artist,” “Album,” and a separate “Playlists” table connected to it.

When to Use: When you have well-defined data that benefits from strict organization and relationships between items.

Non-Relational Databases (NoSQL):

Offer more flexibility for storing different types of data without a rigid structure.

  • Document Databases: Store data as JSON documents. Great for flexible content.
  • Key-Value Stores: Like a super-fast dictionary for simple lookups.
  • Graph Databases: Specialize in mapping complex relationships between data points.

Example (Music App): Using a document database for user profiles (where fields might change) or a graph database to build “You Might Also Like” recommendations.

When to Use: When you need data structure flexibility, handle large volumes, or have complex relationships between data points.

Vector Databases:

A cutting-edge type for storing and comparing vector representations of data (think of them as mathematical fingerprints).

Example (Music App): Powering advanced recommendation features or letting users search by humming a melody.

When to Use: When incorporating AI-driven features, you must efficiently compare data points

Database Schema: The Master Plan

A schema is the blueprint of your database. It defines:

Tables:

The different “shelves” holding your data (e.g., Songs, Users, Playlists).

Columns:

The specific details you store for each item (e.g., Title, Artist, Genre).

Relationships:

How tables relate to each other (e.g., a Playlist contains multiple Songs).

Constraints:

Rules ensuring the data stays accurate (e.g., no duplicate users).

Types of Schema

Logical Schema:

This is a high-level view focused on the database’s data. The logical schema is needed to understand how the app’s data is designed.

Physical Schema:

It is about how data is physically stored on disk, which is generally needed for optimizing performance.

SQL vs. NoSQL

SQL (Structured Query Language):

The standard for interacting with relational databases. It lets you retrieve, update, and analyze data. They are used when working with relational databases.

Example (Music App):

  • Fetch Data: “Find all Taylor Swift songs from the Fearless album.”
  • Add/Update Data: “Add this song to the ‘My Favorites’ playlist.”
  • Analyze Data: “Which genres are most popular with new users?”

NoSQL:

Each database type has its query methods. NoSQL offers flexibility but less standardization than SQL. Understanding your database structure helps when planning new features.

  • Data-Driven Insights: Digging into your database reveals user behavior patterns.
  • Performance: A poorly designed database can slow down your app.
  • Collaborating with Developers: Basic database knowledge bridges the communication gap with your tech team.

Up Next: The Power of the Cloud!

In the next part of “A PM’s Tech Toolkit,” get ready to delve into the exciting world of cloud computing and how it transforms application development. Stay tuned for more insightful content!

Let me know what other technical topics you’d like broken down!

--

--

Siddarth Kengadaran
The Product Guy

Product Consultant, Enabling teams to strategize and build with conscious intention. Currently exploring Spatial Computing (XR) and AI.