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

Stores need to be aware if they are responsible for hosting data on a domain or not #51

Closed
joepio opened this issue Dec 25, 2020 · 4 comments

Comments

@joepio
Copy link
Member

joepio commented Dec 25, 2020

When a Commit is being made to a store (when data is changed), this store will need to know if this Commit has to be stored locally, or if it has to be sent to some external server.

I think the primary concern should be getting the names of these concepts really clear. Some of the terms I'm currently using or considering:

  • Base URL
  • Server
  • Pod
  • Companion server
  • Target store

Maybe this can be resolved by simply adding a self_url property for servers.

Perhaps related: it might be a good idea to refactor store.set_default_agent, Agent and Config. Config overlaps heavily with Agent.

@joepio joepio changed the title Stores need to be aware if they are responsible for some domain or not Stores need to be aware if they are responsible for hosting data on a domain or not Dec 25, 2020
@joepio
Copy link
Member Author

joepio commented Dec 25, 2020

In atomic-cli, I've implemented logic to deal with who's the current Agent, and where the Server is located which should be writed to. However, I think this kind of logic (dealing with who's the agent and where the server is located) should sit in Store, and be tucked away as much as possible. Store should know the default Agent and the Server's address. This should prevent explicitly passing things like the Agent's private key, the server's URL and more to all sorts of functions.

@joepio
Copy link
Member Author

joepio commented Jan 3, 2021

Resource.save() is one of the methods that needs to know: 'should I post this commit, before I apply it locally, or am I the source of truth?'

@joepio
Copy link
Member Author

joepio commented Jan 24, 2021

I've ran into an issue with this. The client used get_base_url to determine if a resource should be present. This made sense in the server, but not in the client. I ended up adding a get_self_url function, which returns Option<url>. Currently, only DB returns a value, since that is used in server. Not sure how this should work in the end, I'm not quite happy with the current state, but it works.

@joepio
Copy link
Member Author

joepio commented Jan 24, 2021

Also had to add save_locally (especially for quick tests)

joepio added a commit that referenced this issue Jan 24, 2021
@joepio joepio closed this as completed Jan 24, 2021
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

1 participant