Hacker News new | past | comments | ask | show | jobs | submit login
Gallery of database schema diagrams of open-source packages (drawsql.app)
379 points by dennisong on April 28, 2020 | hide | past | favorite | 65 comments

Hey all, maker of DrawSQL here. To dog-food the app over the past year, I've been mapping out the database schemas of open-source packages and apps... lots of them in fact!

Then it clicked, these collected diagrams could be useful for other developers to use as references as well. And maybe bring some SEO juice to the DrawSQL over the long-term. Hence the idea to curate this gallery - A central place to browse & discover DB schemas.

First time posting in HN, let me know what you think, or if you have a schema to suggest that should be added. Thanks!

Hi! This is cool, and is something I wish I had when studying database normalization back in my CS days. If you're seeking more visitors, I would send nice emails to DB professors offering it as free class material. Students could study "current open source" DB patterns, and discuss (in online discussions) the characteristics or that don't make sense.

One comment: I can't figure out how to make the diagrams full screen, and I don't like viewing it in that small box. Perhaps offer a way to maximize or download for offline viewing?

Thanks, a big part of this idea actually came from lecturers that have been using DrawSQL for teaching in uni classes :). I agree will definitely reach out to a few more to see if this tool will be valuable.

On making it fullscreen, that's such an useful/obvious thing to include in hindsight. Thanks for the suggestion! For now you can actually click on the "DrawSQL" logo within that opens it in full screen in a new tab

eg, https://drawsql.app/templates/diagrams/wordpress-mysql?ref=e...

+1 that the logo affordance is too subtle to make the full feature set easily discoverable from a schema page.

The Export function in the full editor is nice to see. Once the JSON support is there, it would be fun to analytically compare schemas from function-set similar applications.

this looks great.

I would use it in a heart beat if there were an option for a one time license / activation fee and the ability to use it offline without associating the graphs with an account & communicating them back to a central server. my guess is that there may be more folks like me who work at companies that require a certain level of anonymity or security regarding sensitive information like database schemas. just a thought!

I'd echo this - I know a decent amount of DBAs/data devs who need to generate an ERD once a year for some giant overview thing for their new VP or whatever, and Visio just doesnt cut it, graphiz has a million ways to slice it, etc.

Maybe that market isn't that interesting to you, but the value prop for 100 bucks a month (since most real schemas that have the problem of requiring visualization are going to be >50 tables) for one schema that I then get to go cancel or w/e isnt that strong - It'd be enough that I'd consider writing that graphiz layer I keep screwing around with.

Thanks, good to know of the alternate constraints in other companies. Pricing aside, indeed it would be a different challenge tech-wise to have this as an offline tool.

My motivation for building this stemmed from the use-case of smaller-medium dev teams. We were using offline tools (e.g. MySQL Workbench) as part of our dev process and trying to keep it updated as documentation. Which was quite a nightmare to keep in sync between different devs. In this case having a central server was the silver bullet.

Curious - do you all currently use other tools (eg: workbench) for this?

It could be interesting to separate the visualization functionality from the syncing/sharing aspect.

For example, if you store the schema representation as a logical dump (CREATE statements) in a git repo, syncing/sharing becomes trivial. This also provides a branch workflow for collaborative editing, and the commit history serves as an authoritative changelog.

From this point of view, it could be compelling to have an offline visualization tool that simply operates on top of the current local filesystem state of a repo. Ideally this could be paired with a self-hosted server/daemon that can generate a visualization of any arbitrary commit of a remote repo on GitHub, GitLab, etc.

Disclosure: I'm the author of an open source schema management tool https://skeema.io which is designed to support a repo-driven workflow for DDL execution. So I have a heavy bias towards storing schemas declaratively, as repos of CREATE statements.

> Pricing aside, indeed it would be a different challenge tech-wise to have this as an offline tool.

Maybe not an offline tool, then, but rather a hostable server (or isolated enterprise deployment, if you must), rather than a central cloud service. A virtual-appliance Docker image (that you can keep updated upstream) would be ideal, I think.

Maybe a docker image for rich clients.

What’s sensitive about a (normalized) database schema?

I can see a schema definition being “secret sauce” (i.e. a competitive advantage), but I can’t see it being literally dangerous for the company to publish (e.g. because it contains customer PII), unless you’re doing something very strange.

...in which case, that makes me want to know about the schema even more! There’s probably some interesting lessons in there, if just “don’t do this; we deeply regret that we did.”

I think lots of people would be rather embarrassed to post their company's database structures. And lots of databases have table prefixes that can easily be traced to a company or product.

A lot of companies have blanket policies prohibiting sending any IP to an unvetted vendor.

In quant finance, for example, a DB schema might reveal details of a proprietary strategy that the firm does not want a third party to see.

It can be a security risk. For example, imagine if a popular web framework or ORM is found to have an exploit involving some particular data type, when combined with auto-generated HTML forms. If the companies using the framework are known, and their DB schemas are publicly available, this could be a huge target for attackers.

I'd imagine it can also be a legal concern. For example, a schema may reveal presence of a soft-delete column, which conceptually violates GDPR. If the schema is made public, this could cause unwanted legal attention, even if the column is no longer actively used by any application code.

Pretty cool. It would be amazing if a tool is provided to auto-generate a diagram from an existing database (or its DDL), though. (In fact I assumed it would be like that, so ended up a little bit disappointed.)

Thank you so much for creating this! Whenever I think about starting a side project and creating a database I always look for examples for inspiration.

Can you add magento? Would be neat to stress test your tool because last I remember they have a huge EAV mess of a schema.

Interesting, though I think that will make more sense in the future when new features to better compartmentalize sections of the diagram is introduced. I imagine it will be a mess of lines right now haha

I really like this app, and I like the fact you're pulling in potential customers through the 200 database schemas (I found it quite fun to just look through them). Unfortunately I don't work with databases anymore but if I do I'll remember to try this out :)

Actually a nice and useful idea for advertising your product. Kudos.

As a suggestion for the site: the schemas are to small, most screenestate is wasted for empty space or side-features. Adding some fullscreen or full-tab-button to let the schema make use of more space would be very useful for studying them.

Thanks for comment!

Great suggestion - I agree, having an easy way to view the diagrams in full screen would be so useful and solve that. For now you can actually click on the "DrawSQL" logo within that opens it in full screen in a new tab.

Oh, I see, that's what I meant. Clicking a logo is not really obvious. Maybe just add a visable "click here" or something to enhance discoverability for this feature. Because I really saw it as a logo, not a button.

Agree! Actually just added full-screen mode based on your suggestion today

Really awesome, thank you - recently I was tinkering with ideas for some projects and I was slightly annoyed that I had to manually crate schemas for some common and battle tested scenarios like blog, registration, etc.

I'd be curious to see if the Odoo one fits, though it might be for the wrong reasons. I had to try and understand it a few years back and it looked like a complete mess to me.

It might be slightly out of scope, but I personally would love to see graph schemas in here. Neo4j has a few available, but not at this level of polish.

This is awesome. As a visual thinker, I've been wishing for something like this since I started working.

what is the most complex schema that you've seen that overloaded your drawing algorigthm?


> Database schema for

> Hacker News

> Social news website: Sample database schema diagram for Hacker News, from open-sourced Pythonic News

Seems a little misleading. It's the schema from a clone, not a the original Hacker News site that most people think of when they see the title.

Fair point, changed that now, thanks for the feedback!

Tried it out, there are several similar tools (DB Diagram being closest) but this has the nicest UI, I think. Really solid job on the UX details like tab-completion + enter/select when typing column types in tables.

Auto-layout would be a useful feature, a button to click to re-arrange the table cards in a nice way (unless I missed it).

Also: Made in Vue! I <3 Vue

Thanks! Definitely put a lot of attention on the UX so glad to hear it's been a differentiator.

Auto-layout would indeed be nice might be a bit of a challenge tech-wise. Thanks for suggesting it!

This is indeed one of the nicest UI's I've seen, is this all custom made or are you using some open components? I wanted to get similar effect for something completely different I had in mind (like a flow based diagram), any advice greatly appreciated.

This reminds me of a website that has been around for many years offering free example schemas, or at least free pictures of them. I think in this case they are just internally created rather than collected from external sources, and I don't know the quality or general usefulness, but perhaps handy as a prompt at least.


This appears to have more features and is more generous in the free tier than my usual go-to for this sort of thing: https://www.dbdesigner.net/

It also looks slicker and handles a bit easier, so I think I'm going to switch!

Your diagrams are awesome! Are there any lessons you'd be keen to share from creating a diagramming UX in Vue.js? Are you rolling your own or standing atop another library?

Interesting - the diagram isn't SVG based. I agree with you - one of the nicest I've seen lately. Was similarly blown away by Whimsical, see https://whimsical.com/P53PjXCBWEi2fdMjP2Hti

Curated lists can't be Show HNs: https://news.ycombinator.com/showhn.html. Obviously your app itself could be, but that's not this thread.

Also, could you please change the name of the Hacker News one? As commenters have pointed out, it's misleading.

Thanks for the feedback, wasn't aware of the curated list rule before. Good to know for the future.

Also, fixed up the naming for the HN template as well, cheers!

A bit tangential, but I hate that products like DrawSQL only have a subscription models. It seems interesting, and would like to use it but why should I pay for a subscription? What if I only need it for 1 project? Why should I keep paying every month when I will rarely be touching the model every now and then? I understand that software is expensive to build, maintain and grow, but I just can't seem to tolerate subscription models for every single product. There are some products/services that make sense to charge like that but nowadays everything seems to be like that.

Such apps are not targeted towards occasional user like you. These products are more targets towards people who need to constantly work with schemas , architects/ consultants etc . Perhaps they are more likely to pay in the first place . As you say it is hard to pay if you need it rarely .

perhaps tools like datagrip make more sense for you ? Especially if you already are in jetbrains ecosystem (although they have annual pricing as well, if you don’t renew you get last version your subscription covered Perpetually )

If you only need it for 1 project you can cancel it after you're done, might even be cheaper than whatever the lifetime license price would be.

LibreOffice Base has the exact same feature, FWIW. You can access it by opening the Tools -> Relationships window. It's nothing special, even Access used to do this just fine.

This is great. I first tried to find Airtable or Notion, obviously they're not open source but I'm curious about the meta schemas for apps with user defined schemas and can't seem to find a good answer.

The timing couldn't be more perfect. I'm currently working on re-designing a multi-tenant database schema with user-roles and stuff. I was looking for some tool like this. Thank you! Looks good.

I’m starting to work on this too :)

Any reference material to share?

What's really interesting I think is how "opposite" of enterprise software these ER diagrams look. Whatever happened to the thousands upon thousands of identical tables in a standard Oracle-backed enterprise solution?

It's almost like these things were designed without the intention of having to spend a fortune on consulting services.

Huh lol?

These are simple tables for simple services, like one of these diagrams is legit the boilerplate of Laravel and another is Spark which is a SAAS boilerplate built on top of laravel.

Very few of these are actual software in use, most seem to be boilerplates from different systems. And even the actual software tend to be lower level systems that require very little tables.

You are comparing "enterprise software" of who knows what with a random PHP boilerplate?

> another is Stripe which is a SAAS boilerplate built on top of laravel


I wonder if there is something similar for NoSQL?

For me it's much harder to plan for NoSQL databases. It's relatively easy to draw ER diagram for a relational database, as all in my mind are the problem and data model. With NoSQL database however, I need to take into account how the client(s) works at the same time.

Honestly, if you're finding it hard to plan that's an indication to me that NoSQL isn't a good fit and you actually need relationships.

Yes. Coming from a CS background, I'm accustomed to mapping problems to relational data. Everything can be stored in an RDBMS.

However, I often work in a one man band, and need to push out production ready system in weeks. In these cases, as a compromise, I choose a managed NoSQL database as it requires less code and DevOps work to be up and running. It's not ideal.

Are these diagrams generated from the Data Definition Langauge (DDL) of SQL or some other descriptions/source ?

Are they showing Unified Modeling Language (UML) or Entity Relation Diagrams (ERD) ? or something else that is new to DrawSQL ?

The wordpress schema blows me away. < 20 tables to create an entire industry.

Looks slick! Congrats on launching :)

How would you compare this to https://dbdiagram.io?

Strictly comparing by price, I would think this is much better/feature-rich to justify the large difference. This is definitely pertier tho.

Other than the visual differences in the output diagram, I think the other main difference is the way the table & columns are created.

dbdiagram is freeform text-based and parses that to generate the diagram, while in DrawSQL there's an editor supported by keyboard-shortcuts to do the creation.

Overall they achieve similar outcomes. Personally I think it's a well-built tool too!

Really great stuff. Would appreciate a "full-screen" mode so I can more easily browse around the schema

Great suggestion! (and an obvious oversight on my end). I've just added this in today - thanks

That was quick! Happy to contribute with feedback :) Thanks for adding and congrats on an amazing product. Will definitely be using it in the future.

Looking at this I miss programming right away.

Super cool

Does this rely on foreign keys?

If you imported the diagram from a SQL DDL script, then it does generate relationships based on the foreign keys. I can then add the other missing ones.

In the future there will be smarter ways to infer them, e.g. searching for {table_name}_id etc. In fact I did use a crude script that did just that when curating the diagrams for the gallery. Just need to build a nice frontend for it.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact