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

Batch implementations #331

Open
1 of 2 tasks
ohsayan opened this issue Mar 13, 2024 · 1 comment
Open
1 of 2 tasks

Batch implementations #331

ohsayan opened this issue Mar 13, 2024 · 1 comment
Labels
C-Model Related to the native multi-model capabilities of TDB C-performance This relates to performance C-storage Relating to storage D-server Related to the server

Comments

@ohsayan
Copy link
Member

ohsayan commented Mar 13, 2024

Batches are a way to group together queries and we will support various types of batches (including transactional ones). This issue tracks these implementations:

If you have any ideas, leave a comment here.

@ohsayan ohsayan added D-server Related to the server C-performance This relates to performance C-storage Relating to storage C-Model Related to the native multi-model capabilities of TDB labels Mar 13, 2024
@calvin2021y
Copy link

calvin2021y commented Apr 24, 2024

for task like this:

CREATE MODEL myspace.user_model(user_id: int, groups: list { type: int })
CREATE MODEL myspace.group_model(group_id: int, password: string, users: list { type: int })

add user into group will require transaction,

UPDATE user_model SET groups += "group_id" WHERE user_id = '1'
UPDATE group_model SET users += "user_id" WHERE group_id = '1'

You want avoid the case first is done but the other failed. this need to be run in batch and atomic.

And some case like this:

if count( user_model.groups ) < 10 and user_model.status == good and  count( group_model.users ) < 10  and group_model.status == good   {
 UPDATE user_model SET groups += "group_id" WHERE user_id = '1'
 UPDATE group_model SET users += "user_id" WHERE group_id = '1'
}

Some solution like redis lua script.

update 2 entities at once will be good enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Model Related to the native multi-model capabilities of TDB C-performance This relates to performance C-storage Relating to storage D-server Related to the server
Projects
None yet
Development

No branches or pull requests

2 participants