Home Database Planning: Avoid Missed Fields

Database Planning: Avoid Missed Fields

Back when we showed you how logging can save you, we touched on the subject of listing fields prior to building your database.

Once you’ve been building software for a while, you may find yourself jumping into the development stage before you’re ready. In some cases this may work just fine, but if you end up missing some critical functionality, you’ll look pretty silly.

Planning the structure of your database can help you to avoid missing out key fields and build the application right first time. Here’s a working example.

Transactions

Typical fields you might use when dealing with transactions include:

  • Unique Id
  • Description
  • Credit
  • Debit
  • User Id

This would get you started, but there are some gaping holes in this list. Where’s the date? How about the balance?

Content Management

Fields you might need when dealing with content management include:

  • Unique Id
  • Title
  • Content
  • User Id
  • Created Date

This should work for a basic system. In the future you might add things like tags and categories – but should you build everything into the first release? This shows it may be worthwhile to keep things simple to begin with – otherwise, you could add every possible field and never release the system.

There’s also the subject of whether to store the data for an area of functionality in one table or multiple tables. For instance, in the content table, you might have a status field that includes values such as Draft, Scheduled, Published, Private, and Deleted. How many of these are essential for the first release? Would you put these in a separate table or just as a single field in the content table?

Generally speaking, it’s good to have a plan from the start, and try to be consistent throughout the system. Otherwise, things can get very messy.

Photo by Tim Morgan

About ReadWrite’s Editorial Process

The ReadWrite Editorial policy involves closely monitoring the tech industry for major developments, new product launches, AI breakthroughs, video game releases and other newsworthy events. Editors assign relevant stories to staff writers or freelance contributors with expertise in each particular topic area. Before publication, articles go through a rigorous round of editing for accuracy, clarity, and to ensure adherence to ReadWrite's style guidelines.

Get the biggest tech headlines of the day delivered to your inbox

    By signing up, you agree to our Terms and Privacy Policy. Unsubscribe anytime.

    Tech News

    Explore the latest in tech with our Tech News. We cut through the noise for concise, relevant updates, keeping you informed about the rapidly evolving tech landscape with curated content that separates signal from noise.

    In-Depth Tech Stories

    Explore tech impact in In-Depth Stories. Narrative data journalism offers comprehensive analyses, revealing stories behind data. Understand industry trends for a deeper perspective on tech's intricate relationships with society.

    Expert Reviews

    Empower decisions with Expert Reviews, merging industry expertise and insightful analysis. Delve into tech intricacies, get the best deals, and stay ahead with our trustworthy guide to navigating the ever-changing tech market.