Save PubNub Messages to Your Personal Database
We wrote an article that talks about the correct way to register JSON messages in a private database .
There are many approaches so far. One is the best. Using PubNub Features You will reliably store messages in your database asynchronously . Using the OnAfter Publishing Event . Your database must be accessible through a secure HTTPS endpoint.
PubNub does not index your posts using FTS indexing ; at the time of writing. You might want to index full-text searches using your database, or use an API provider, such as https://www.algolia.com/, for full-text searches.
The data is valuable. AI and ML let you get an idea of your data using Tensorflow . You might want to run data analysis on the contents of the message. Using EMR / Hadoop or other big data analytics software.
You will use PubNub functions to easily store messages asynchronously on your database system by following these steps:

Getting started is easy. Assuming you already have a stream of messages published to the PubNub data feed. Follow these simple steps. Successfully, you will create a real-time function that will run on every publication event.
- Gather a list of channels. You may be interested in ALL channels
* . - In your account control panel, find your application and press " Options . "
- Create a new module for the specified API key set.
- Create a new OnAfter event handler on channel
* . - Use the following code example to store your messages asynchronously in your database.
- Be sure to change the URL / parameters to suit your needs.
HTTPS asynchronous message save function
Stephen blum
source share