database tagged posts

Generating Data Model using SchemaSpy

Often we need work on existing database schema. How to quickly master the database structure can be a challenge since we might not be able to get the data model ERD diagram from project repository.

However, as long as you get access to the database, then you should be able to generate the data model using SchemaSpy. SchemaSpy is LGPL-based, developed by John Currier in 2004. It has been improved constantly since then.

SchemaSpy is written in Java and deployed as a jar file. Current version is 6.1. It’s a command line tool. The output is a folder with html and other files which outline the database tables, views and their relationships. But before you run, you need have JDBC driver and GraphViz ready...

Read More

Building a Database-driven Application Framework

Normally, people use database as data store, which contains all data tables and lookup tables. The front end application reads the data, presents them to user. If we get another similar request, we simply build another application, which handles another similar database schema. If we get a dozen clients, it’s going to be hard to maintain them all.dbdriven

Many application vendors are struggling to manage the variety of clients’ requirements, while providing similar functional modules to different clients. How do we handle all these changes easily on a common front-end code base? There are many answers, you might say that we may encapsulate the modules, inherit them and expand them. It’s a valid answer...

Read More

10 Best Practices in Database Schema Design

During past two decades, I have been working on many database design and migration projects. There are a lot of decisions to make in creating new database schema. Any database schema changes can be very expensive in a later date. Some may even result in rewriting the front end applications. So to understand a few best practices and apply them in your database schema design is vital important.

1. Take the advantages of UMLdb_schema

Most people use ERWin to create ERD, then use forward engineering to build up database schema. If we may move further and think about how to use object-oriented UML to describe the world, it might be very helpful. UML brings lots of benefits like composition relationship and inheritance (generalization relationship)...

Read More