Need some advice with web interfaces and databases

sfidirectory

Senior Member
Joined
Mar 29, 2010
Messages
931
Reaction score
504
Hi everyone,

I have been studying relational databases for a few months now (have learned components like E.R.D diagrams, cardinality, optionality, primary and foreign keys etc) and am wondering is it best to create the database first or the web interface first? I am in stage 2 of creating an auction site and am wanting to create a form where the user can create an auction.

Note: by "web interface" here I am referring to the form that will be gathering the information to be inserted into the database. I am working with MySQL...

Thanks in advance!
 
Assuming you know exactly what you need to do in terms of functionality, it does not matter either way.

For convenience, I prefer creating the db first.
 
Assuming you know exactly what you need to do in terms of functionality, it does not matter either way.

For convenience, I prefer creating the db first.

I agree with jazzc. I prefer to map the DB first so you get a feel for the project before you start.
Also, when it comes time to add a new function, it's always easier to add a new column/table vs changing the front end code;)
 
its by logic... you must design the database first then connect it with the application later.. that's how I always do it..
 
If I have an idea of app already, my first step would be to write basic functionality to the paper/notepad, use cases, sequences, actions and views I need. Sometimes its very freestyle writing, just putting things on groups. Then I'm going to models and once basic models are done, then design database. At this point there is interexchange between designing models and database if you are using relational database compared to key-values stores, that gives you more freedom. But it really depends of the hierarchy, links between objects and especially type of data you deal, what kind of database you choose. Are you sure you are pro relational databases like mysql? ;)

But after this is done, I try to jump on interface designing (browse themes, connect screenshots to the hard drive). I try to do mockups & layouts as soon as possible so I can see some progress on the project, have flesh over the bones so to say. Usually all three parts are going hand in hand here: UI, model and database.

Its also good idea to have a solid plan for testing procedures on site. You want forms, navigation and links work and tested all the time.

After this said I have to say, sometimes I still start doing layout first because it gives you clearer vision of the future and may inspire you doing great functionality that supports sleek user experience. It may depend on your own preference and of course team, if you are not working by yourself.
 
Last edited:
Well, first of all let me say that I don't use MySQL anymore. I've completely moved over to MongoDB and addopted a noSQL way of work. But! I've used MySQL a lot. It actually doesn't matter if you're working with a relational database, this or that language or building a wood bed with saw, hammer and nails. You HAVE to plan ahead. You need to invest time in planing. It's mandatory! You have to think your app and plan. And the base of all applications is your data. Data management and storage are the heart and the fail point of every app. Write your db layout first. Don't think on every field possible. Just write the table names. Then think about yout app. eash screen. And whenever you feel the need to an extra field, add it to your table and write a comment about it. You should take a day or two (or a lot more, depending on the app size) developing you database offline. Don't be affraid of paper and pencil. They are your friends. Then rewrite it to the computer screen thinking about what your typing. It gives you fresh eyes on your design. If you code with someone else, let him type your part of the db and type his(hers) part of the db. argue about the design. correct mistakes and dups. argue some more (it's more productive if you do pair coding). clean up. read it again. Argue some more. and THEN start coding. Although you spend more time arguing and writind a db design, you'll create the app in a lot less time. been there, done that :)
 
Logic dictates that you rationalise your data model first and then design your database.

You may find you make some changes to the DB afterwards, but having put in the thought on how you're gogin to organise your data first, you'll find layout and interface design a lot easier.
 
ALWAYS architect the database first. A well designed DB is like having your app 50% completed. Starting with a well designed DB you know very clear what you have to do next in terms of interface and business logic.
 
Hey sfidirectory,

Here are the steps in building a product (especially web based):

1. General idea + detect the "killer app" (i.e. what is the key feature)
2. Search the web for similar products, detect problems, features
3. Flowchart(s), screens and features - use a wireframe program (example, balsamiq mockups) to create a mockup
4. Come up with a wireframe document, something you can use as anchor (if you decide to outsource the project and/or if you want to remember "what the hell was I thinking" 2 months later...)
5. Based on #4 - design DB architecture

You can start with step #2 and I would suggest to create a mockup so you can test with friends (this is a valuable input that can save hours of work later on)

Good luck

critical




Hi everyone,

I have been studying relational databases for a few months now (have learned components like E.R.D diagrams, cardinality, optionality, primary and foreign keys etc) and am wondering is it best to create the database first or the web interface first? I am in stage 2 of creating an auction site and am wanting to create a form where the user can create an auction.

Note: by "web interface" here I am referring to the form that will be gathering the information to be inserted into the database. I am working with MySQL...

Thanks in advance!
 
Personally agree with the biggest part of replies.
Firstly, i format database on paper, so i can see the structure of the web.
 
Yeah, definitely create the DB first. In that way you'll actually find out of additional steps your application will need to have
 
I always create the database first. With query tools you can test all your inserts and queries before you build a single page.
 
Measure first how many types of information you need to store in db and design database based on that. You may need different tables for different types of information. (simply you need tables: users, auctions, bids, etc.)

Make forms and scripts to save info to related tables.

Then the final part is to make some reports based on your plan to show info to different types of user. You will need session variables to manage security.

If you need help to design the db, please share some more info of your application.
 
Back
Top