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.
  • Sander RosselS Sander Rossel

    About five+ years back I normalized the hell out of databases, but I've come to realize a surprising amount of data needs to be stored redunantly anyway. Stuff like customer names and addresses on invoices, sales people's names on orders, etc. In the age of microservices every service needs to have the data it needs to do its thing. So I now even have multiple databases with the same data because multiple services operate on that data. Although I usually normalize my services as well... ;)

    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

    J Offline
    J Offline
    Jorgen Andersson
    wrote on last edited by
    #11

    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

    Sander RosselS E 2 Replies 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.

      C Offline
      C Offline
      CHill60
      wrote on last edited by
      #12

      Usually, and usually just down to 3NF, but with "an eye" to avoid going too far or going that step further. But very rarely these days do I get to do that sort of stuff - I'm stuck with what was someone else's idea of Good Database Structure. We disagree on what that looks like.

      L 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.

        P Offline
        P Offline
        PIEBALDconsult
        wrote on last edited by
        #13

        I would if I could. :-D In fact, I do as much as I can, which is limited and not always beneficial. But the issue is that my current primary task is simply ETLing data from various sources to our staging database. For that, it's usually best to just leave it as is. But, at times, I do split some data into child tables -- usually if the incoming data has been de-normalized such that a field contains delimited lists of values (yuck). It really depends on the needs of the next layer of the overall application, which often requires de-normalized data anyway. On those rare occasions when I create a database for a "proper" application, I normalize as required for the application. But I don't care about the definitions of the various normal forms; I leave that to the ivory tower types.

        L 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.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #14

          On the data entry / operational side, always; on the informational / query side, usually the opposite. Storage is cheap; time isn't.

          It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food

          L 1 Reply Last reply
          0
          • J Jorgen Andersson

            If I create it, yes. If it's inherited, maybe. But you should probably have asked to what form. I personally go for at least third, but usually not up to fifth. It depends on purpose.

            Wrong is evil and must be defeated. - Jeff Ello

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #15

            Jörgen Andersson wrote:

            But you should probably have asked to what form.

            If I need to ask that, then the answer is that there's usually no normalization.

            Jörgen Andersson wrote:

            I personally go for at least third, but usually not up to fifth. It depends on purpose.

            So it depends on purpose? :)

            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.

            1 Reply Last reply
            0
            • H honey the codewitch

              Looking it up (i had to) it looks like I typically use 3NF.

              Real programmers use butterflies

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #16

              honey the codewitch wrote:

              Looking it up (i had to)

              You'd do it on instinct, with butterflies :cool:

              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.

              H 1 Reply Last reply
              0
              • Sander RosselS Sander Rossel

                About five+ years back I normalized the hell out of databases, but I've come to realize a surprising amount of data needs to be stored redunantly anyway. Stuff like customer names and addresses on invoices, sales people's names on orders, etc. In the age of microservices every service needs to have the data it needs to do its thing. So I now even have multiple databases with the same data because multiple services operate on that data. Although I usually normalize my services as well... ;)

                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

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #17

                Sander Rossel wrote:

                In the age of microservices every service needs to have the data it needs to do its thing.

                Good point, those use a smaller dataset.

                Sander Rossel wrote:

                So I now even have multiple databases with the same data because multiple services operate on that data.

                Operating implies you doin' more than reading that data.

                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.

                Sander RosselS 1 Reply Last reply
                0
                • L Lost User

                  honey the codewitch wrote:

                  Looking it up (i had to)

                  You'd do it on instinct, with butterflies :cool:

                  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.

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

                  I do. That's why I had to look it up. I never learned it formally. I just learned "construct a database in a way that maintains integrity and is sane enough for the application to survive for awhile"

                  Real programmers use butterflies

                  L 1 Reply Last reply
                  0
                  • D dandy72

                    What if my databases are _ab_normal?

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #19

                    Your database, not mine. Do as you like :)

                    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.

                    1 Reply Last reply
                    0
                    • C CHill60

                      Usually, and usually just down to 3NF, but with "an eye" to avoid going too far or going that step further. But very rarely these days do I get to do that sort of stuff - I'm stuck with what was someone else's idea of Good Database Structure. We disagree on what that looks like.

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #20

                      CHill60 wrote:

                      I'm stuck with what was someone else's idea of Good Database Structure

                      That's why we normalize. One of my "betters" once introduced a table that held a varchar(31) with 0's and 1's. Representing booleans. Queries where horrid and slow.

                      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.

                      P 1 Reply Last reply
                      0
                      • L Lost User

                        CHill60 wrote:

                        I'm stuck with what was someone else's idea of Good Database Structure

                        That's why we normalize. One of my "betters" once introduced a table that held a varchar(31) with 0's and 1's. Representing booleans. Queries where horrid and slow.

                        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.

                        P Offline
                        P Offline
                        PIEBALDconsult
                        wrote on last edited by
                        #21

                        Eddy Vluggen wrote:

                        ntroduced a table that held a varchar(31) with 0's and 1's.

                        I had a colleague who used 1s and 8s -- because he couldn't get 0s to work correctly. :sigh:

                        L 1 Reply Last reply
                        0
                        • P PIEBALDconsult

                          I would if I could. :-D In fact, I do as much as I can, which is limited and not always beneficial. But the issue is that my current primary task is simply ETLing data from various sources to our staging database. For that, it's usually best to just leave it as is. But, at times, I do split some data into child tables -- usually if the incoming data has been de-normalized such that a field contains delimited lists of values (yuck). It really depends on the needs of the next layer of the overall application, which often requires de-normalized data anyway. On those rare occasions when I create a database for a "proper" application, I normalize as required for the application. But I don't care about the definitions of the various normal forms; I leave that to the ivory tower types.

                          L Offline
                          L Offline
                          Lost User
                          wrote on last edited by
                          #22

                          PIEBALDconsult wrote:

                          But I don't care about the definitions of the various normal forms; I leave that to the ivory tower types.

                          They're not under debate in the tower. The definitions didn't change. It's not C#.

                          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.

                          1 Reply Last reply
                          0
                          • L Lost User

                            On the data entry / operational side, always; on the informational / query side, usually the opposite. Storage is cheap; time isn't.

                            It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food

                            L Offline
                            L Offline
                            Lost User
                            wrote on last edited by
                            #23

                            This about how to store. No difference in entry or query.

                            Gerry Schmitz wrote:

                            Storage is cheap; time isn't.

                            Time is not a factor here; this is about being correct. As in, making sure the data you return is correct. It also not just applies to databases, but is general theory about information. Even applies to some lists, or dictionaries :)

                            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.

                            1 Reply Last reply
                            0
                            • P PIEBALDconsult

                              Eddy Vluggen wrote:

                              ntroduced a table that held a varchar(31) with 0's and 1's.

                              I had a colleague who used 1s and 8s -- because he couldn't get 0s to work correctly. :sigh:

                              L Offline
                              L Offline
                              Lost User
                              wrote on last edited by
                              #24

                              This is why fights start in the office.

                              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.

                              1 Reply Last reply
                              0
                              • H honey the codewitch

                                I do. That's why I had to look it up. I never learned it formally. I just learned "construct a database in a way that maintains integrity and is sane enough for the application to survive for awhile"

                                Real programmers use butterflies

                                L Offline
                                L Offline
                                Lost User
                                wrote on last edited by
                                #25

                                honey the codewitch wrote:

                                I do. That's why I had to look it up. I never learned it formally.

                                It does sound like I'm attacking. My apologies.

                                honey the codewitch wrote:

                                construct a database in a way that maintains integrity

                                You'd laugh and go "that's soo obvious".

                                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.

                                H 1 Reply Last reply
                                0
                                • L Lost User

                                  honey the codewitch wrote:

                                  I do. That's why I had to look it up. I never learned it formally.

                                  It does sound like I'm attacking. My apologies.

                                  honey the codewitch wrote:

                                  construct a database in a way that maintains integrity

                                  You'd laugh and go "that's soo obvious".

                                  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.

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

                                  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 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

                                    L Offline
                                    L Offline
                                    Lost User
                                    wrote on last edited by
                                    #27

                                    honey the codewitch wrote:

                                    The Right Way(TM) to do things.

                                    Math.

                                    honey the codewitch wrote:

                                    And if I'm wrong then I got paid a whole lot of money to be wrong

                                    Yeah. Happy my surgeon isn't like that :thumbsup:

                                    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.

                                    Sander RosselS 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.

                                      D Offline
                                      D Offline
                                      DerekT P
                                      wrote on last edited by
                                      #28

                                      Normally I do, yes. But not if I don't feel like it's going to be worth the hassle now vs benefits later.

                                      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.

                                        C Offline
                                        C Offline
                                        Charl
                                        wrote on last edited by
                                        #29

                                        How long is a piece of string - requirements would dictate NF compliance.

                                        1 Reply Last reply
                                        0
                                        • D dandy72

                                          What if my databases are _ab_normal?

                                          C Offline
                                          C Offline
                                          Chris Nicolatos
                                          wrote on last edited by
                                          #30

                                          Is your name Marty Feldman?

                                          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