1 2 3 Previous Next 31 Replies Latest reply on Feb 6, 2007 5:51 PM by clebert.suconic Go to original post
      • 15. Re: JMS specific columns in DB
        timfox

         

        "ovidiu.feodorov@jboss.com" wrote:

        Keeping information like "destination" in its own main table field will speed up queries, isn't it? Otherwise, you'll need to use a JOIN instead of a simple SELECT.


        Destination is never used in queries. The core joins on channel id only (you can think of this as the real core destination) which is in it's own column.



        Stuffing non-generic information as message headers will impact performance. It's difficult to say how much, without proper measuring, though.


        Not so. I wouldn't have suggested it, if that was the case.



        This is what migration utilities are for. We won't have to live forever with it, we will just have to go through the trouble of writing a migration tool. We need to do this while migrating from 1.0 to 1.2 anyway.


        We don't need this for 1.2 since we have specifically said no compatibility until after 1.2. This is why it needs to be done now.


        Personally, I don't believe in the "perfect generic design" that "fits every possible case". We need to have a plan for evolution, not perfection, which is unattainable.


        Who said it was a perfect gerneric design? It is just a better design than before. An "evolution" in your words.

        And please, we don't have weeks to debate this.......

        • 16. Re: JMS specific columns in DB
          timfox

           

          "clebert.suconic@jboss.com" wrote:


          It's even worse...

          If you use composed fields... and if you need eventually to perform a JOIN...
          you will need to do something like
          WHERE SUBSTRING(COMPOSED_FIELD,1,5) = "DESTINATION"

          or something like that...



          Read my previous answer. Anything that is used in joins is in it's own field.

          The core "destination" is the channel. This what the core is concerned with. The Jms destination means nothing to the core, it's just a piece of baggage that's passed around. That's pretty much already the case.



          If you have 100 systems... it's better to have 100 columns than a single column with 100 substrings to deal with. :-)


          Who said you'd have to deal with substrings?


          • 17. Re: JMS specific columns in DB
            timfox

             

            "ovidiu.feodorov@jboss.com" wrote:


            Could you please jot down the schema, as you think it should be


            The schema is as before, I am just considering moving the destination, reply to, jms type and correlation id fields into headers like any other header.

            These fields are never used in joins anyway. They mean nothing to the core.

            The jms destination is available via the channel mapper table anyway if people want it.

            • 18. Re: JMS specific columns in DB
              timfox

              Let me-reiterate.

              The point of this task is to get the schema to a stable state so we don't have to writing migration scripts every time we do a release.

              The columns I am considering removing are vestigial, they are not used in any joins. Also they more than likely negatively effect performance due to the extra unnecessary number of columns the database has to deal with.

              If someone wants to find out the actual jms destination they can join the channel id to the channel mapper table.

              If we're not going to remove them now, we will probably do so a few months down the line anyway, in which case we will have to write a migration script, and will have customers with a messy straggling database with some columns used, some columns not used. I.e. a support head ache. If everyone is using the same db schema then it makes a hell of a lot easier.

              If we make changes to the schema as I suggest this means we can support pretty much any message type without changing the format. So we have stability, performance, future proofing, clarity and conciseness.

              If someone really wants a normalised JMS specific database as Clebert would like, then they can create a JDBCPersistenceManager that does this.

              Yes, this will be as slow as a tortoise on crutches, but it's possible.

              IMO the default out of the box schema should be simple and performant and not contain redundant columns that seem to server no real purpose.

              • 19. Re: JMS specific columns in DB
                clebert.suconic

                I would prefer a normalized database as I have stated before. By normalized I mean.. just having these fields on the table.

                On my understanding these tables are the tables for our current JMS implementation. (look at those table names... JMS_message, JMS_reference ...)

                Adding a new field on the database doesn't mean you are adding dependency to your code. The day we need another system, we will change the JDBCPersistenceManager or implement a new one. To me JDBCPersistenceManager is like a hibernate that maps our columns to databases. If some day we need extra data... we change the
                persistenceManager.

                If some day we have pluggable systems... I would say we will implement plugable persistence managers. and having columns created according to what's plugged/needed.

                So.. in another words... if we have a new system... we just implement a new PersistentManager

                • 20. Re: JMS specific columns in DB
                  clebert.suconic

                   

                  "clebert.suconic@jboss.com" wrote:


                  If you have 100 systems... it's better to have 100 columns than a single column with 100 substrings to deal with. :-)


                  Who said you'd have to deal with substrings?


                  From the original post:

                  I am considering removing those columns and just storing those values as core headers in the message.


                  I understood you would remove these columns and store them in a single field called header. Maybe I didn't understand how you would do it.

                  If you have the single field... you would have to break down the string (or the header) when using the information.



                  • 21. Re: JMS specific columns in DB
                    timfox

                    There is already a column that stores the headers called coreheaders.

                    I am just suggesting putting jmsdestination, jmstype and jmscorrelationid in there with the other headers.

                    I can see there is value in joining on jmsdestination for, for example reports, but this isn't lost, you can still get the jms destination in a query by joining channel id with channel mapper.

                    • 22. Re: JMS specific columns in DB
                      clebert.suconic

                      Answering your post sent on "PostPosted: Tue Feb 6, 2007 10:48 AM Post subject: Re: JMS specific columns in DB"


                      It's okay... as long we don't create a string parsing hell on the code.

                      It's not that I really want normalized DBs.

                      I had to deal with dynamic models before in my life and that created a hell on the persistent code. The database was beautiful but the code suffered to keep the schema dynamic.

                      And that's my only concern.

                      • 23. Re: JMS specific columns in DB
                        timfox

                         

                        "clebert.suconic@jboss.com" wrote:


                        It's okay... as long we don't create a string parsing hell on the code.


                        There are no strings involved.

                        • 24. Re: JMS specific columns in DB
                          clebert.suconic



                          There are no strings involved.


                          Ah... COREHEADERS is a BLOB.

                          It's okay then... You convinced me :-)

                          I understood we would create a new String field for these headers.

                          • 25. Re: JMS specific columns in DB
                            timfox

                            Also bear in mind that JBoss MQ, does not store the jms headers in separate columns, so it's not as if people who are used to JBossMQ will be losing out:

                            JBosMQ:

                             CREATE_MESSAGE_TABLE = CREATE TABLE JMS_MESSAGES ( MESSAGEID INTEGER NOT NULL, \
                             DESTINATION VARCHAR(255) NOT NULL, TXID INTEGER, TXOP CHAR(1), \
                             MESSAGEBLOB BLOB, PRIMARY KEY (MESSAGEID, DESTINATION) )
                            


                            • 26. Re: JMS specific columns in DB
                              ovidiu.feodorov

                              OK. Let's store non-essential JMS-related attributes as core headers.

                              One observation, though:

                              Tim wrote:

                              Ovidiu wrote:
                              This is what migration utilities are for. We won't have to live forever with it, we will just have to go through the trouble of writing a migration tool. We need to do this while migrating from 1.0 to 1.2 anyway.

                              We don't need this for 1.2 since we have specifically said no compatibility until after 1.2. This is why it needs to be done now.


                              Well, we do. For people who want to migrate from 1.0 to 1.2 and have persistent messages in the database.

                              • 27. Re: JMS specific columns in DB
                                clebert.suconic

                                 

                                Well, we do. For people who want to migrate from 1.0 to 1.2 and have persistent messages in the database.


                                Shouldn't them consume their messages on 1.0 before migrating to 1.2?

                                We use BLOBs.. I don't know if we would have just schema changes or also binary incompatibilities with these BLOB fields.

                                • 28. Re: JMS specific columns in DB
                                  timfox

                                   

                                  "clebert.suconic@jboss.com" wrote:
                                  Well, we do. For people who want to migrate from 1.0 to 1.2 and have persistent messages in the database.


                                  Shouldn't them consume their messages on 1.0 before migrating to 1.2?



                                  I think we made it pretty clear that we wouldn't provide compatibility before 1.2, so I think they should consumertheir messages.

                                  If they are an important support customer, they can come to us via their support contract and we can create a migration tool for them that way

                                  • 29. Re: JMS specific columns in DB
                                    ovidiu.feodorov

                                     

                                    Tim wrote:
                                    If they are an important support customer, they can come to us via their support contract and we can create a migration tool for them that way


                                    Correct, that's what I meant.