Can I use PubNub to update and delete messages without "Storage&Playback" feature?

753 Views Asked by At

I am trying to build a realtime CRUD app. I have a rails app integrated with angularJS. It uses postgresql database, and angular is connected to the backend via JSON api. I'm running PubNub commands from angular.

So far, I got the PubNub subscribe and publish working, and the published data gets saved on the postgresql backend. In other words, I got the "create" and "read" part done, and I have the "update" and "delete" to implement.

I've been searching on google and pubnub, but the only examples I got were either for a project with PubNub+BackBone.js or I had to discard my backend with postgresql+JSON api and use PubNub's Storage&Playback feature.

Is there anyway that I can implement update/edit and delete on my current setup?

1

There are 1 best solutions below

0
On

PubNub doesn't currently support update and delete. History keeps a full record of all publishes and they get automatically deleted based on the storage policy (keep for 1 day, 3 days, 30 days, forever).

PubNub stores all messages per channel with the Storage & Playback feature add-on. Since it stores all messages in a time series, and doesn’t expose Updating and Deleting, you need a simple pattern to implement this functionality. You can find details of this implementation here.

So basically, you will need storage and playback, and use this Message Updates and Deletes pattern to implement update and delete. PubNub doesn't support the functions directly, but you can use these patterns to "mark" message id's as deleted.