erlangbureau / jamdb_oracle

Oracle Database driver for Erlang
MIT License
106 stars 48 forks source link

Load Balanced Connection Strings? #92

Closed mlh758 closed 3 years ago

mlh758 commented 3 years ago

The prod database I'm working with is in a cluster so my connection string would look like this with other Oracle adapters:

(
  DESCRIPTION=
    (ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=db1)(PORT=1521)))
    (ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=db2)(PORT=1521)))
    (ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=db3)(PORT=1521)))
    (LOAD_BALANCE=yes)
    (CONNECT_DATA=(SERVER=DEDICATED)
    (SERVICE_NAME=prod))
)

Is there any support for load balanced connections with this library? If not do you have any direction you could point me in for implementation?

vstavskyi commented 3 years ago

The quote from Real Application Clusters Administration and Deployment Guide

Oracle introduced the Universal Connection Pool for JDBC in Oracle Database 11g release 11.1.0.7.0. Consequently, Oracle deprecated the existing JDBC connection pool, the Implicit Connection Cache, which was introduced in Oracle Database 10g release 1 for use with Oracle RAC databases. In addition to Oracle Database 12c, you can also use the Universal Connection Pool with Oracle Database 10g or Oracle Database 11g.

Maybe LOAD_BALANCE is just several conection pools for each address.

So for example we can write several Ecto configurations and create connection pools.

mlh758 commented 3 years ago

I'm going about this the wrong way. Our networking folks can set up a virtual IP in front of the cluster of databases that will load balance transparently. The app code shouldn't really be dealing with that.