Code Monkey home page Code Monkey logo

astra-sdk-java's People

Contributors

aar0np avatar bytestreme avatar clun avatar dependabot[bot] avatar djsauble avatar eolivelli avatar kidrecursive avatar msmygit avatar snyk-bot avatar tatu-at-datastax avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

astra-sdk-java's Issues

Allow to work with raw Json payload for document API

The current implementation expects the developers to provide BEAN to be populated.

As the unmarshalling / deserialization could be customize allow to work with Raw Json or provide options to implement external mapper.

Implements failover between Astra Regions for All Endpoints (Circuit Breaker)

On 9/14 the multi region support has been introduced to Astra. On each region (datacenters) you will have:

  • A dedicated REST Endpoint
  • A dedicated graphQL endpoint
  • A dedicated secure connect bundle

As a consequence the drivers cannot failover on their own, they need the secure bundle. The fail-over has to be handle at the SDK level.

AstraClient client = AstraClient.builder()
 .databaseId("astra_cluster_id")  
 .databaseRegion("eu-central-1")
 .databaseFallbackRegions("us-east-1", "us-east-2")
 .keyspace("ks1")
 .token("AstraCS:......") 
 .clientId("TWRvjlcrgfZYfhcxGZhUlAAA") 
 .clientSecret("7xKSrZPLbWxDJ0WXyj..") 
 .build();

We could try add settings on the retry mechanism:

astra.retries.count: 3
astra.retries.healthcheckPeriod: 1min 

Implement an observer system

Idea:
Register your listener on get notify for each call (audit, monitoring)

  • Provide the listener system
  • Provide a AuditLogListener
  • Provide a PrometheusListener
  • Provide a Grafana Dashboard

Implements Load Balancing in Stargate nodes of same DC

When running into Kubernetes Stargate will have its own service doing the load balancing for us.
When running in Astra, a load balancer is already in place.

When running Stargate on your own Cassandra installation you may leverage on a DNS load balancer or use the client side load balancing here.

  • Add a way to setup multiple nodes and split per DC.
StargateClient sc = StargateClient.builder()
                // CQL 
                .withAuthCredentials("cassandra","cassandra")
                .withLocalDatacenter("datacenter1")
                .withContactPoints("127.0.0.1:9045")
                .withKeyspace("ks1")
                // API
                .withApiNode(new StargateNode("localhost"))
                .withApiNode(new StargateNode("127.0.0.1"))
                .withApiNodeDC("datacenter1", 
                        new StargateNode("node11",  "http://localhost:8082",  "http://localhost:8080",  "http://localhost:8081"))
                .build()) {
  • Implement Load balancing

Build failure on some systems due to transitive `grpc-core`/`grpc-api` dependency

On some systems (but not all; seems to depend on Maven repository configuration locally), build fails with:

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  11.278 s
[INFO] Finished at: 2022-09-28T10:17:38-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project stargate-sdk: Could not resolve dependencies for project com.datastax.stargate:stargate-sdk:jar:0.3.5-SNAPSHOT: Failed to collect dependencies at io.grpc:grpc-netty-shaded:jar:1.49.1 -> io.grpc:grpc-core:jar:[1.49.1]: No versions available for io.grpc:grpc-core:jar:[1.49.1] within specified range -> [Help 1]
[ERROR] 

which is somehow triggered by (rare) use of version-range dependency in grpc-netty-shaded:

https://mvnrepository.com/artifact/io.grpc/grpc-netty-shaded/1.49.1

This can be worked around by forcing dependencies at main level.
I will provide a PR for that.

Cope with Hibernated Databases

On the free tier, after 23H , Astra will put the database instance in hibernation state.

From there any call will wake up the database. The first call will return 503 coding for a Service not (yet) available. This make the SDK initialization failing.

Enhancement: At initialization, if the code return is 503 corresponding to an hibernated state (need to be confirmed with explict message, the SDK will log it and wait and retry until the DB is available to keep initializing.

Change default connection.pool.local.size

Hi Team,
Astra is using DSE which is based on TPC, a lower value of the local connection pool will cause more issues that benefit, can we bump this value to a higher say 8, and add it clearly in documentation to configure it correctly?

    { "name": "astra.cql.driver-config.advanced.connection.pool.local.size",
      "type": "java.lang.Integer",
      "description":"The number of connections in the pool.",
      "defaultValue": "1" },

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.