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 March Database Theory: The truth about Universally Unique Identifier – UUID

Database Theory: The truth about Universally Unique Identifier – UUID

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

I am Sharing an important theory for all Database Architects and Designers.

We are following a common practice for creating a sequential, unique number for a database system.

The best practice is to create a primary integer key for every table which represents the tuples.
But you should also know about UUID.
You can visit this article on The truth about Primary Key.

What is UUID and How it generates Unique Number?

UUID – Universally Unique Identifier has also stand as a unique string.

A UUID is a 128-bit number, and it used to identify different type of entities uniquely.
The computation of the UUID is quick and easy to generate an ID which can be reasonably assumed to be universally unique.

The UUID is globally unique because it contains a unique combination of the network address, the timestamp of the transaction and other component details.
The network address and timestamp of the transaction are enough to ensure uniqueness.

Example, The standard form of UUID. It is total of 32 digits and representing the 128 bits.

1
c0acbc88-9q0b-4hq3-cc6u-8pp9er188a33

Why we require UUID?

When we are working in the distributed environment system, we need UUID which identifies the integrated data from the different systems.

For example,
We have two systems, System A and System B. Now I want to import some data from System A to System B without changing an ID of the source system. System B has already set of stored IDs which might conflict with System A IDs.

The UUID solves the above problem.

If the system is not online, the offline user also can generate a UUID at the client side for few operations.

A UUID always unique for all the systems which reside in a distributed environment.

For Example,
System A inserts a record with ID 10 and at the same time System B also inserts a record with ID 10.
Now, this is a collision.
The UUID solves this problem.

If the system is accessed by multiple threads, each thread has to wait for new IDs.
A UUID also solve this problem because it does not depend on the previously generated key.

We can generate trillions of UUID in a year and it has very less chance of duplication.

If we recreate a Database or Table, again sequential ID starts from 1. In this kind of situations, we can use UUID.

Other limitations:

The index fragmentation is one of the major drawbacks of using UUID random keys.

We should not use UUID as a Primary key of a table. Still, I would suggest you create an integer sequential primary key and create a separate column for UUID.

Mar 2, 2016Anvesh Patel
PostgreSQL: Best way for Password Encryption using pgcrypto's Cryptographic functionsPostgreSQL: Working with Universally Unique Identifier - UUID Data type
Comments: 7
  1. Jenny
    March 10, 2016 at 12:25 pm

    Hello.This article was really interesting, especially since I was browsing for thoughts on this subject last Tuesday.

  2. Tod
    March 10, 2016 at 1:39 pm

    Normally I do not read article on blogs, but I wish to say that this write-up very forced me to try and do so! Your writing style has been surprised me. Thanks, quite nice article.

  3. Mark
    March 12, 2016 at 9:19 pm

    Hi there to every one, for the reason that I am actually keen of reading this webpage post to be updated daily. It contains good material.

  4. Monika
    March 15, 2016 at 5:34 pm

    Hi my loved one! I want to say that this article is awesome, nice written and include approximately all significant infos. Iˇd like to see more posts like this . 🙂

  5. Suuo
    April 22, 2016 at 2:42 am

    Hi there to every one, since I am truly eager of reading this webpage post to be updated on a regular basis. It carries nice stuff.

  6. barry
    April 24, 2016 at 2:29 am

    great submit, very informative. I ponder why the other specialists of this sector do not realize this. You should continue your writing. I’m sure, you’ve a great readers’ base already!

  7. oakly
    May 8, 2016 at 7:51 pm

    hi!,I really like your writing very so much! proportion we keep up a correspondence more approximately your post on AOL? I require an expert on this space to unravel my problem. May be that is you! Having a look ahead to look you.

Anvesh Patel
Anvesh Patel

Database Engineer

March 2, 2016 Database TheoryAnvesh Patel, database, database concept, database research and development, database standards, Database Theory, database topic, dbrnd, RDBMS, Universally Unique Identifier, UUID
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....