Schemaball is an SQL database schema viewer. It requires Perl and a few modules, such as GD and optionally Math::Bezier and SQL::Translator. Schemaball creates flexible visualizations of database schemas. Schemas may be read from an SQL schema dump, flat file or live database.


home about screenshots requirements


tour tutorials README CHANGES man page


Perl code


A Need for Flexible Database Visualization

Figure | A trivial schema with two tables: a PERSON table and a PERSONALITY table. Each person has a personality and different personalities are stored in the PERSONALITY table. Each person record has a lookup field for the primary key of the PERSONALITY table. The PERSON table therefore points to the PERSONALITY table and the PERSONALITY table is referenced by the PERSON table.

A database schema can be thought of as a directed graph. The nodes in the graph are the tables and the edges are relationships between them. The edges are created by foreign key fields in tables (see figure at right). The reason why the personality is stored in a separate table has to do with optimizing the way data is stored. There may be millions of records in the PERSON table, but only hundreds of different personalities. If the personality name is very long, the size of the database would be unnecessarily large since this same field value would be found in thousands of PERSON records. Storing a personality name in a separate table as a single record and associating it with a unique identifier, while other tables refer to it, is called normalization.

While in this example it's hard to get lost in the single table link, even with 10 tables keeping things straight can get messy. Schemaball helps to keep your head wrapped around your tables' connections. You can print out a schema ball and mark it up while you work on your schema. When I'm working on a database, I use the excellent mysqlfront to create tables and edit table fields. When I have my tables created, I print out a schema ball and mark up how I'd like to link the tables together. Once I create the foreign key fields, I can print out another schema ball and keep it for record.

Figure | Schemaball can be used to generate graphs of schemas of all size. Here three schemas are shown. LEFT: A Medline citation database with 12 tables. MIDDLE: A ugene database with 35 tables. RIGHT: A massive sequencing LIMS database with 135 tables.

Since it is designed primarily to Schemaball does not show the interal details of the tables. In future versions, support for display of fields may be included, to generate schema superballs.

using Schemaball

To run Schemaball, you need Perl and a few CPAN modules. Schemaball has not been tested on Windows. If you have positive (or negative) Schemaball experiences on a Win32 system and would like to help make Schemaball more Win32-friendly, contact me.

Schemaball services (soon)

If you don't want, or cannot, run Schemaball yourself, you can use the Schemaball service to generate a schemaball of your database. For this, you'll need to open your MySQL server to accept connections from the Schemaball server. You'll need to adjust the permissions to allow the server to connect to your database.