

We will use the following libraries for this application: Each client opens a separate private channel for receiving price history data from server. A client can request for price history by publishing a request on the global listen-only channel and it can display a chart showing price history trend of an index. See the illustration below to understand the high level architecture of this application.Īdditionally, the server also subscribes to a global listen-only channel for receiving requests from clients for the stock price history data. The client application is a front-end JavaScript UI application which subscribes to global broadcast channel and updates its display with the latest price whenever there is a price change.
Free json sample data generator mongodb update#
In line with PubNub’s real-time capabilities, the client application will always automatically update the display with the latest price updates without needing a manual refresh. In this tutorial, we’ll be demonstrating an integration of MongoDB and PubNub. We’ll build a simple stock ticker application where price updates of the key stock market indices around the world will be stored in a MongoDB database.Īnd using the PubNub Data Stream SDK, we will build a server and a client application to broadcast and display these stock prices.įurther, the client application can also fetch historical prices and display a chart. It uses a JSON based query format, a dynamic schema and a simplified means to retrieve data from multiple documents.

MongoDB is part of the new breed of N0SQL databases which offer more flexibility over a traditional relational database management system (RDBMS).
