graphjin
graphjin copied to clipboard
Minio blobs integration
What would you like to be added:
minio / s3
Often you need data and blobs to work together and there are many ways to do this.
One way is to model the RID of the blob in the DB, so then when the client queries for the data, the result has the RID in it and then the client can query the blobs from the minio server.
Then you have mutations. Minio has notifications, and so a mutation that has data and a blob, can first update minio, wait for the notifications from minio with the RID, and then put the data and reference to the RID i the DB. Minio has special upload API too. The other way is to us a webhook from minio, that goes back all the way to the client, and then the client submits the data with the RID from minio.
Subscriptions can also then be supports that work with blobs too, because if the blob is changed in mino, it will notify graphJin, and the queries / subscription using that RID can get notified.
Why is this needed:
Cause blobs and data are the classic need for platforms, and it would be cool if if that can be wrapped by graphJin too.
References off the top of my head:
Minio OPS console is new and awesome, and really helps to understand the internals of minio and how its security model works: https://github.com/minio/console
Docs on notifications: https://docs.min.io/docs/minio-bucket-notification-guide.html
Example of notifications: https://github.com/sleighzy/openfaas-minio-notification-webhook#subscribing-to-minio-s3-notifications
You could do this with the remote api resolver. an id from the database can be made part of a remote api call and the results merged back in. Alternatively you can also use the built in scripting capability to do this. using the http.Get js function.
https://github.com/dosco/graphjin/wiki/Common-Use-Cases#remote-joins https://github.com/dosco/graphjin/wiki/Guide-to-GraphQL#adding-business-login-with-javascript
realised this after i wrote the issue. saw it in the wiki :) thanks
makes me think that Providence might be a very nice aspect to add, and not bloat the architecture. the idea is that for data flowing through the system to track where it came from. so then when it comes to mutation time, you have a least a something in the system to tell you where the mutation needs to do to.
the other thin that occurs to me is the "Outbox pattern" and linearisation. What i mean here is that when you mutation many systems you gotta make sure they all stick or none stick :)
Maybe the two concepts above are already in the wiki or code and i have not found them yet :)
Can you explain "Outbox pattern" and "linearisation" with a usecase I don't quite understand the question.