Comments (4)
- 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.
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:
-
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. -
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.
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.
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)
- Rework KafkaSource and KafkaSink to produce/consume plain values instead of encode/decode json HOT 2
- Activate KS:M tests
- Translation in Pipely
- Descriptors with missing localization break Pipely
- Custom Metrics for Pipelines and Filters HOT 14
- Wrong SnackBar when running a pipeline.
- Leaving gradle serve running for a while shows error messages related to DirectiveConfiguration
- Implementing persistence for resources
- Finishing data-preview feature
- Can't drag-and-drop block into Pipeline Editor
- UI-Bug: Block configuration area has a horizontal scrollbar in Firefox HOT 1
- Release v0.4.0
- Setup integration tests with Toxiproxy
- Parameters overwritten when using same parameter or same block.
- Travis build breaking due to sass-loader exception. HOT 1
- Splitting-up keyscore-manager
- Providing dynamic data with services deployed by agents
- Evaluate Testcontainers HOT 1
- Creating debian packages with Gradle. HOT 1
- Notifications - Notify an user about failures HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keyscore.