![]() Python bindings for interfacing with MongoDB Server: Pymongo.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. The database is initially populated with some arbitrary price dataįor the purpose of this demo, the server application is built on Python which interfaces with the DB and also publishes stock data on a global broadcast channel.The stock market price data is randomly generated.Real-time MongoDB Tutorial Considerationsīefore we dive into the nuances of application logic, here are a few considerations for our project: 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).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |