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

Consider making Replica and DependencyMap traits #403

Closed
Verneri opened this issue Jun 18, 2024 · 6 comments
Closed

Consider making Replica and DependencyMap traits #403

Verneri opened this issue Jun 18, 2024 · 6 comments

Comments

@Verneri
Copy link

Verneri commented Jun 18, 2024

As some DBMSs (like SurrealDB) might be able to represent for example dependencies straight from the DB it might be a good idea to abstract the Replica and DependencyMap to traits so that they can be given other Solutions than the way Rust implementation handles calculating dependencies, it might be a good idea to make Traits for these.

In some cases this might help as Well with bindings to other languages/platforms

@djmitche
Copy link
Collaborator

There are some constraints on the data format that might make such usage difficult:

  • tasks have dep_... properties to represent dependencies, as part of the public API for tasks
  • changes to tasks are modeled as operations, adding or removing key/value pairs

That said, I'm interested in what you have in mind. A concrete case for storing task data in a different backend would help to clarify where these interfaces need to be changed.

Note also #372 is going to happen soon, and will modify the TC API pretty substantially.

@Verneri
Copy link
Author

Verneri commented Jun 27, 2024

I'll try to Create an example, it might take some time though

@Verneri
Copy link
Author

Verneri commented Jun 29, 2024

I will try to implement most of the system straight into SurrealDB to showcase the possibilities. Of course it might sometimes be better to use dedicated code for this but i think creating as much funtionality as possible, straight in the db shows the ideas better.

Also was thinking of trying out using BerkleyDB or rocksDB etc for the storage layer just to see if there is difference in the performance

@djmitche
Copy link
Collaborator

Sounds good!

@djmitche
Copy link
Collaborator

djmitche commented Aug 5, 2024

It might make more sense to create a struct that implements the Storage (and StorageTxn) traits, instead of a replica.

The set of methods provided in StorageTxn probably deserves some scrutiny: lots of very common things, such as determining whether a task is BLOCKED or BLOCKING, currently require scanning all pending tasks, which is pretty expensive.

Let's see if this bug branches in either of those directions: creating a new storage backend using SurrealDB; or modifying the StorageTxn methods to improve performance.

@djmitche djmitche changed the title Concider making Replica and DependencyMap traits Consider making Replica and DependencyMap traits Aug 5, 2024
@djmitche
Copy link
Collaborator

djmitche commented Nov 8, 2024

There's some discussion in #472 of making it possible to express filter expressions in a way that the storage backend could, optionally, interpret for the caller. I think that covers part of what is proposed here, but dependency maps are not mentioned. I'll add a note about that, and close this issue in favor of that discussion.

@djmitche djmitche closed this as completed Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants