-
Notifications
You must be signed in to change notification settings - Fork 56
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
Idea: Notification (CDC) Support #633
Comments
Maybe we can't finish this work in go-storage alone? We need to build whole CDC services:
|
@xxchan is working on this idea. |
Here are some of my thoughts. Why we may need to support this feature?I think currently Supporting notification configuration is the first step (feature 1). We should consider how users use notifications and how to help them. When users may need this feature?Although we may design a feature that can be used without I think a user is willing to use
In the first case, notification is probably not needed(?). Notification data flowAn event notification may flow in different paths: If the user uses Lambda, I guess he may be willing to stick to the vendor and don't need us(?). If he uses So we can define a unified storage event message format for users. We can provide a library to convert vendor event message formats into ours (feature 2). (This can be analogous to https://github.com/xo/dburl, with which users can convert a unified connection string format into vendor ones) As @Xuanwo mentioned that we may support different notification receivers, the event "destination" (customer managed server, subscribing notification as an HTTP endpoint) may further send event messages downstream, and thus we may help provide a unified interface for publishing messages (like a unified (maybe more than) MQ interface) (feature 3). We can even let the server simply forwarding messages as a dedicated halfway station (feature 4, using features 2 & 3). SummaryNow we have 4 possible features:
I think features 1 & 2 are very reasonable. |
Nice thoughts! Let's resolve questions here.
Take data migration and backup as examples, notification is needed to implement the incremental process. For example, with notification support, we can implement incremental migration so that we don't need to list all objects (which is very slow on huge buckets).
We are focused on the storage layer itself, so the
Nice question. Features 3&4 are indeed out of our community scopes. The reason why I include them here is: Between features 1 and 2, we need a service to receive the events. And feature 3&4 is the extension of this service. The workflow looks like this:
It's OK for me to wipe this service & feature 3&4 out of this proposal, we can discuss them later (maybe when dm plan to implement the incremental data migration). |
ping dm's maintainer @Prnyself to take a look. |
I think this is just an HTTP server, so it should be decided by users themselves? |
You are right. Let's focus on our job and don't take the service into consideration. |
Nice thoughts! As a service-user, especially for an application based on Golang, being able to get a channel for notification is necessary and fundamental. What's more, webhook or 3rd party message queue should also be supported in the future. So it is really similar with the relationship between But for now, I think we can firstly define the notification sturct, find out what infomation we need to send in notification. Maybe take the badger's db.Subscribe as a reference? |
@xxchan Hi, what's the progress? |
@Prnyself, to make it clear, I think we are not going to support "sending notifications", since this is an internal feature of storage services. We just enable users to turn it on with We can decide "what information is commonly needed in received notification" and define a unified format. @Xuanwo My current plan is:
If this is okay, I will draft an RFC for 1 soon. |
The plan looks good to me! |
Here's a (not verified) table of storage event types. We can see that they vary a lot:
So I think this means that storage event is highly service-related and thus it is hard to provide a comprehensive unified event format.
|
The APIs of configuring notification are similar (but |
Another thing I found out is that some services (like s3) only support sending events to internal services like Amazon SNS, Amazon SQS, or AWS Lambda. |
Actually only qingstor supports HTTP endpoint directly. |
And it seems to be encouraged to configure notification in the console instead of using API 🤔 |
So we now have two difficulties.
|
For the second problem, my previous idea is to use SNS as a middle station, and add an HTTP endpoint subscription to the SNS topic. If so, the user will have to also provide the SNS arn besides HTTP endpoint. |
But SNS arn is also very different between services? Can we create SNS for user? |
some quick results (whether have CreateTopic API):
|
Not sure. Example:
My previous concern was that if the user will go to the console to create a topic, why doesn't he just continue to configure the notification there? So "Can we create SNS for user?" is a problem. |
Let's discuss event type later, it's a bit simpler.
So there are two methods:
|
Maybe related to #634 |
Is creating a service implicitly acceptable to users? One thing is that it involves billing. |
For method 1: I agree with your concern, it's not acceptable. Maybe it's out of our scope to implement the notification config API (And we don't have the ability for it), let's wipe them out. Without the notification API support, do you think it still useful to implement a global event struct type? |
I think users may write this themselves with few lines of code and won't try to find a simple library to do so. |
Let's mark this idea as a backlog, and drop it for now, thanks to your research! |
How about implement CDC via scanning? Like rockset does: https://rockset.com/blog/change-data-capture-what-it-is-and-how-to-use-it/
|
Our Storage Service may support sending notifications to let users get the changes of storage.
This feature likes CDC(Change Data Capture) for DBMS.
We may need to:
The text was updated successfully, but these errors were encountered: