4

If I use JDBC approach, I am able to achieve connection pooling using third party library(Apache Dbcp).

I am using Client based Approach, VoltDB is not exposing connection object, How to implement connection pooling?

Is there any mechanism for Client based approach?

c.sankhala
  • 850
  • 13
  • 27

1 Answers1

4

The Client based approach is a lighter-weight yet more powerful API than JDBC.

The Client object should be connected to each of the servers in the cluster, or you can set the "TopologyChangeAware" property to true on the ClientConfig object prior to creating the Client object, then connect the client to any server in the cluster and it will create connections to all the others automatically.

The application will then interact with the database using this Client object, which has connections, rather than using a JDBC Connection object. Since the Client object is thread-safe and can support multiple simultaneous invocations of callProcedure() on multiple threads, there is no need to create a pool of Clients.

For more details on the Client interface, see Using VoltDB Chapter 6. Designing VoltDB Client Applications

Disclaimer: I work for VoltDB.

elixenide
  • 44,308
  • 16
  • 74
  • 100
BenjaminBallard
  • 1,482
  • 12
  • 11
  • Thanks for the Quick reply. Scenario1: 1 Client connects to 1 Server and performs multiple invocations to Stored Procedure. Scenario2: 2 Client connects to 1 Server and performs multiple invocations to Stored Procedure. Is there any performance changes in above two scenario? – c.sankhala Nov 01 '17 at 06:27
  • 2
    A single Client object may become a bottleneck at very high throughput rates. For example, if I'm testing a VoltDB cluster that is capable of running the voter example app at a rate of 800,000 transactions / second, I will probably need to use 2 or 3 client instances. It may also help if the application involves large payloads, such as 100KB or 1MB per record. But for the vast majority of applications, a single Client object is sufficient. – BenjaminBallard Nov 01 '17 at 13:42