Database Research & Development

  • Home
  • NoSQL
    • NoSQL
    • Cassandra
  • Databases
    • Database Theory
    • Database Designing
    • SQL Server Coding Standards
    • SQL Server
    • PostgreSQL
    • MySQL
    • Greenplum
    • Linux
  • Interviews
    • SQL Server Interviews
    • MySQL Interviews
    • SQL Puzzles
  • DBA Scripts
    • SQL Server DBA Scripts
    • PostgreSQL DBA Scripts
    • MySQL DBA Scripts
    • Greenplum DBA Scripts
  • Home
  • Blog Archives !
  • (: Laugh@dbrnd :)
  • Contact Me !
sqlserverinterviews
Home 2016 December Database Design: Common Practices for Database Developers and Application Developers

Database Design: Common Practices for Database Developers and Application Developers

Database Design Best Practices

This article is half-done without your Comment! *** Please share your thoughts via Comment ***

In this post, I am sharing the list of common practices for Database Designing which should follow by Database Developers and Application Developers.

  • Foreign keys should have indexes on them, and it should often cover multiple columns base on the queries you need to execute.
  • You should make sure about the referential integrity by enforcing the Foreign Keys.
    Choose right column for CLUSTER Index.
  • You should apply proper indexes and do not create duplicate indexes and avoid creation of unnecessary indexes.
  • You should not put auto-number data type as a PRIMARY KEY to join a FOREIGN KEY in a parent/child table relationship.
  • If your system is running large number of INSERT/DELETE, you should avoid frequent update of database Statistics.
  • You should choose the write data-type for your data columns.
  • Please separate big size of columns from main table and store in a different table.
  • You should apply proper column name.
  • Use proper data types for Latitude, Longitude, IP-Address, Network Address, Mac Address.
  • Use Natural Primary key rather than Surrogate Primary key. Natural Primary keys are keys base on an external meaningful data. Surrogate Primary key are keys base on an auto-increment number or values which have no meaning outside the system.
  • You must use Stored Procedures or Stored Functions.
  • Please avoid too much database normalization and try to design your database to achieve Database Normalization + Database Denormalization. You should design this combination to achieve the performance.
  • Avoid inappropriate or excessive use of cursors.
  • Avoid inappropriate use of Database Transactions (BEGIN…COMMIT).
  • Try to avoid the use of OR condition because an AND condition restricts the data set, whereas an OR condition grows it.
  • You should do detailed performance analysis on queries.
  • Try to use the Prepared SQL Statement which caches the compiled query and the execution plan for better performance. It will also better protect you against SQL injection attacks.
  • Please do not simplify your complex queries through the views.
  • Please do not use DISTINCT frequently. Many developers are using DISTINCT to hide duplicate data, but you should stop and remove the duplicate data.
  • Try to avoid Correlated Subqueries.
  • Do not store comma delimited list in a table.
  • Do not store JSON data in TEXT COLUMN, you should use JSON data type for it.
  • Please do not use comma separated table names in SELECT query, use explicit JOINs conditions to avoid internal Cartesian products.

 
The list is not final yet, you guys can add/share a comment and make it final…

Dec 26, 2016Anvesh Patel
PostgreSQL: Increase the speed of UPDATE query using HOT UPDATE (Heap only tuple)SQL Server: Increase Query Performance using a Forced Parameterization
Anvesh Patel
Anvesh Patel

Database Engineer

ImageDecember 26, 2016 Database DesigningAnvesh Patel, Application Developer, Cluster Index, database, database concept, Database Design, Database Developer, database research and development, database standards, Database Theory, database topic, dbrnd, performance, Performance Optimization, RDBMS
About Me!

I'm Anvesh Patel, a Database Engineer certified by Oracle and IBM. I'm working as a Database Architect, Database Optimizer, Database Administrator, Database Developer. Providing the best articles and solutions for different problems in the best manner through my blogs is my passion. I have more than six years of experience with various RDBMS products like MSSQL Server, PostgreSQL, MySQL, Greenplum and currently learning and doing research on BIGData and NoSQL technology. -- Hyderabad, India.

About DBRND !

dbrnd

This is a personal blog (www.dbrnd.com).

Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in professional or personal capacity, unless explicitly stated.

Feel free to challenge me, disagree with me, or tell me I’m completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or anonymous comments) - so keep it polite.

The content of this website is protected by copyright. No portion of this website may be copied or replicated in any form without the written consent of the website owner.

Recent Comments !
  • Anvesh Patel { Sure will do... } – May 27, 12:43 PM
  • Anvesh Patel { Great... } – May 27, 12:41 PM
  • Anvesh Patel { Great... } – May 27, 12:39 PM
  • Anvesh Patel { Great... } – May 27, 12:36 PM
  • Anvesh Patel { Great... } – May 27, 12:28 PM
  • Anvesh Patel { Great... } – May 27, 12:27 PM
  • Anvesh Patel { Great... } – May 27, 12:16 PM
  • Older »
Follow Me !
  • facebook
  • linkedin
  • twitter
  • youtube
  • google
  • flickr
© 2015 – 2019 All rights reserved. Database Research & Development (dbrnd.com)
Posting....