Hi All, One other approach suggested to me was to use a *Siddhi Stream for both > storage and retrieval* purposes. This would further allow for analytics > to be performed on the data which not be very much possible with the > earlier mentioned approaches.
I am +1 for this. IMO, treating the image as an *event-stream* would be beneficial for us to have better management of the images / binaries as it grows. I am referring data purging, applying Machine Learning modeling and most importantly AFAIU users will be having the flexibility of plugging-in non-RDBMS event stores for persisting these events. On the other-hand, having it on a RDBMS table field; we'd have the all *headache* of purging & managing large binary streams and slowing down of dbms. WDYT? Best Regards, ~Rasika On Tue, Jan 16, 2018 at 11:41 AM, Ruwan Yatawara <ruw...@wso2.com> wrote: > I am +1 for the second option of retrieving the image as a binary stream. > > Given the fact that images can be of varying sizes (talking about > high-resolution ones, here), and Sidhdhi not having any image processing > capabilities as of this moment, I do not see a clear advantage in using a > SIdhdhi stream for storage and retrieval. > > Thanks and Regards, > > Ruwan Yatawara > > Technical Lead, > WSO2 Inc. > > email : ruw...@wso2.com > mobile : +94 77 9110413 > http://ruwansrants.blogspot.com/ > https://500px.com/ruwan_ace > https://medium.com/@ruwanyatawara > > > On Tue, Jan 16, 2018 at 10:52 AM, Nuwan Jayawardene <nuw...@wso2.com> > wrote: > >> Hi all, >> >> I'm currently working on a project to add image storing and retrieval >> capabilities to the WSO2 IoT Server. >> >> To achieve this I have implemented the following; >> 1) Added a separate DAO Table with a field with LONGBLOB data type for >> storing. >> 2) Added storage capabilities in the database for an image sent as a *File >> *in the form of a *BinaryStream*. >> >> As of now, I've written unit tests and the test images are getting stored >> successfully in the database. >> >> The problem lies in how to successfully retrieve the stored data. For >> this, I have come across 2 possible approaches. >> 1) *Retrieve as a File - *The notable downside I realized with this >> solution is that each time a new Image is retrieved, a new file will be >> created. Therefore measures would have to be taken to persist new files >> while purging older obsolete ones. >> 2) *Retrieve as BinaryStream - *Although this requires no persistent >> memory usage and the data will only be retrieved on call and issues may >> come up when representing that data from a UI end. Further analysis is >> required for this approach. >> 3) *Retrieve as FileOutputStream - *This is my preferred method and the >> one recommended mostly in forums and tutorials. >> >> One other approach suggested to me was to use a *Siddhi Stream for both >> storage and retrieval* purposes. This would further allow for analytics >> to be performed on the data which not be very much possible with the >> earlier mentioned approaches. >> >> Suggestions and Feedback are appreciated. >> Thanks and regards! >> >> -- >> *Nuwan Jayawardene* >> *Software Engineering Intern* >> *WSO2, Inc.:http://wso2.com <http://wso2.com/>* >> *lean.enterprise.middleware* >> *Mobile :- +94 71 1813299 <+94%2071%20181%203299>* >> >> >> - *Linkedin* *:- **https://www.linkedin.com/in/nuwa >> <https://www.linkedin.com/in/nuwanjaya/>**njaya/ >> <https://www.linkedin.com/in/nuwanjaya/>* >> - * <https://www.wso2.com/signature>* >> >> > -- With Regards, *Rasika Perera* Senior Software Engineer LinkedIn: http://lk.linkedin.com/in/rasika90 <http://wso2.com/signature> WSO2 Inc. www.wso2.com lean.enterprise.middleware
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev