Giter Site home page Giter Site logo

Comments (4)

EndallBatan93 avatar EndallBatan93 commented on May 31, 2024
  • storing of configurations should not be the atomic operation
  • the actual updating of the pipeline should be atomic.
    There we should handle if a configuration is missing and then either roll back or use the current configuration.

from keyscore.

MaxKarthan avatar MaxKarthan commented on May 31, 2024

I think there are even more things regarding the REST-API we should consider:
The current distinction between updating a resource and creating a new resource leads to unnecessary complexity in using the REST-API. I currently don't see the advantage of separating them. But at the moment I have to check every time before i want to update a resource if it is still there to use the correct method. Or I have to wait until the update failed and then send the creation request.

Also the separation into POST for update and PUT for creation might be appropriate but like mentioned here i think we could do better by using the defined idempotence property of the PUT Verb. I want to propose the following behavior:

  1. Update and creation of a single resource is done via PUT, we can therefore guarantee that no matter how often that call is send the result will always be the same.
    What is exactly what we advertise to browsers etc. by using the PUT Verb. With the current API this is not true. If the resource does not exist, the response is different. If someone creates the resource in between two requests the result is not the same.

  2. The planned post of a batch of configurations is done via POST. Here we cant define a concrete resource to create or update therefore the POST method should be used here. So at this point it wouldn't be possible to distinguish between update and creation anyway.

I know the first implementation of the API did not separate create and update. Maybe I'm missing the advantage but if I am, please enlighten me ;)

from keyscore.

kKdH avatar kKdH commented on May 31, 2024

I like the argument about idempotence. It sounds reasonable :

Better is to choose between PUT and POST based on idempotence of the action.

PUT implies putting a resource - completely replacing whatever is available at the given URL with a different thing. By definition, a PUT is idempotent. Do it as many times as you like, and the result is the same. x=5 is idempotent. You can PUT a resource whether it previously exists, or not (eg, to Create, or to Update)!

POST updates a resource, adds a subsidiary resource, or causes a change. A POST is not idempotent, in the way that x++ is not idempotent.

from keyscore.

kKdH avatar kKdH commented on May 31, 2024

With the experience from issue #6 we saw that we have to encode the kind of operation into the URL and add more information within the content to create a sophisticated REST api - Using different HTTP methods (POST, PUT, GET...) isnβ€˜t enough.

Iβ€˜m going to close this issue because we have separated the workflow of storing and materializing pipelines.

from keyscore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.