How to model public IDs?Data model for persisting queries to databaseHow to Design Database with User-Contributed ContentGeneration of ids in offline/online applicationSuggested method for “simplifying” EAVSource code related information should be stored in database or file?How can I model unknown and an unknown number of attributes on an object?How to create a db schema for “if this then… elseif … elseif …” and so on?Architecture - Whether/Where to store 3rd party IDsUML how to model parallel activity with runtime-dependent number of participantsAdvice on how to model my microservices

What (else) happened July 1st 1858 in London?

Create all possible words using a set or letters

Is XSS in canonical link possible?

Transformation of random variables and joint distributions

How do I implement a file system driver driver in Linux?

My friend sent me a screenshot of a transaction hash, but when I search for it I find divergent data. What happened?

We have a love-hate relationship

Has Darkwing Duck ever met Scrooge McDuck?

Can the Supreme Court overturn an impeachment?

Diode in opposite direction?

How can Trident be so inexpensive? Will it orbit Triton or just do a (slow) flyby?

How must one send away the mother bird?

Proving a function is onto where f(x)=|x|.

Do the concepts of IP address and network interface not belong to the same layer?

Should I install hardwood flooring or cabinets first?

Drawing a topological "handle" with Tikz

Can I use my Chinese passport to enter China after I acquired another citizenship?

Can somebody explain Brexit in a few child-proof sentences?

How can "mimic phobia" be cured or prevented?

If a character with the Alert feat rolls a crit fail on their Perception check, are they surprised?

Can we have a perfect cadence in a minor key?

Longest common substring in linear time

Did US corporations pay demonstrators in the German demonstrations against article 13?

Proof of Lemma: Every nonzero integer can be written as a product of primes



How to model public IDs?


Data model for persisting queries to databaseHow to Design Database with User-Contributed ContentGeneration of ids in offline/online applicationSuggested method for “simplifying” EAVSource code related information should be stored in database or file?How can I model unknown and an unknown number of attributes on an object?How to create a db schema for “if this then… elseif … elseif …” and so on?Architecture - Whether/Where to store 3rd party IDsUML how to model parallel activity with runtime-dependent number of participantsAdvice on how to model my microservices













6















While creating the architecture of a new project I struggle to come up with a good solution to handle public IDs.
For example our users will receive a membership card. Each card has the membership ID printed on it. But because in our branch of industry we expect cooperation with other businesses the format of those membership IDs may change in future, or we will use additional IDs.



Surely the membership ID is not the internal database primary key or something like this.



These are the two options I came up:



  • The membership ID is a property of the user model.

    • It is easy to query.

    • But then we have to change the model and the database schema each time we have a new format.


  • The membership ID has its own model which references the user model

    • This is easy to extend.

    • But then we have to join two tables for (more or less) each query


I know it depends strongly on many factors for which this question is to short to mention all, but is it bad practice to expect database schema changes instead of explicitly modelling this kind of flexibility. I mean this will only happen once in few years.



Or do you have some other ideas?










share|improve this question


























    6















    While creating the architecture of a new project I struggle to come up with a good solution to handle public IDs.
    For example our users will receive a membership card. Each card has the membership ID printed on it. But because in our branch of industry we expect cooperation with other businesses the format of those membership IDs may change in future, or we will use additional IDs.



    Surely the membership ID is not the internal database primary key or something like this.



    These are the two options I came up:



    • The membership ID is a property of the user model.

      • It is easy to query.

      • But then we have to change the model and the database schema each time we have a new format.


    • The membership ID has its own model which references the user model

      • This is easy to extend.

      • But then we have to join two tables for (more or less) each query


    I know it depends strongly on many factors for which this question is to short to mention all, but is it bad practice to expect database schema changes instead of explicitly modelling this kind of flexibility. I mean this will only happen once in few years.



    Or do you have some other ideas?










    share|improve this question
























      6












      6








      6








      While creating the architecture of a new project I struggle to come up with a good solution to handle public IDs.
      For example our users will receive a membership card. Each card has the membership ID printed on it. But because in our branch of industry we expect cooperation with other businesses the format of those membership IDs may change in future, or we will use additional IDs.



      Surely the membership ID is not the internal database primary key or something like this.



      These are the two options I came up:



      • The membership ID is a property of the user model.

        • It is easy to query.

        • But then we have to change the model and the database schema each time we have a new format.


      • The membership ID has its own model which references the user model

        • This is easy to extend.

        • But then we have to join two tables for (more or less) each query


      I know it depends strongly on many factors for which this question is to short to mention all, but is it bad practice to expect database schema changes instead of explicitly modelling this kind of flexibility. I mean this will only happen once in few years.



      Or do you have some other ideas?










      share|improve this question














      While creating the architecture of a new project I struggle to come up with a good solution to handle public IDs.
      For example our users will receive a membership card. Each card has the membership ID printed on it. But because in our branch of industry we expect cooperation with other businesses the format of those membership IDs may change in future, or we will use additional IDs.



      Surely the membership ID is not the internal database primary key or something like this.



      These are the two options I came up:



      • The membership ID is a property of the user model.

        • It is easy to query.

        • But then we have to change the model and the database schema each time we have a new format.


      • The membership ID has its own model which references the user model

        • This is easy to extend.

        • But then we have to join two tables for (more or less) each query


      I know it depends strongly on many factors for which this question is to short to mention all, but is it bad practice to expect database schema changes instead of explicitly modelling this kind of flexibility. I mean this will only happen once in few years.



      Or do you have some other ideas?







      architecture database-design modeling






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 15 at 23:02









      ObenlandObenland

      1619




      1619




















          3 Answers
          3






          active

          oldest

          votes


















          16














          You cannot look into the future - accept that. So better go ahead with a simple, but sufficient solution for today, and add more complexity when you know the requirements, not beforehand.



          If you invest too much design efforts into things which you will expect to happen "once in few years", and you don't know yet how the precise requirements will look then, there is a high risk of overdesign those things. Worse, there is a high risk of designing something which will make adding those unknown future requirements actually harder, because they don't look like you envisioned them.



          So if you can design the membership ID as an attribute of the user, as a free form string, and this is sufficient for today, then go ahead. If, in a few years you really "need to change the model and the database schema" - then Alas, do it, that will not be the end of the world, it may require some effort, but it is quite unlikely that have to throw away your system and start from zero because of this.



          Maybe it turns out even if the format changes, the user attribute in your database scheme is still sufficient, and you only need to change some validation rules in the application. Maybe it turns out there is second membership ID necessary. Maybe it turns out the membership ID needs a time stamp, or it has to be split-up into a combined ID, or it has to match data from an external system, or the ID generation has to become decentralized, or it will not be required any more at all, who knows? You cannot design a system for all thinkable "maybes", so do yourself a favor and don't try it.






          share|improve this answer
































            9














            You're right; the membership ID is not part of your Primary Key. That's why synthetic keys exist.



            A synthetic key is one that is automatically generated, either by you or the database. It usually takes the form of either an incrementing number or a globally-unique identifier. Synthetic keys are never re-used, even if a record is deleted. The good ones are guaranteed to be unique across the entire database, or even across any database.



            Synthetic keys don't take on any characteristics of the data they represent. They are, in fact, completely independent of your data, except for the relationships they impart by matching with foreign keys in your other tables.



            In short, synthetic keys don't suffer from any of the problems that other kinds of keys do. Each and every one of your tables should contain a synthetic primary key and relationships defined by joining those keys to corresponding foreign keys in other tables.



            Naturally, you can add other fields like Membership ID. Avoid using these fields in table relationships, however, except possibly as joins in ad-hoc queries.



            Changes to database schemas do happen, but usually only in response to new business requirements. The most common changes made to production databases is that tables or fields are added.






            share|improve this answer




















            • 1





              Thank you for mentioning „synthetic keys“. It helps a lot to have the right keywords to search for. 👍

              – Obenland
              Mar 17 at 12:53


















            3














            As for good/bad practice in this case, that is mostly subjective, because it depends on factors concerning the application(s) and data.



            For example, if you were only to have one business for the initial product launch, and there are no schedules or plans to add other businesses, then there isn't a point to come up with a design that fits accounting for any other businesses.



            In trying to plan for multiples, there is the possibility that some additional business does not have the same concept of member as the original business. There are other pitfalls with this route, such as modifying functionality for members based on a request from business "B" then business "A" has member functionality that is not expected or removed. (the first option has more potential to be in the scenario of the example)



            For the second option, it could work, but I would still be hesitant, since this is supposed to be a new project. There would be some difficulty in determining shared functionality/properties. Depending on the implementation, there are more opportunities for duplicating code or masking functionality across each member/business.



            Let's say that you did have "all" of the requirements for adding new businesses:



            Assuming that this project/some other project in your area determines the member id, it does not make sense to have member id be the same internally and externally. If the is any functionality based on the contents of member id, then that functionality has the chance to be broken (EX: not being able to work with historic records, or records that happen to span the dates before and after a change)



            Typically, you would want to have some form of Internal Id and External Id. In your case, you could have something like Internal Id: 1234; Business A External Id: M001; Business B External ID : UM001; . Unless you just have a fairly large amount of entries per member or per business, joining multiple tables shouldn't affect performance by much.






            share|improve this answer






















              Your Answer








              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "131"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsoftwareengineering.stackexchange.com%2fquestions%2f388721%2fhow-to-model-public-ids%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              16














              You cannot look into the future - accept that. So better go ahead with a simple, but sufficient solution for today, and add more complexity when you know the requirements, not beforehand.



              If you invest too much design efforts into things which you will expect to happen "once in few years", and you don't know yet how the precise requirements will look then, there is a high risk of overdesign those things. Worse, there is a high risk of designing something which will make adding those unknown future requirements actually harder, because they don't look like you envisioned them.



              So if you can design the membership ID as an attribute of the user, as a free form string, and this is sufficient for today, then go ahead. If, in a few years you really "need to change the model and the database schema" - then Alas, do it, that will not be the end of the world, it may require some effort, but it is quite unlikely that have to throw away your system and start from zero because of this.



              Maybe it turns out even if the format changes, the user attribute in your database scheme is still sufficient, and you only need to change some validation rules in the application. Maybe it turns out there is second membership ID necessary. Maybe it turns out the membership ID needs a time stamp, or it has to be split-up into a combined ID, or it has to match data from an external system, or the ID generation has to become decentralized, or it will not be required any more at all, who knows? You cannot design a system for all thinkable "maybes", so do yourself a favor and don't try it.






              share|improve this answer





























                16














                You cannot look into the future - accept that. So better go ahead with a simple, but sufficient solution for today, and add more complexity when you know the requirements, not beforehand.



                If you invest too much design efforts into things which you will expect to happen "once in few years", and you don't know yet how the precise requirements will look then, there is a high risk of overdesign those things. Worse, there is a high risk of designing something which will make adding those unknown future requirements actually harder, because they don't look like you envisioned them.



                So if you can design the membership ID as an attribute of the user, as a free form string, and this is sufficient for today, then go ahead. If, in a few years you really "need to change the model and the database schema" - then Alas, do it, that will not be the end of the world, it may require some effort, but it is quite unlikely that have to throw away your system and start from zero because of this.



                Maybe it turns out even if the format changes, the user attribute in your database scheme is still sufficient, and you only need to change some validation rules in the application. Maybe it turns out there is second membership ID necessary. Maybe it turns out the membership ID needs a time stamp, or it has to be split-up into a combined ID, or it has to match data from an external system, or the ID generation has to become decentralized, or it will not be required any more at all, who knows? You cannot design a system for all thinkable "maybes", so do yourself a favor and don't try it.






                share|improve this answer



























                  16












                  16








                  16







                  You cannot look into the future - accept that. So better go ahead with a simple, but sufficient solution for today, and add more complexity when you know the requirements, not beforehand.



                  If you invest too much design efforts into things which you will expect to happen "once in few years", and you don't know yet how the precise requirements will look then, there is a high risk of overdesign those things. Worse, there is a high risk of designing something which will make adding those unknown future requirements actually harder, because they don't look like you envisioned them.



                  So if you can design the membership ID as an attribute of the user, as a free form string, and this is sufficient for today, then go ahead. If, in a few years you really "need to change the model and the database schema" - then Alas, do it, that will not be the end of the world, it may require some effort, but it is quite unlikely that have to throw away your system and start from zero because of this.



                  Maybe it turns out even if the format changes, the user attribute in your database scheme is still sufficient, and you only need to change some validation rules in the application. Maybe it turns out there is second membership ID necessary. Maybe it turns out the membership ID needs a time stamp, or it has to be split-up into a combined ID, or it has to match data from an external system, or the ID generation has to become decentralized, or it will not be required any more at all, who knows? You cannot design a system for all thinkable "maybes", so do yourself a favor and don't try it.






                  share|improve this answer















                  You cannot look into the future - accept that. So better go ahead with a simple, but sufficient solution for today, and add more complexity when you know the requirements, not beforehand.



                  If you invest too much design efforts into things which you will expect to happen "once in few years", and you don't know yet how the precise requirements will look then, there is a high risk of overdesign those things. Worse, there is a high risk of designing something which will make adding those unknown future requirements actually harder, because they don't look like you envisioned them.



                  So if you can design the membership ID as an attribute of the user, as a free form string, and this is sufficient for today, then go ahead. If, in a few years you really "need to change the model and the database schema" - then Alas, do it, that will not be the end of the world, it may require some effort, but it is quite unlikely that have to throw away your system and start from zero because of this.



                  Maybe it turns out even if the format changes, the user attribute in your database scheme is still sufficient, and you only need to change some validation rules in the application. Maybe it turns out there is second membership ID necessary. Maybe it turns out the membership ID needs a time stamp, or it has to be split-up into a combined ID, or it has to match data from an external system, or the ID generation has to become decentralized, or it will not be required any more at all, who knows? You cannot design a system for all thinkable "maybes", so do yourself a favor and don't try it.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Mar 16 at 8:54

























                  answered Mar 16 at 0:15









                  Doc BrownDoc Brown

                  136k23250403




                  136k23250403























                      9














                      You're right; the membership ID is not part of your Primary Key. That's why synthetic keys exist.



                      A synthetic key is one that is automatically generated, either by you or the database. It usually takes the form of either an incrementing number or a globally-unique identifier. Synthetic keys are never re-used, even if a record is deleted. The good ones are guaranteed to be unique across the entire database, or even across any database.



                      Synthetic keys don't take on any characteristics of the data they represent. They are, in fact, completely independent of your data, except for the relationships they impart by matching with foreign keys in your other tables.



                      In short, synthetic keys don't suffer from any of the problems that other kinds of keys do. Each and every one of your tables should contain a synthetic primary key and relationships defined by joining those keys to corresponding foreign keys in other tables.



                      Naturally, you can add other fields like Membership ID. Avoid using these fields in table relationships, however, except possibly as joins in ad-hoc queries.



                      Changes to database schemas do happen, but usually only in response to new business requirements. The most common changes made to production databases is that tables or fields are added.






                      share|improve this answer




















                      • 1





                        Thank you for mentioning „synthetic keys“. It helps a lot to have the right keywords to search for. 👍

                        – Obenland
                        Mar 17 at 12:53















                      9














                      You're right; the membership ID is not part of your Primary Key. That's why synthetic keys exist.



                      A synthetic key is one that is automatically generated, either by you or the database. It usually takes the form of either an incrementing number or a globally-unique identifier. Synthetic keys are never re-used, even if a record is deleted. The good ones are guaranteed to be unique across the entire database, or even across any database.



                      Synthetic keys don't take on any characteristics of the data they represent. They are, in fact, completely independent of your data, except for the relationships they impart by matching with foreign keys in your other tables.



                      In short, synthetic keys don't suffer from any of the problems that other kinds of keys do. Each and every one of your tables should contain a synthetic primary key and relationships defined by joining those keys to corresponding foreign keys in other tables.



                      Naturally, you can add other fields like Membership ID. Avoid using these fields in table relationships, however, except possibly as joins in ad-hoc queries.



                      Changes to database schemas do happen, but usually only in response to new business requirements. The most common changes made to production databases is that tables or fields are added.






                      share|improve this answer




















                      • 1





                        Thank you for mentioning „synthetic keys“. It helps a lot to have the right keywords to search for. 👍

                        – Obenland
                        Mar 17 at 12:53













                      9












                      9








                      9







                      You're right; the membership ID is not part of your Primary Key. That's why synthetic keys exist.



                      A synthetic key is one that is automatically generated, either by you or the database. It usually takes the form of either an incrementing number or a globally-unique identifier. Synthetic keys are never re-used, even if a record is deleted. The good ones are guaranteed to be unique across the entire database, or even across any database.



                      Synthetic keys don't take on any characteristics of the data they represent. They are, in fact, completely independent of your data, except for the relationships they impart by matching with foreign keys in your other tables.



                      In short, synthetic keys don't suffer from any of the problems that other kinds of keys do. Each and every one of your tables should contain a synthetic primary key and relationships defined by joining those keys to corresponding foreign keys in other tables.



                      Naturally, you can add other fields like Membership ID. Avoid using these fields in table relationships, however, except possibly as joins in ad-hoc queries.



                      Changes to database schemas do happen, but usually only in response to new business requirements. The most common changes made to production databases is that tables or fields are added.






                      share|improve this answer















                      You're right; the membership ID is not part of your Primary Key. That's why synthetic keys exist.



                      A synthetic key is one that is automatically generated, either by you or the database. It usually takes the form of either an incrementing number or a globally-unique identifier. Synthetic keys are never re-used, even if a record is deleted. The good ones are guaranteed to be unique across the entire database, or even across any database.



                      Synthetic keys don't take on any characteristics of the data they represent. They are, in fact, completely independent of your data, except for the relationships they impart by matching with foreign keys in your other tables.



                      In short, synthetic keys don't suffer from any of the problems that other kinds of keys do. Each and every one of your tables should contain a synthetic primary key and relationships defined by joining those keys to corresponding foreign keys in other tables.



                      Naturally, you can add other fields like Membership ID. Avoid using these fields in table relationships, however, except possibly as joins in ad-hoc queries.



                      Changes to database schemas do happen, but usually only in response to new business requirements. The most common changes made to production databases is that tables or fields are added.







                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Mar 16 at 23:11

























                      answered Mar 16 at 4:38









                      Robert HarveyRobert Harvey

                      166k42383597




                      166k42383597







                      • 1





                        Thank you for mentioning „synthetic keys“. It helps a lot to have the right keywords to search for. 👍

                        – Obenland
                        Mar 17 at 12:53












                      • 1





                        Thank you for mentioning „synthetic keys“. It helps a lot to have the right keywords to search for. 👍

                        – Obenland
                        Mar 17 at 12:53







                      1




                      1





                      Thank you for mentioning „synthetic keys“. It helps a lot to have the right keywords to search for. 👍

                      – Obenland
                      Mar 17 at 12:53





                      Thank you for mentioning „synthetic keys“. It helps a lot to have the right keywords to search for. 👍

                      – Obenland
                      Mar 17 at 12:53











                      3














                      As for good/bad practice in this case, that is mostly subjective, because it depends on factors concerning the application(s) and data.



                      For example, if you were only to have one business for the initial product launch, and there are no schedules or plans to add other businesses, then there isn't a point to come up with a design that fits accounting for any other businesses.



                      In trying to plan for multiples, there is the possibility that some additional business does not have the same concept of member as the original business. There are other pitfalls with this route, such as modifying functionality for members based on a request from business "B" then business "A" has member functionality that is not expected or removed. (the first option has more potential to be in the scenario of the example)



                      For the second option, it could work, but I would still be hesitant, since this is supposed to be a new project. There would be some difficulty in determining shared functionality/properties. Depending on the implementation, there are more opportunities for duplicating code or masking functionality across each member/business.



                      Let's say that you did have "all" of the requirements for adding new businesses:



                      Assuming that this project/some other project in your area determines the member id, it does not make sense to have member id be the same internally and externally. If the is any functionality based on the contents of member id, then that functionality has the chance to be broken (EX: not being able to work with historic records, or records that happen to span the dates before and after a change)



                      Typically, you would want to have some form of Internal Id and External Id. In your case, you could have something like Internal Id: 1234; Business A External Id: M001; Business B External ID : UM001; . Unless you just have a fairly large amount of entries per member or per business, joining multiple tables shouldn't affect performance by much.






                      share|improve this answer



























                        3














                        As for good/bad practice in this case, that is mostly subjective, because it depends on factors concerning the application(s) and data.



                        For example, if you were only to have one business for the initial product launch, and there are no schedules or plans to add other businesses, then there isn't a point to come up with a design that fits accounting for any other businesses.



                        In trying to plan for multiples, there is the possibility that some additional business does not have the same concept of member as the original business. There are other pitfalls with this route, such as modifying functionality for members based on a request from business "B" then business "A" has member functionality that is not expected or removed. (the first option has more potential to be in the scenario of the example)



                        For the second option, it could work, but I would still be hesitant, since this is supposed to be a new project. There would be some difficulty in determining shared functionality/properties. Depending on the implementation, there are more opportunities for duplicating code or masking functionality across each member/business.



                        Let's say that you did have "all" of the requirements for adding new businesses:



                        Assuming that this project/some other project in your area determines the member id, it does not make sense to have member id be the same internally and externally. If the is any functionality based on the contents of member id, then that functionality has the chance to be broken (EX: not being able to work with historic records, or records that happen to span the dates before and after a change)



                        Typically, you would want to have some form of Internal Id and External Id. In your case, you could have something like Internal Id: 1234; Business A External Id: M001; Business B External ID : UM001; . Unless you just have a fairly large amount of entries per member or per business, joining multiple tables shouldn't affect performance by much.






                        share|improve this answer

























                          3












                          3








                          3







                          As for good/bad practice in this case, that is mostly subjective, because it depends on factors concerning the application(s) and data.



                          For example, if you were only to have one business for the initial product launch, and there are no schedules or plans to add other businesses, then there isn't a point to come up with a design that fits accounting for any other businesses.



                          In trying to plan for multiples, there is the possibility that some additional business does not have the same concept of member as the original business. There are other pitfalls with this route, such as modifying functionality for members based on a request from business "B" then business "A" has member functionality that is not expected or removed. (the first option has more potential to be in the scenario of the example)



                          For the second option, it could work, but I would still be hesitant, since this is supposed to be a new project. There would be some difficulty in determining shared functionality/properties. Depending on the implementation, there are more opportunities for duplicating code or masking functionality across each member/business.



                          Let's say that you did have "all" of the requirements for adding new businesses:



                          Assuming that this project/some other project in your area determines the member id, it does not make sense to have member id be the same internally and externally. If the is any functionality based on the contents of member id, then that functionality has the chance to be broken (EX: not being able to work with historic records, or records that happen to span the dates before and after a change)



                          Typically, you would want to have some form of Internal Id and External Id. In your case, you could have something like Internal Id: 1234; Business A External Id: M001; Business B External ID : UM001; . Unless you just have a fairly large amount of entries per member or per business, joining multiple tables shouldn't affect performance by much.






                          share|improve this answer













                          As for good/bad practice in this case, that is mostly subjective, because it depends on factors concerning the application(s) and data.



                          For example, if you were only to have one business for the initial product launch, and there are no schedules or plans to add other businesses, then there isn't a point to come up with a design that fits accounting for any other businesses.



                          In trying to plan for multiples, there is the possibility that some additional business does not have the same concept of member as the original business. There are other pitfalls with this route, such as modifying functionality for members based on a request from business "B" then business "A" has member functionality that is not expected or removed. (the first option has more potential to be in the scenario of the example)



                          For the second option, it could work, but I would still be hesitant, since this is supposed to be a new project. There would be some difficulty in determining shared functionality/properties. Depending on the implementation, there are more opportunities for duplicating code or masking functionality across each member/business.



                          Let's say that you did have "all" of the requirements for adding new businesses:



                          Assuming that this project/some other project in your area determines the member id, it does not make sense to have member id be the same internally and externally. If the is any functionality based on the contents of member id, then that functionality has the chance to be broken (EX: not being able to work with historic records, or records that happen to span the dates before and after a change)



                          Typically, you would want to have some form of Internal Id and External Id. In your case, you could have something like Internal Id: 1234; Business A External Id: M001; Business B External ID : UM001; . Unless you just have a fairly large amount of entries per member or per business, joining multiple tables shouldn't affect performance by much.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Mar 16 at 1:20









                          eparham7861eparham7861

                          18918




                          18918



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Software Engineering Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsoftwareengineering.stackexchange.com%2fquestions%2f388721%2fhow-to-model-public-ids%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Moe incest case Sentencing See also References Navigation menu"'Australian Josef Fritzl' fathered four children by daughter""Small town recoils in horror at 'Australian Fritzl' incest case""Victorian rape allegations echo Fritzl case - Just In (Australian Broadcasting Corporation)""Incest father jailed for 22 years""'Australian Fritzl' sentenced to 22 years in prison for abusing daughter for three decades""RSJ v The Queen"

                              Who is our nearest planetary neighbor, on average?Santa Claus flies to the South PoleSeven Spheres of Unequal Mass, a weighing problem with a twistDescribe a large integerFast Mental Calculation of $7.5^7$Math in Space (without the help of celebrities)Find the value of $bigstar$: Puzzle 8 - InequalityWho drinks beer while running anyway?A Crucial DeliveryRanking And AverageHow long will my money last at roulette?

                              Daza language Contents Vocabulary Phonology References External links Navigation menudaza1242Daza"Dazaga"eeee178086576