I have a question related to Couchbase eventing. In Firebase/Firestore DB you can use a nice feature where you can be registered through the API to be notified when for example a new document is created or updated. I need to do the same thing with Couchbase but the Couchbase Event system is more like the old PLSQL or similar language to trigger some actions between DB objects and executing some action according to that, but I want a more reactive/real-time approach using Java SDK.
Do you know if is it possible to do that with just Couchbase (something like a listener without curl function)?
Also, I tried to do a test with SpringDataCouchbase using a simple findAll. That operation returns a Flux but it's a finite flux that finishes when all items are retrieved.
Thx for your help.
Disclaimer: I work for Couchbase as a product manager for the Eventing service.
If you've already evaluated the Eventing service and decided it doesn't meet your requirements, I would direct you to a similar topic How to capture save or update events in Couchbase
Note, we are actively working on adding a developer preview feature to Eventing similar to Amazon's Simple Queue Service to the next major Couchbase release.
Related
What I have?
A lot of different microservices managing by different teams. All microservices persist data in Aerospike database.
What I want to achieve?
I'm building new microservice that relies on data handled by another services. I want to listen the changes in entities, but unfortunately that microservices don't put anything in message queue, they have only usual REST APIs, so I cant just subscribe to events.
The idea is to listen a transaction log(event log/commit log/WAL) of database. This approach is also using in different Event Sourcing systems, but I cant found any Aerospike API that would stream this log. So the question - does Aerospike provide any similar functionality, may be with different name?
Aerospike, in its enterprise edition, has a feature called change notification framework which may fit your requirements. It informs an external agent about all the write operations. This is built over the XDR functionality which is meant for replicating across data centers using a digestlog.
If you are not planning for enterprise, you should reconsider having your own message queue in front of Aerospike.
I see that Sonarqube provides an Webservice API to get all issues and I will load this data in to a database for analysis. Then, I wish to have my reporting database in sync with the changes happening in the system. Do we have a Webservice API that captures change data?
Overall, I want reporting DB to be in sync with the system.
The createdAfter parameter of the issues search web service will get you new issues, but there's no analogous updatedAfter parameter. Note that by only looking at added issues, you'll overlook issues that are closed in a new analysis.
I have this use case, where I have created server side views on sync gateway based on a rolling time window of 10 days. Is there a way to directly pull those on my device side?
When I look at the documentation, I see that there's no way these can be replicated directly and one needs to make REST calls:
http://developer.couchbase.com/documentation/mobile/1.2/develop/guides/sync-gateway/accessing-cb-views/index.html
Is that assumption correct?
The other approach I saw was that let all the data be replicated on the client side and then write Couchbase lite views on the client side using Map reduce functions. Which one's the correct approach out of the 2?
Yes I believe that your assumption is correct - views have to be queried directly via the public REST API. I also believe that your solution for syncing data and then querying it on the client side will also work.
In order to find the "correct approach" I would consider your app needs and deployment workflow:
Using view on the server will require:
Managing (CRUD) of the views in SG - similar to managing functions in a database. These would ideally be managed by some deployment / management code.
Clients need to be able to make the API call to the public interface to access view info. This then requires a cache to work offline.
Slicing data locally means that sync will bring down all data and the device will have to perform the search / slice / aggregation previously carried out by the server. This will:
Work offline.
Put a potential extra strain on the app device.
I don't think that there are any easy answers here - ideally views would be synced to the device, but I don't know if that's even possible with the current SG implementation.
(Note 1: that the views must be created in Sync Gateway via the admin REST interface and not through the Couchbase web interface.).
(Note 2: I'm a server-side programmer, so this view is tainted.)
What I ended up doing was writing webhooks, which basically let me have the same docs replicated onto a Couchbase server. Then I did all needed aggregations and pushed those to syn gatewy(which got replicated to the app).
May or mayn't be right but works for my case....
I am devising a solution for investment firm wherein we want to fetch bse/nse index feeds, process them and provide realtime update to standalone client.
We've come up with following integration :
Serverside spring component which will consume index feed webservices from feed provider.
It will publish processed data on ActiveMQ topic.
Client side application will be subscribed to the topic, this way updating client with server push.
Please suggest if any better solution comes to your mind.
Facts to consider : Initially we are targeting 1000 customers(there will be only 1000 standalone clients). Every 2 seconds there need to be update to the client.
Sounds like a good approach to me. Not familiar with ActiveMQ, but if you are still at the evaluation stage you should also consider RabbitMQ if you havn't already.
I have multiple data sources inserting and updating to an oracle10g database. I also have multiple clients that would like to know when an insert or update has occured. I would like to know if oracle has some kind of native ability for my clients to realize that an insert or update has occured? I feel like the answer is no, but wanted to ask just in case.
Thanks!
edit: ideally push notification
There are a few different mechanisms depending on your goals.
You can use Oracle Asynchronous Queues (AQ) to publish the changes and then have your applications subscribe to the changes either via OCI or through one of the higher level Oracle AQ APIs (such as having AQ feed a JMS queue for a J2EE application).
If you are writing an OCI application, Oracle provides support for continuous query notification which is another method of pushing data to the client.
Finally, your applications could use Oracle Change Data Capture (CDC) to subscribe to changes. This last option would be more of a poll option (i.e. your application would ask every few minutes if there had been any interesting changes). The other two would be push options.
We've used DBMS_ALERT quite successfully; you can use a trigger to send an alert to a client registered to receive notifications. Effectiveness probably depends somewhat on the number and types of changes you're looking for.
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_alert.htm