I am going to build an IoT based portal, where I need to show real time data. Currently I have created two pages with php, mysql, jquey. And I have used Twitter Bootstrap for designing. To communicate with IoT based device I have used our own message oriented framework. Can anyone help me to decide the proper architecture for it?
I don’t understand the question. You have “two pages”. You have a “message oriented framework”. Then you ask for help on the architecture for “it”. What is “it”?
I have created two pages for demos only, to test the communication between our message oriented framework and IoT devices. But to make a final product I want help.
You’re going to have to be more specific. What should the “final product” be?
I’m very much in agreement. In order to design a system architecture, you would need to have a very clear set of requirements to meet, at functional, non-functional and UX levels. Without that, pretty much any architecture is as good as any other.
@s_molinari and @chrisofarabia thanks for reply.
My final product is also a demo for our clients with all functionality. The portal shows the real time data from the IoT based devices. These devices are sensors, bulbs, fans, etc. From the portal user can :
- view the current stat of device (on/off/brightness) and can change it.
- Can view all the properties of device
- also view the network graph of devices ( main gateway and devices connected to that gateway).
- Can update the firmware of gateway and node.
- Can register (add) new device
- and many more…
I need to store all the data into database ( Here I am more confused) and currently I have used ajax to send data to my php page and that page stores data into database (mysql).
As I have used js api of our message oriented framework which uses socket for connection (socket.io) I have only one option to send data from my page to database is ajax. As this is iot based portal, there was many requests per second and I have to store all those data to database.
To reduce the socket connection of web socket, I have used one technique where I have loaded php pages into container via ajax whenever user clicks on menu link. So only first time the new socket connection is created then after all the page uses single web socket connection until user clicks refresh or F5. ( I know one page design is there but I do not want to use it).
Hope this is enough for get idea about my final product. If still require more details, I am ready to provide.
Well, one tip I can give you is, because sensor data is highly write intensive, you’ll probably be better off using a distributed database like MongoDB, which is now, with Version 3.0, extremely fast in writing data. You could say they are aiming for the IoT market. I’d be wary of using an RDBMS for IoT purposes. That is my own personal opinion though.
Node JS and Mongo also play together very well and there are a good number of libraries for Node that also support Mongo. If this is a straight application and not any kind of development platform (although Node is growing by leaps and bounds from a development standpoint), you might want to stick with Node for your site’s backend too and avoid PHP altogether.
Thanks @s_molinari for your tip. I will try your suggestion. But I have doubt about avoiding PHP and totally depends on Node JS. I have never worked on Node JS before.
About MogoDB, I have to store all the data comes from device to database and then also need to fetch it and show it. Is it good to use MongoDB in this scenario? I need to fetch data frequently from database to reduce communication with IoT device and reduce the use of bandwidth. For historical data mongo db is perfect but for portal live data I think it’s not the perfect choice.
What Socket.io did you mean? The one under that URL runs on NodeJS AFAIK.
Yes, you are right.
But it’s used only for socket connection, here I did not need to install NodeJs on my portal server. It was already configured on other server where our message oriented framework deployed.
I did not used NodeJs for my portal yet.
One more thing, I like your suggestion regarding use NodeJs and Mongo DB , I will try it and surely give you my result here. Still I have some doubts but may be those are gone once I will try.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.