Coder Social home page Coder Social logo

dicetechnology / dice-fairlink Goto Github PK

View Code? Open in Web Editor NEW
36.0 59.0 5.0 537 KB

JDBC Driver for read-only connections on AWS RDS Clusters

License: MIT License

Java 97.74% Shell 2.11% PLpgSQL 0.15%
jdbc aws aurora replica load balance mysql postgresql rds amazon

dice-fairlink's People

Contributors

andreylebedenko avatar basiarejdychiwanek avatar dependabot[bot] avatar gedl avatar mpontes avatar ryangardner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dice-fairlink's Issues

Do not log exception when a connection string is tested and rejected

SPI uses the most appropriate driver (sometimes the first) that accepts a given URL.

The java.sql.Driver interface recommends returning null if a URL is not accepted in the connect method (equivalent to returning falseon the accepts method, depending on the runtime).

dice-fairlink currently behaves according to this specification, but logs an exception if the URL is not accepted (ie, cannot be turned into a ParsedUrl).

This can become quite noisy and is not useful, as it's normal execution rather than an exception as such.

This behaviour should be changed to silently return null on the connect method and false in the accepts method implementations of the java.sql.Driver interface

General Guidance with HikariCP

I am trying to make dice-fairlink library work with HikariCP. First of all, is this something possible? I couldn't find any resources to verify the same.

Add javadoc

Currently little to no documentation exists at the source code level.

At least the public classes and methods should have some javadoc documentation.

Handle SQLException caused by IOException during delegated connection creation

Consider the following scenario:

  1. Driver queried the cluster for RO replicas' endpoints.
  2. N records returned of 'active' state.
  3. N records added to the list.
  4. X RO replicas went down.
  5. Application requests connection to be established.
  6. Driver pulls record which points to the replica, which is no longe accessible.
  7. Driver tries to open JDBC connection.
  8. Driver receives SQLException with IOException as cause.

Need to add logic which will:

  1. Handle exception and try to open the connection to the healthy address, respecting the general distribution logic.
  2. Optionally: Remove those records from the list or somehow mark it as down.

Return connections to the master database

One use case of a database cluster is by an application with a heavy bias towards reads.
In this case, the master database can be mostly idle

This task is to implement a configurable mechanism where the user specifies whether (/how much) a connection to the writer instance should be returned, additionally to the read round-robin.

Scalability of AWS API based members discovery

For low replicaPollInterval and/or high number of applications using dice-fairlink, it is possible to encounter an undocumented RDS API limit that will result in throttling and eventually in failure to discover cluster members.

This means dice-fairlink will not be able to update the cluster information or, depending on the client application using the library, it may even not be able to start.

This has been encountered with replicaPollInterval set to 30 seconds and with 60 dice-fairlink enabled applications within the same AWS account.

This is both not a dice-fairlink bug nor it is within dice-fairlink possibilities to solve.

However, this severely compromises functionality and an alternative discovery mean must be explored.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.