weizhouapache commented on PR #7895:
URL: https://github.com/apache/cloudstack/pull/7895#issuecomment-1692113782

   > > > > > > @JoaoJandre can the uri be generated in java code ? this looks 
like there will be some duplicated settings in db.properties
   > > > > > 
   > > > > > 
   > > > > > The current behavior is to generate the URI in the java code, 
using the `db.properties`. The problem with that is that it lacks flexibility. 
Every time someone wants to use a new feature in a URI connection, a new 
property will have to be created and the java code will have to be extended. It 
is much easier to just give the users the option to directly inform the URI 
that ACS should use. Also, I don't see any duplicated settings in 
`db.properties`, what will happen is that there will be some properties that 
are mutually exclusive.
   > > > > 
   > > > > 
   > > > > @JoaoJandre there are following settings in db.properties
   > > > > ```
   > > > > db.cloud.replicas=localhost,localhost
   > > > > db.cloud.autoReconnect=true
   > > > > 
db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&sessionVariables=sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'&serverTimezone=UTC
   > > > > ```
   > > > 
   > > > 
   > > > @weizhouapache , these settings will be maintained for backwards 
compatibility. They are used when the full URI is not set (`db.cloud.uri` and 
`db.usage.uri`). I'll add a comment to `db.properties` to make this more clear.
   > > 
   > > 
   > > I suggest to add the following, in additional to existing settings
   > > ```
   > > * db.cloud.engine (mysql/mariadb, use mysql if null )
   > > 
   > > * db.cloud.mariadb.failover.mode (replication/sequential/loadbalance)
   > > ```
   > > 
   > > 
   > >     
   > >       
   > >     
   > > 
   > >       
   > >     
   > > 
   > >     
   > >   
   > > a predefined uri is flexible but I do not think it will happen often . 
If we want to support other engines, normally some jave changes are required as 
well.
   > 
   > `db.cloud.driver` is already used to choose which DBMS will be conected 
(and should be set even when setting the URI!). There are other parameters that 
could be informed through the URI, and mapping all of them would only create 
even more properties. I really do not see the case for not letting users choose 
the connection URI.
   
   @JoaoJandre 
   You can generate the uri by settings in db properties
   - driver
   - replicas
   - failover mode (new)
   - url params
   
   what else are missing ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to