Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Normalization

Normalization

Scheduled Pinned Locked Moved The Lounge
question
48 Posts 21 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Lost User

    How many here normalize their databases?

    Bastard Programmer from Hell :suss: "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

    M Offline
    M Offline
    Moo v This
    wrote on last edited by
    #37

    A wise man told me once: normalize till it hurts, then denormalize until it works. My app are mostly transactional and I don't see any other way then to have denormalized data.

    1 Reply Last reply
    0
    • L Lost User

      How many here normalize their databases?

      Bastard Programmer from Hell :suss: "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

      E Offline
      E Offline
      ElectronProgrammer
      wrote on last edited by
      #38

      I usually do not unless it is specifically requested by the project/boss because I tend to favor performance over conformance to normalization. To avoid data duplication or making a messy DB, I rely on my instinct and experience designing databases. But my DBs (for production) are usually built in layers and normalization only applies to the bottom (data) layer. On top of that are usually performance layers like "history request cache" for each client, cached queries (for full/partial queries that are required by other queries, usually per client), filters for queries (usually temporary tables with partial data), etc. And, before someone asks, yes those layers are implemented in the database (using SQL) where data is readily available and protected. And time is not wasted transferring data to some app while, in the process, creating a vulnerability in the database.

      1 Reply Last reply
      0
      • H honey the codewitch

        I didn't take it as an attack, no worries. I figured I just needed to clarify. I learned DBs in the .com boom days when it was a free for all. I attempted to impose some order on the mess. All I got for my efforts typically was put in charge of databases - something i didn't want to be in charge of. And then there was the time when I worked with a self taught developer who built out an entire ecommerce platform, front and back end, including a jquery-like (but *not jquery :~ :mad:) engine for the front end. Rather than doing JOINs in the database he was doing them in PHP on the webserver. I taught him SQL. Then I quit.

        Real programmers use butterflies

        E Offline
        E Offline
        ElectronProgrammer
        wrote on last edited by
        #39

        honey the codewitch wrote:

        Rather than doing JOINs in the database he was doing them in PHP on the webserver

        I had a colleague like that once. He was transferring two 100G entries tables (+-50 columns each) to PHP to do joins using for loops. It was killing the server and taking almost a week to process. The boss only noticed when he requested a new, more powerful server (our server was brand new). Boss told me to converted it to SQL and it started taking less than an hour to do the same join ;P That colleague quit the project soon after that.

        D 1 Reply Last reply
        0
        • L Lost User

          How many here normalize their databases?

          Bastard Programmer from Hell :suss: "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

          B Offline
          B Offline
          Bruce Patin
          wrote on last edited by
          #40

          I almost always use third normal form to begin with and keep it that way unless there are performance problems.

          1 Reply Last reply
          0
          • L Lost User

            How many here normalize their databases?

            Bastard Programmer from Hell :suss: "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

            M Offline
            M Offline
            MSBassSinger
            wrote on last edited by
            #41

            During design, I normalize to the optimum end, the denormalize where necessary for performance. I've been following that process since I started in databases back in the late 80s. Of equal importance is knowing what to index on, and how to keep indexing and PK-FK relationships from getting out of hand to where performance and supportability become a problem.

            1 Reply Last reply
            0
            • E ElectronProgrammer

              honey the codewitch wrote:

              Rather than doing JOINs in the database he was doing them in PHP on the webserver

              I had a colleague like that once. He was transferring two 100G entries tables (+-50 columns each) to PHP to do joins using for loops. It was killing the server and taking almost a week to process. The boss only noticed when he requested a new, more powerful server (our server was brand new). Boss told me to converted it to SQL and it started taking less than an hour to do the same join ;P That colleague quit the project soon after that.

              D Offline
              D Offline
              Daniel Pfeffer
              wrote on last edited by
              #42

              ElectronProgrammer wrote:

              That colleague quit the project soon after that.

              Did he fall, or was he pushed? :-\

              Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.

              E 1 Reply Last reply
              0
              • H honey the codewitch

                That's true, and given the amount of space to work with that we have these days, and how good databases are at doing batch data conversion and such, there really isn't a good reason to avoid redundant data if it makes things easier or more efficient. You just have to be careful not to go crazy with it, and you have to keep in mind that it can make your database more "brittle" because its more fields that need to be proofed/validated for correctness. Keeping redundant data in sync is a chore unto itself. But yes yes yes to this. Redundant data is okay, when it serves a purpose, often for performance or integration purposes it is The Right Way(TM) to do things. And if I'm wrong then I got paid a whole lot of money to be wrong, and a lot of people happy with how wrong I was. :laugh:

                Real programmers use butterflies

                R Offline
                R Offline
                Roger House
                wrote on last edited by
                #43

                But don't forget what Edsger Dijstra once said: If you say the same thing twice, you will contradict yourself.

                H 1 Reply Last reply
                0
                • D Daniel Pfeffer

                  ElectronProgrammer wrote:

                  That colleague quit the project soon after that.

                  Did he fall, or was he pushed? :-\

                  Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.

                  E Offline
                  E Offline
                  ElectronProgrammer
                  wrote on last edited by
                  #44

                  He fell. It wasn't his only mistake. I tried to give him an hand but he took the arm to harm (he had a PhD and I had a licenciate degree*). I would rather have him there than ending overworked and underpaid as I did. I guess the corporate reality train was to heavy for him :sigh: * That degree is one below masters and one above bachelor in pre-bologna process which was my case

                  1 Reply Last reply
                  0
                  • R Roger House

                    But don't forget what Edsger Dijstra once said: If you say the same thing twice, you will contradict yourself.

                    H Offline
                    H Offline
                    honey the codewitch
                    wrote on last edited by
                    #45

                    Not if you say it properly. *hides*

                    Real programmers use butterflies

                    1 Reply Last reply
                    0
                    • Sander RosselS Sander Rossel

                      Eddy Vluggen wrote:

                      Math.

                      NoMATH (for clarity, Not Only Math) :rolleyes: Actually, that math was failing with big enough datasets, which is why NoSQL was (re-)invented. So the right way to do things went from "normalize everything" to "denormalize a good bunch." We've seen the opposite happen to peanut butter.

                      Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript

                      E Offline
                      E Offline
                      englebart
                      wrote on last edited by
                      #46

                      I find No SQL kind of funny as it is one of those cyclic patterns. In the same vein with centralized versus distributed.

                      Sander RosselS 1 Reply Last reply
                      0
                      • J Jorgen Andersson

                        When you're talking about redundant storage, are you referring to data aggregated from single points of origin or an uncontrolled mess?

                        Wrong is evil and must be defeated. - Jeff Ello

                        E Offline
                        E Offline
                        englebart
                        wrote on last edited by
                        #47

                        And some redundancy is not really redundant, it is the historical context that needs to be saved. The invoice earlier is a good example. If the company changes its name or moves it’s HQ, you do not want the invoice to update. The best part is when there are M/A and divestitures among your client base. At a high enough altitude, it looks like a game of Life cellular generational display.

                        1 Reply Last reply
                        0
                        • E englebart

                          I find No SQL kind of funny as it is one of those cyclic patterns. In the same vein with centralized versus distributed.

                          Sander RosselS Offline
                          Sander RosselS Offline
                          Sander Rossel
                          wrote on last edited by
                          #48

                          Before SQL, which didn't become popular until the 80's, there was only not SQL :rolleyes:

                          Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups