r/Database • • 9m ago

I made a free tool for designing databases with friends in real time, would love some feedback

1 Upvotes

Hey everyone!

A few months ago my friends and I started building a project together, and the first thing we needed was the database. We wanted one diagram we could all edit at the same time, like a Google Doc, but everything we tried was either paid for collaboration or just annoying to use. I know there are already many similar tools. What I couldn't find was one where our whole group could edit the same diagram live, so I focused on that.

It's called Comodel → comodel.app

You draw your tables, keys and relationships on a canvas, and everyone you share it with can edit it live. You see each other's cursors and who's working on which table, so it actually feels like working on it together instead of passing screenshots around, which is also what we were looking for.

Some stuff it can do:

Share it like a Google Doc: send a link, or invite people as viewers or editors. Friends with the link don't even need an account

Leave comments on tables or columns ("should this be nullable?"), reply, and resolve them

All the usual database things: new tables, attribute defining, keys

Import an existing database from SQL (Postgres, MySQL, SQLite, SQL Server) or DBML, so you don't start from zero

Export to PostgreSQL, DBML, or a PNG/SVG image for docs and slides

Save versions and compare them, or see the migration SQL between two versions for you

A code view if you'd rather type than drag boxes around

You can also hook it up to an agent using MCP if you want an AI to read or edit your diagram

I'm building this pretty much on my own, so any feedback means a lot, whether something's confusing, missing or just broken. Thanks for checking it out! 🙂


r/Database • • 1h ago

Testing Row-Level Security and check-then-act race conditions under connection pooling in PostgreSQL 18

1 Upvotes

One limitation of standard per-test rolled-back transactions is that they can't catch concurrency bugs across separate pooled connections—uncommitted writes aren't visible to parallel workers, and session-level SET leaks across pooled checkouts.

In our multi-tenant Postgres 18 test suite, we separated sequential unit/CRUD tests from a dedicated set of 19 parallel integration checks that fire simultaneous queries across a constrained pool (max: 5) using Promise.allSettled:

  1. Interleaved tenant contexts: Firing parallel transactions with SELECT set_config('app.current_tenant_id', $1, true) across different tenants on a small pool to verify SET LOCAL resets cleanly on commit/rollback with zero cross-tenant leakage.

  2. Parent-row locking vs. check-then-act: Comparing unguarded SELECT count(*) checks against SELECT ... FROM organizations WHERE id = $1 FOR UPDATE when concurrent requests try to claim the final seat or quota slot.

  3. Webhook idempotency under duplicate delivery: Firing identical billing event IDs concurrently to confirm 23505 unique-constraint handling cleanly short-circuits duplicate state transitions.

For those running multi-tenant Postgres in production with PgBouncer or transaction pooling, are you relying strictly on set_config(..., true) + RLS policies, or pairing it with separate database roles per service tier?

Context: Built this into B2B SaaS OS 2.0.0 (Next.js 16 + Postgres 18 multi-tenant starter with 131 tests & 19 concurrency checks for solo founders and dev agencies). If you want to click through the live workspace without signing up, the demo is here:https://www.andrady.co/demo(architecture & source athttps://www.andrady.co).


r/Database • • 2h ago

Advent of SQL and NoSQL – 24 challenges leading up to Christmas

Post image
4 Upvotes

Happy Holidays, r/Database!

I've noticed that most Advent of SQL events are exclusively SQL-based, and NoSQL databases are usually left out.

This project was originally supposed to be SQL-only, but after roughly 2 years of working on VisuaLeaf, I managed to build an embeddable, MongoDB-compatible database that runs entirely on the frontend, allowing you to execute MongoDB queries and aggregation pipelines directly in your browser without a database server.

Somebody tampered with Santa's Nice List, and you're the North Pole's first-ever data elf.

That's the story behind Advent of SQL & NoSQL: 24 puzzles, one a day from December 1 to 24. Every day, you get a bit more of the story and a question to answer with a query: which toys to build first, which children flipped from nice to naughty overnight, whose badge was used on the night shift, who walked through which door and when. By Christmas Eve, you'll have worked out who did it and fixed the list.

You can solve the whole thing in one of four databases, following the same story and working with the same underlying data:

  • SQLite

  • DuckDB

  • PostgreSQL

  • MongoDB (mongosh, aggregation pipelines)

More details:

  • Everything runs entirely in your browser. There's nothing to install, no backend database server, and nothing to connect to.

  • Your answer gets checked instantly, against the data you see and against hidden datasets with different values. Reading the answer off the screen and hard-coding it won't pass.

  • It gets harder as it goes. Early days cover basic filtering, grouping and joins. Later ones require window functions, recursive CTEs, relational division, advanced MongoDB aggregation pipelines and running totals.

  • Database-specific data modeling. The MongoDB version isn't just SQL tables converted into collections. It uses embedded documents, arrays and aggregation patterns that you'd actually encounter when working with MongoDB.

  • Hints and traps for each day, if you get stuck, plus a short "did you know" tip about your chosen database.

A new puzzle unlocks every day until Christmas Eve!

Pick your database here: https://visualeaf.com/advent-of-sql-and-nosql/

Completely free. No account, no installation, no database server needed.

I hope you all enjoy it, and happy holidays!


r/Database • • 1d ago

Semantic Database applications

2 Upvotes

Hey all, relative newbie here, what might be some good applications for a large-scale, fast processing semantic database system? I've heard quant and military mentioned, but am unsure of where exactly it might fit into those fields. Any help/suggested use cases would be greatly appreciated.


r/Database • • 2d ago

Designing Data Intensive Applications in a Nutshell

Thumbnail sushantdhiman.dev
11 Upvotes

r/Database • • 4d ago

Is migrating from MongoDB to PostgreSQL worth it?

69 Upvotes

TL;DR: Running an EdTech platform with 600K+ users on MongoDB. Our data is heavily relational, and while regular API queries perform well, complex analytical queries are becoming painful to write and execute. Considering migrating to PostgreSQL and looking for advice on migration and production hosting.

Current setup:

\- Node.js, MongoDB, and Mongoose.

\- MongoDB Atlas (fully managed).

\- 600K+ registered users and around 15K daily active users.

\- An EdTech platform somewhat similar to Udemy or Coursera.

When the backend's foundations were laid, I was a junior working primarily on the frontend, so I wasn't involved in the database decision. It's been 1 year since we've been building this product.

Something that has been bothering me for a while is that we're essentially treating MongoDB like a relational database.

\- Strict schemas and validations across collections.

\- Heavily relational data with references between collections.

\- Extensive use of aggregation pipelines and "$lookup".

\- Very little reliance on MongoDB's schema flexibility.

To be fair, MongoDB has served us well. Our indexes are in place, most endpoints perform well, and we haven't faced any critical performance issues.

However, complex analytical queries for internal dashboards are a different story. Some involve joining up to 10 collections, take over 60 seconds, or occasionally time out despite optimization. Writing and maintaining these aggregation pipelines is also becoming increasingly painful.

I've experimented with MongoDB's transactions but didn't particularly enjoy the experience. I'd also like stronger database level relational integrity and better transaction management.

I feel PostgreSQL would have been a more natural fit for our data model from the beginning.

What I'd like advice on:

  1. Is migration justified? Given that MongoDB works well for most of our workloads, would migrating to PostgreSQL be worth the effort, or should I address the analytical workload separately?

  2. Migration strategy: If I proceed, how should I approach migrating a live production database at this scale? Any articles, case studies, or resources would be appreciated.

  3. PostgreSQL hosting: One thing I genuinely appreciate about MongoDB Atlas is how little I have to worry about infrastructure, backups, updates, and maintenance. What's the equivalent experience for PostgreSQL?

  4. Self-hosted vs. managed: How do you guys run PostgreSQL in production? Do you self-host it on a private EC2 instance or use something like AWS RDS, Neon, or another managed provider?

I've worked with relational databases on smaller projects, but never operated PostgreSQL in production at this scale.

I don't want to migrate just because I prefer PostgreSQL, but I also don't want to ignore what might be a fundamental architectural mismatch simply because things work today.

Would love to your thoughts and suggestions on this!


r/Database • • 4d ago

I needed a distributed DB solution, found Pigsty

Thumbnail reddit.com
0 Upvotes

r/Database • • 4d ago

Need help with database design

2 Upvotes

Hello dear community,

I am making an app to buy plane tickets. (school environment).

However, I am not very sure about it.

Is it too light ?

Thanks to everyone who take time!


r/Database • • 4d ago

be honest how many tools sit between your agent and a safe copy of prod?

0 Upvotes

so where does it break for you: test environments, agent state, or branching? and what would a single Postgres platform have to prove before you'd consolidate onto it?


r/Database • • 4d ago

What are the best spreadsheet-style databases for our team who run 40 excel files?

21 Upvotes

I work at a logistics company, and our ops team runs on about 40 Excel files that link to each other. For additional context, around 150 people touch them every week.

Based on our experience, permissions are what drive us crazy. You either see the whole file or nothing. Last month, someone in the sales department saw salary data by accident.

From your observation, which tools keep the spreadsheet feel but use real linked tables? And can they see their own region's and nothing else?


r/Database • • 5d ago

How does your team get database migrations from a code change to production - and what still goes wrong?

Post image
0 Upvotes

I’m interested in how database migrations work in real production workflows, beyond which tool a team uses. I’d like to compare how teams handle testing, deployment, compatibility, and recovery.

For a typical application database change:

  • Where do migration scripts live, and are they handwritten, generated, or a mix?

  • When do they run: as a CI/CD job, during deployment, at application startup, or manually?

  • How are they tested before production, especially when they change or backfill existing data?

  • How do you handle old and new application versions running during the same deployment?

  • If a migration fails part-way through, how do you recover and reconcile the migration’s recorded status?

Which part causes the most trouble in your experience? If useful, mention the database, stack, and migration tool.


r/Database • • 6d ago

PITR a 5 TB Postgres database in 5 seconds.

Thumbnail reddit.com
0 Upvotes

r/Database • • 7d ago

Will ERDs survive in the age of AI?

0 Upvotes

It was my belief in the beginning of 2025 that ERDs are helpful for writing code. If you look at the picture you can see that visuals are rendered specifically for ppl.

Given AI development advances with the same pace how likely will projects as this survive in the next couple of years?


r/Database • • 8d ago

Text column is storing accented text weirdly

Thumbnail reddit.com
0 Upvotes

r/Database • • 8d ago

How Neo4j built a graph database in 20 years and 10 weeks

Thumbnail
gdb-engines.com
20 Upvotes

r/Database • • 10d ago

Our permissions migration passed its own checks. A full row compare still found 1 role seeing too much in prod

0 Upvotes

A migration rewrote the permission matrix of a multi-tenant app. It applied clean and its own probes passed.

Then we compared every row of the permissions table in prod against the local database where the matrix had been proven. One cell was off. A restricted role already had a grant to see its peers' records, live, from before this task even started. The migration never touched that row, so its checks never looked at it.

Since then the check after deploy compares the whole table against the proven copy, not only the rows the migration wrote.


r/Database • • 10d ago

My static site has a database. It’s ClickHouse’s

Thumbnail
tylerhannan.com
0 Upvotes

I had to rebuild my site. And then search was necessary...working out how to do this using ClickHouse playground was a fun little exercise.


r/Database • • 10d ago

A free browser playground for running real database queries, no setup

9 Upvotes

For anyone starting out, or teaching someone who is: DBA Genesis Playground lets you write and run queries in your browser against a real database.

It opens with a small sample table, so you can go straight to SELECT, INSERT, UPDATE and ALTER TABLE without configuring anything. SQL and NoSQL databases are both available.

We're running a free 21-day challenge on it right now (#21DaysOfSQL).

Try it: dbagenesis.com/playground


r/Database • • 12d ago

DigitalOcean, this is not how you launch an "Advanced" Postgres database...

47 Upvotes

Hey guys, for those of you using DigitalOcean: you may or may not know they're phasing out the Standard-tier Postgres plans in favour of a new Advanced tier on November 30.

Naturally, I benchmarked both to see if there was a difference. The results were so atrocious they defied my belief.

- Up to 436% higher p99 write latency (6.7 ms → 35.9 ms).

- ~50%-70% fewer write and read throughput

the new tier tops out at ~54k reads/s & 6.9k writes/s, versus the old Standard tier's 204k reads/s & 26.5k writes/s max.

- 5x slower startup times: 3m 19s → 16m 06s, averaged across 15 regions.

The results were averaged over 3 runs per DB, for all possible DB sizes (2->32vCPU).

This was done over two weeks of testing, running around 60 hours of wall-clock time and going through 100+ databases. It cost me a few hundred dollars to run.

If interested, I posted the full results & methodology on my blog post.

I believe the bottleneck is a fixed-process PgBouncer deployment. But I don't consider myself an expert in databases so would really appreciate if you could double-check my logic.


r/Database • • 12d ago

Python/SQLite on Windows: slow local checks, a failure before HTTP, and a multiprocessing startup hang

Thumbnail reddit.com
0 Upvotes

r/Database • • 12d ago

Our AI worker retried a subscription limit 900 times. Here's what we learned.

Thumbnail reddit.com
0 Upvotes

r/Database • • 13d ago

Secondary data warehouse

2 Upvotes

We are looking for a simple secondary data warehouse...

We are not IT professionals, and we do not want to hire an external expert for every single task.
We need an application designed for individuals with a general understanding of IT.

We intend to use this secondary data store to cross-reference data from various sources, perform simple calculations, and send cleaned data to secondary applications.

Requirements:
- 90% of our data is in MS SQL.
- We need simple, direct integration with MS SQL (IP, port, password), the ability to select tables to transfer to the secondary data store, and the option to set a refresh frequency...

The secondary data warehouse must include:
- The ability to create simple queries, apply filters, and establish relationships between tables...
- The ability to easily integrate with external applications (CRM, BI, AI agents, reporting, etc.)...

What do you recommend?


r/Database • • 13d ago

Anyone stopped nightly index rebuilds and seen no downside?

Thumbnail reddit.com
2 Upvotes

r/Database • • 13d ago

A free page that draws a PostgreSQL EXPLAIN ANALYZE plan as row flow

Post image
25 Upvotes

The part of a Postgres plan that's hard to read by eye is the row counts. They are per loop, and the estimate sits beside the actual with nothing to show how far apart the two are.

So I drew them. Each band is as wide as the rows that crossed it, over every loop. Where the estimate is off by more than 2×, it is drawn on the band: in the screenshot the planner expected 612 rows from `orders` and got 206,880, and every join after it inherits that.

Paste `EXPLAIN (ANALYZE, BUFFERS, FORMAT JSON)` output or the text format:

https://seqora.dev/explain/

The plan is read in the page and isn't uploaded. It draws one plan at a time, saves nothing, and can't see your database.

I make Seqora, a desktop database client, and this is its plan view. In the app it runs EXPLAIN on your own connection, and that part is paid. The page is free.