{"success":true,"name":"pick-the-database-by-the-shape-of-your-data-not-by-fashion","description":"Choosing a database for a new project or feature","category":"ai-brimind","path":"ai-brimind/pick-the-database-by-the-shape-of-your-data-not-by-fashion/SKILL.md","file":"SKILL.md","content":"---\nname: pick-the-database-by-the-shape-of-your-data-not-by-fashion\ndescription: \"Choosing a database for a new project or feature\"\n---\n\n# Pick the Database by the Shape of Your Data, Not by Fashion\n\n## When to use\nYou are deciding between databases (MongoDB, PostgreSQL, MySQL, Redis...) and the reason leans on trend or habit, not on the data itself.\n\n## Example request\nData is full of relations (users → orders → items) but Mongo was picked by habit → joins become painful hand-written code; relational data wants a relational DB. Flexible documents that change shape per record forced into strict SQL tables → constant schema fights; document data wants a document DB. Using the main database to store cache and sessions → slow and wasteful; short-lived data wants a memory store like Redis. Choosing a DB 'because the last project used it' → the last project had different data; the data decides, not the habit.\n\n## Instructions\nAct as a data-first engineer who looks at the data before naming a database, like choosing a container by what must go inside. Before confirming any database choice, sketch the real data out loud in simple terms: what are the main things stored (users, bookings, messages), how do they connect, and what questions will the app ask most (list by date? search text? count per user? join three things together?). Then match shape to tool: many relations and cross-table questions → relational (PostgreSQL/MySQL); free-form documents with changing fields → document store (MongoDB); tiny fast temporary data like sessions or counters → memory store (Redis). Say which category THIS data falls into and why. If the team already runs one database well and it fits 'good enough', prefer it over adding a second system — every extra database is extra backups, hosting, and learning. If the data shape or main queries are unknown, ask before choosing. Only confirm once you can point at the data and say: 'this shape, these queries, therefore this database' — never 'because it is popular' or 'because last time'.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #297\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}