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

Create CONTRIBUTING.md #294

Merged
merged 3 commits into from
Jul 25, 2024
Merged

Create CONTRIBUTING.md #294

merged 3 commits into from
Jul 25, 2024

Conversation

xonx4l
Copy link
Contributor

@xonx4l xonx4l commented Aug 20, 2023

Regarding issue -:#288

Copy link
Contributor

@Abdur-rahmaanJ Abdur-rahmaanJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, though is am not a maintainer, i'd suggest including instructions to clone the project from scratch, run it, play around with it, create branches to submit changes, running and writing tests, pushing ...

I think then the contribution might be more meaningful. Maybe try a basic contribution guide and iterate on maintainers advises.

@xonx4l
Copy link
Contributor Author

xonx4l commented Aug 21, 2023

Okay @Abdur-rahmaanJ thanks for suggestion . I will update accordingly.

MarinPostma pushed a commit that referenced this pull request Oct 17, 2023
300: Hrana batches r=honzasp a=honzasp

The whole "edge" is (only) about reducing latency, so sqld clients should strive to minimize the number of network roundtrips. This means that users should prefer batched transactions to interactive transaction; these should take just a single roundtrip.

Unfortunately, up until now it was impossible to safely implement batched transactions in Hrana with just a single roundtrip. To execute a batch of statements _S1, ..., Sn_, we need to do the following:
- Execute a `BEGIN` statement
- If the `BEGIN` statement was successful, execute _S1_
- If `BEGIN` and _S1_ were successful, execute _S2_
- ...
- If `BEGIN` and _S1, ..., Sn-1_ were successful, execute _Sn_
- If `BEGIN` and _S1, ..., Sn_ were successful, execute `COMMIT`, otherwise execute a `ROLLBACK`

In other words, we need to execute statements conditionally, based on results of previous statements. The only way to do this in Hrana is to wait for the responses, so we need _n+2_ roundtrips instead of just one!

---

This PR changes that by introducing the concept of "batch" to the Hrana protocol. A batch is a sequence of steps, and each step is an SQL statement with optional condition. The condition can refer to success or failure of previous steps. This mechanism will allow clients to implement batched transactions using a single roundtrip.

This PR replaces #294 and #295 after discussion with `@MarinPostma.`

Co-authored-by: Jan Špaček <[email protected]>
@haaawk haaawk merged commit 08d917b into tursodatabase:main Jul 25, 2024
17 of 18 checks passed
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

Successfully merging this pull request may close these issues.

3 participants