josephg / node-foundationdb

Modern Node.js FoundationDB bindings
Other
115 stars 17 forks source link

Multi thread clients for connecting to different cluster #58

Closed hengsok closed 2 years ago

hengsok commented 2 years ago

Hi @josephg,

On Apple FDB documentation, it mentioned about multi threaded client for connecting to different clusters, could you help explain how can we set this option up or what is the code for connecting to multiple FDB clusters? Thanks! https://apple.github.io/foundationdb/api-general.html#multi-threaded-client

josephg commented 2 years ago

Hi!

It should work the same as other client libraries. Just connect to mulitple clusters. As for the multi-threaded client option, try it out. Though I'm not sure how much difference you'll see in performance, or what the implications are. You'll need to:

  1. Set the FDB version
  2. Use fdb.configNetwork({client_threads_per_version: xxx})
  3. Open multiple clusters by making multiple db objects (using multiple calls to open(clusterFileName)