Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB Batch transaction suggestion #35

Open
0xmikko opened this issue May 27, 2020 · 1 comment
Open

DB Batch transaction suggestion #35

0xmikko opened this issue May 27, 2020 · 1 comment

Comments

@0xmikko
Copy link

0xmikko commented May 27, 2020

Working on hackahon project I profiled your testnet library in case of performance.
It takes 3500-5500 ms for writing operation for the moment. From my opinion it depends on blockchain latency.

My suggestion is to add the following functions:

const tx = bluzelle.startTransaction() // returns pointer to batch transaction
tx.set("key", "value") // add an operation to batch transaction
const gasLeft = tx.gasLeft() // provides estimation of gas left for current batch transaction
const neededGas = tx.estimate.set("key2", "value2"); // provides estimated qty of gas for this operation

// The following code adds another operation if it's enough gas for that
if (gasLeft > neededGas) {
  tx.set("key2", "value2");
}
tx.submit(); // submit transaction to DB

With this functionality, as a developer I would be able make very efficient request programmatically and improve the performance.

@njmurarka
Copy link
Contributor

@scottburch This is a request for a batch function, which we do not actually support yet on the backend.

@MikaelLazarev Is my assessment correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants