Re: [Dev] Image persisting and retrieval mechanism for WSO2 IoT Server

2018-01-17 Thread Nuwan Jayawardene
Hi Anusha,

That's great to hear!
I was also focusing on per image storage, retrieval and if possible;
processing. Could the same implementation be applied directly to images
without a video stream?

If that's the case it would be awesome!

Thanks and regards.

On Wed, Jan 17, 2018 at 9:40 AM, Anusha Jayasundara 
wrote:

> Hi Nuwan.
>
> Even though I did video processing, In the end, the processing was done by
> per image. In my case, I resized the images into a 480p or 720p(most of the
> time videos was 1080p) and after the processing was done, saved them into
> the main storage in binary format. So you also can check the possibility of
> pre-processing the image before saving, since it can reduce the image size.
>
> Thank You,
> Anusha,
>
> On Tue, Jan 16, 2018 at 7:19 PM, Ramindu De Silva 
> wrote:
>
>> Hi all,
>>
>> [+]Anusha
>> Anusha has implemented a video processing solution. But it is not
>> integrated to the SP. Anusha, can you please explain how you stored and
>> processed the data in your solution? Maybe IoT team can get an idea.
>>
>> Best Regards,
>> Ramindu.
>>
>>
>> On Tue, Jan 16, 2018 at 4:03 AM, Nuwan Jayawardene 
>> wrote:
>>
>>> Hi All,
>>>
>>> Thanks for the feedback.
>>> Based on what everyone has said, I thought it was best to go ahead with
>>> using the *BinaryStream*.
>>>
>>> Will update this thread further along the way! :)
>>>
>>>
>>> On Tue, Jan 16, 2018 at 2:07 PM, Madawa Soysa  wrote:
>>>


 On Tue, Jan 16, 2018 at 1:10 PM, Ruwan Yatawara 
 wrote:

> As to my knowledge, image analysis is not supported, and won't be
> supported in the near future.
>
> @Mohan, @Ramindu, please correct me if I am wrong.
>

 In that case, it is better to go with the BinaryStream approach.

 +1 for retrieving as a BinaryStream.


> 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 1:01 PM, Nuwan Jayawardene 
> wrote:
>
>> Hi Madawa,
>>
>> Have you evaluated this approach? What are the advantages and
>>> drawbacks in terms of storage and retrieval of images by following this
>>> approach?
>>
>>
>> I've yet to look more into this option. I was actually hoping for
>> some feedback on whether or not I should pursue this or stick with the
>> RDBMS approach since I'm not experienced enough with Siddhi to do a
>> knowledgeable assessment.
>> At the moment, for the use case at hand, a simple storage and
>> retrieval would suffice. But if we consider the long run IMO it would be
>> smarter to go with a Siddhi based approach.
>> Then again comes the issue of whether Siddhi streams support image
>> analytics.
>>
>> On Tue, Jan 16, 2018 at 12:50 PM, Madawa Soysa 
>> wrote:
>>
>>> Hi Nuwan,
>>>
>>> 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.
>>>
>>>
>>> Have you evaluated this approach? What are the advantages and
>>> drawbacks in terms of storage and retrieval of images by following this
>>> approach?
>>>
>>> On Tue, Jan 16, 2018 at 12:36 PM, Geeth Munasinghe 
>>> wrote:
>>>


 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 

Re: [Dev] Image persisting and retrieval mechanism for WSO2 IoT Server

2018-01-16 Thread Anusha Jayasundara
Hi Nuwan.

Even though I did video processing, In the end, the processing was done by
per image. In my case, I resized the images into a 480p or 720p(most of the
time videos was 1080p) and after the processing was done, saved them into
the main storage in binary format. So you also can check the possibility of
pre-processing the image before saving, since it can reduce the image size.

Thank You,
Anusha,

On Tue, Jan 16, 2018 at 7:19 PM, Ramindu De Silva  wrote:

> Hi all,
>
> [+]Anusha
> Anusha has implemented a video processing solution. But it is not
> integrated to the SP. Anusha, can you please explain how you stored and
> processed the data in your solution? Maybe IoT team can get an idea.
>
> Best Regards,
> Ramindu.
>
>
> On Tue, Jan 16, 2018 at 4:03 AM, Nuwan Jayawardene 
> wrote:
>
>> Hi All,
>>
>> Thanks for the feedback.
>> Based on what everyone has said, I thought it was best to go ahead with
>> using the *BinaryStream*.
>>
>> Will update this thread further along the way! :)
>>
>>
>> On Tue, Jan 16, 2018 at 2:07 PM, Madawa Soysa  wrote:
>>
>>>
>>>
>>> On Tue, Jan 16, 2018 at 1:10 PM, Ruwan Yatawara  wrote:
>>>
 As to my knowledge, image analysis is not supported, and won't be
 supported in the near future.

 @Mohan, @Ramindu, please correct me if I am wrong.

>>>
>>> In that case, it is better to go with the BinaryStream approach.
>>>
>>> +1 for retrieving as a BinaryStream.
>>>
>>>
 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 1:01 PM, Nuwan Jayawardene 
 wrote:

> Hi Madawa,
>
> Have you evaluated this approach? What are the advantages and
>> drawbacks in terms of storage and retrieval of images by following this
>> approach?
>
>
> I've yet to look more into this option. I was actually hoping for some
> feedback on whether or not I should pursue this or stick with the RDBMS
> approach since I'm not experienced enough with Siddhi to do a 
> knowledgeable
> assessment.
> At the moment, for the use case at hand, a simple storage and
> retrieval would suffice. But if we consider the long run IMO it would be
> smarter to go with a Siddhi based approach.
> Then again comes the issue of whether Siddhi streams support image
> analytics.
>
> On Tue, Jan 16, 2018 at 12:50 PM, Madawa Soysa 
> wrote:
>
>> Hi Nuwan,
>>
>> 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.
>>
>>
>> Have you evaluated this approach? What are the advantages and
>> drawbacks in terms of storage and retrieval of images by following this
>> approach?
>>
>> On Tue, Jan 16, 2018 at 12:36 PM, Geeth Munasinghe 
>> wrote:
>>
>>>
>>>
>>> On Tue, Jan 16, 2018 at 10:52 AM, Nuwan Jayawardene >> > 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.

>>>
>>> +1 for retrieving as a BinaryStream. This will make it easy to
>>> handle in the java level unlike handling as a file. This has to work in 
>>> the
>>> cluster of servers, hence retrieving as a file will cause other syncing
>>> 

Re: [Dev] Image persisting and retrieval mechanism for WSO2 IoT Server

2018-01-16 Thread Nuwan Jayawardene
Hi All,

Thanks for the feedback.
Based on what everyone has said, I thought it was best to go ahead with
using the *BinaryStream*.

Will update this thread further along the way! :)


On Tue, Jan 16, 2018 at 2:07 PM, Madawa Soysa  wrote:

>
>
> On Tue, Jan 16, 2018 at 1:10 PM, Ruwan Yatawara  wrote:
>
>> As to my knowledge, image analysis is not supported, and won't be
>> supported in the near future.
>>
>> @Mohan, @Ramindu, please correct me if I am wrong.
>>
>
> In that case, it is better to go with the BinaryStream approach.
>
> +1 for retrieving as a BinaryStream.
>
>
>> 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 1:01 PM, Nuwan Jayawardene 
>> wrote:
>>
>>> Hi Madawa,
>>>
>>> Have you evaluated this approach? What are the advantages and drawbacks
 in terms of storage and retrieval of images by following this approach?
>>>
>>>
>>> I've yet to look more into this option. I was actually hoping for some
>>> feedback on whether or not I should pursue this or stick with the RDBMS
>>> approach since I'm not experienced enough with Siddhi to do a knowledgeable
>>> assessment.
>>> At the moment, for the use case at hand, a simple storage and retrieval
>>> would suffice. But if we consider the long run IMO it would be smarter to
>>> go with a Siddhi based approach.
>>> Then again comes the issue of whether Siddhi streams support image
>>> analytics.
>>>
>>> On Tue, Jan 16, 2018 at 12:50 PM, Madawa Soysa  wrote:
>>>
 Hi Nuwan,

 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.


 Have you evaluated this approach? What are the advantages and drawbacks
 in terms of storage and retrieval of images by following this approach?

 On Tue, Jan 16, 2018 at 12:36 PM, Geeth Munasinghe 
 wrote:

>
>
> On Tue, Jan 16, 2018 at 10:52 AM, Nuwan Jayawardene 
> 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.
>>
>
> +1 for retrieving as a BinaryStream. This will make it easy to handle
> in the java level unlike handling as a file. This has to work in the
> cluster of servers, hence retrieving as a file will cause other syncing
> issues.
>
>
>> 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 *
>> *lean.enterprise.middleware*
>> *Mobile  :- +94 71 1813299 <+94%2071%20181%203299>*
>>
>>
>>- *Linkedin* *:- **https://www.linkedin.com/in/nuwa
>>**njaya/
>>*
>>- * *
>>
>>
>
>
> --
> *Geeth Munasinghe*
> *WSO2, Inc. http://wso2.com  *
> 

Re: [Dev] Image persisting and retrieval mechanism for WSO2 IoT Server

2018-01-16 Thread Ramindu De Silva
Hi all,

[+]Anusha
Anusha has implemented a video processing solution. But it is not
integrated to the SP. Anusha, can you please explain how you stored and
processed the data in your solution? Maybe IoT team can get an idea.

Best Regards,
Ramindu.


On Tue, Jan 16, 2018 at 4:03 AM, Nuwan Jayawardene  wrote:

> Hi All,
>
> Thanks for the feedback.
> Based on what everyone has said, I thought it was best to go ahead with
> using the *BinaryStream*.
>
> Will update this thread further along the way! :)
>
>
> On Tue, Jan 16, 2018 at 2:07 PM, Madawa Soysa  wrote:
>
>>
>>
>> On Tue, Jan 16, 2018 at 1:10 PM, Ruwan Yatawara  wrote:
>>
>>> As to my knowledge, image analysis is not supported, and won't be
>>> supported in the near future.
>>>
>>> @Mohan, @Ramindu, please correct me if I am wrong.
>>>
>>
>> In that case, it is better to go with the BinaryStream approach.
>>
>> +1 for retrieving as a BinaryStream.
>>
>>
>>> 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 1:01 PM, Nuwan Jayawardene 
>>> wrote:
>>>
 Hi Madawa,

 Have you evaluated this approach? What are the advantages and drawbacks
> in terms of storage and retrieval of images by following this approach?


 I've yet to look more into this option. I was actually hoping for some
 feedback on whether or not I should pursue this or stick with the RDBMS
 approach since I'm not experienced enough with Siddhi to do a knowledgeable
 assessment.
 At the moment, for the use case at hand, a simple storage and retrieval
 would suffice. But if we consider the long run IMO it would be smarter to
 go with a Siddhi based approach.
 Then again comes the issue of whether Siddhi streams support image
 analytics.

 On Tue, Jan 16, 2018 at 12:50 PM, Madawa Soysa 
 wrote:

> Hi Nuwan,
>
> 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.
>
>
> Have you evaluated this approach? What are the advantages and
> drawbacks in terms of storage and retrieval of images by following this
> approach?
>
> On Tue, Jan 16, 2018 at 12:36 PM, Geeth Munasinghe 
> wrote:
>
>>
>>
>> On Tue, Jan 16, 2018 at 10:52 AM, Nuwan Jayawardene 
>> 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.
>>>
>>
>> +1 for retrieving as a BinaryStream. This will make it easy to handle
>> in the java level unlike handling as a file. This has to work in the
>> cluster of servers, hence retrieving as a file will cause other syncing
>> issues.
>>
>>
>>> 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 

Re: [Dev] Image persisting and retrieval mechanism for WSO2 IoT Server

2018-01-16 Thread Waruna Jayaweera
Hi Nuwan,

AFAIU if the requirement is to store the images, another approach would be
to store them directly in file system something similar we did for file
transfer feature. You can have some file sync mechanism or FTP server to
support clustering.

Thanks,
Waruna

On Tue, Jan 16, 2018 at 1:10 PM, Ruwan Yatawara  wrote:

> As to my knowledge, image analysis is not supported, and won't be
> supported in the near future.
>
> @Mohan, @Ramindu, please correct me if I am wrong.
>
> 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 1:01 PM, Nuwan Jayawardene 
> wrote:
>
>> Hi Madawa,
>>
>> Have you evaluated this approach? What are the advantages and drawbacks
>>> in terms of storage and retrieval of images by following this approach?
>>
>>
>> I've yet to look more into this option. I was actually hoping for some
>> feedback on whether or not I should pursue this or stick with the RDBMS
>> approach since I'm not experienced enough with Siddhi to do a knowledgeable
>> assessment.
>> At the moment, for the use case at hand, a simple storage and retrieval
>> would suffice. But if we consider the long run IMO it would be smarter to
>> go with a Siddhi based approach.
>> Then again comes the issue of whether Siddhi streams support image
>> analytics.
>>
>> On Tue, Jan 16, 2018 at 12:50 PM, Madawa Soysa  wrote:
>>
>>> Hi Nuwan,
>>>
>>> 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.
>>>
>>>
>>> Have you evaluated this approach? What are the advantages and drawbacks
>>> in terms of storage and retrieval of images by following this approach?
>>>
>>> On Tue, Jan 16, 2018 at 12:36 PM, Geeth Munasinghe 
>>> wrote:
>>>


 On Tue, Jan 16, 2018 at 10:52 AM, Nuwan Jayawardene 
 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.
>

 +1 for retrieving as a BinaryStream. This will make it easy to handle
 in the java level unlike handling as a file. This has to work in the
 cluster of servers, hence retrieving as a file will cause other syncing
 issues.


> 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 *
> *lean.enterprise.middleware*
> *Mobile  :- +94 71 1813299 <+94%2071%20181%203299>*
>
>
>- *Linkedin* *:- **https://www.linkedin.com/in/nuwa
>**njaya/
>*
>- * *
>
>


 --
 *Geeth Munasinghe*
 *WSO2, Inc. http://wso2.com  *
 *lean.enterprise.middleware.*

 email: ge...@wso2.com
 phone:(+94) 777911226 <+94%2077%20791%201226>

 

 --
 You received this message because you are subscribed to the Google
 Groups "WSO2 IoT Team 

Re: [Dev] Image persisting and retrieval mechanism for WSO2 IoT Server

2018-01-16 Thread Madawa Soysa
On Tue, Jan 16, 2018 at 1:10 PM, Ruwan Yatawara  wrote:

> As to my knowledge, image analysis is not supported, and won't be
> supported in the near future.
>
> @Mohan, @Ramindu, please correct me if I am wrong.
>

In that case, it is better to go with the BinaryStream approach.

+1 for retrieving as a BinaryStream.


> 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 1:01 PM, Nuwan Jayawardene 
> wrote:
>
>> Hi Madawa,
>>
>> Have you evaluated this approach? What are the advantages and drawbacks
>>> in terms of storage and retrieval of images by following this approach?
>>
>>
>> I've yet to look more into this option. I was actually hoping for some
>> feedback on whether or not I should pursue this or stick with the RDBMS
>> approach since I'm not experienced enough with Siddhi to do a knowledgeable
>> assessment.
>> At the moment, for the use case at hand, a simple storage and retrieval
>> would suffice. But if we consider the long run IMO it would be smarter to
>> go with a Siddhi based approach.
>> Then again comes the issue of whether Siddhi streams support image
>> analytics.
>>
>> On Tue, Jan 16, 2018 at 12:50 PM, Madawa Soysa  wrote:
>>
>>> Hi Nuwan,
>>>
>>> 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.
>>>
>>>
>>> Have you evaluated this approach? What are the advantages and drawbacks
>>> in terms of storage and retrieval of images by following this approach?
>>>
>>> On Tue, Jan 16, 2018 at 12:36 PM, Geeth Munasinghe 
>>> wrote:
>>>


 On Tue, Jan 16, 2018 at 10:52 AM, Nuwan Jayawardene 
 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.
>

 +1 for retrieving as a BinaryStream. This will make it easy to handle
 in the java level unlike handling as a file. This has to work in the
 cluster of servers, hence retrieving as a file will cause other syncing
 issues.


> 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 *
> *lean.enterprise.middleware*
> *Mobile  :- +94 71 1813299 <+94%2071%20181%203299>*
>
>
>- *Linkedin* *:- **https://www.linkedin.com/in/nuwa
>**njaya/
>*
>- * *
>
>


 --
 *Geeth Munasinghe*
 *WSO2, Inc. http://wso2.com  *
 *lean.enterprise.middleware.*

 email: ge...@wso2.com
 phone:(+94) 777911226 <+94%2077%20791%201226>

 

 --
 You received this message because you are subscribed to the Google
 Groups "WSO2 IoT Team Group" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to iot-group+unsubscr...@wso2.com.
 For more options, 

Re: [Dev] Image persisting and retrieval mechanism for WSO2 IoT Server

2018-01-15 Thread Nuwan Jayawardene
Hi Madawa,

Have you evaluated this approach? What are the advantages and drawbacks in
> terms of storage and retrieval of images by following this approach?


I've yet to look more into this option. I was actually hoping for some
feedback on whether or not I should pursue this or stick with the RDBMS
approach since I'm not experienced enough with Siddhi to do a knowledgeable
assessment.
At the moment, for the use case at hand, a simple storage and retrieval
would suffice. But if we consider the long run IMO it would be smarter to
go with a Siddhi based approach.
Then again comes the issue of whether Siddhi streams support image
analytics.

On Tue, Jan 16, 2018 at 12:50 PM, Madawa Soysa  wrote:

> Hi Nuwan,
>
> 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.
>
>
> Have you evaluated this approach? What are the advantages and drawbacks in
> terms of storage and retrieval of images by following this approach?
>
> On Tue, Jan 16, 2018 at 12:36 PM, Geeth Munasinghe  wrote:
>
>>
>>
>> On Tue, Jan 16, 2018 at 10:52 AM, Nuwan Jayawardene 
>> 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.
>>>
>>
>> +1 for retrieving as a BinaryStream. This will make it easy to handle in
>> the java level unlike handling as a file. This has to work in the cluster
>> of servers, hence retrieving as a file will cause other syncing issues.
>>
>>
>>> 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 *
>>> *lean.enterprise.middleware*
>>> *Mobile  :- +94 71 1813299 <+94%2071%20181%203299>*
>>>
>>>
>>>- *Linkedin* *:- **https://www.linkedin.com/in/nuwa
>>>**njaya/
>>>*
>>>- * *
>>>
>>>
>>
>>
>> --
>> *Geeth Munasinghe*
>> *WSO2, Inc. http://wso2.com  *
>> *lean.enterprise.middleware.*
>>
>> email: ge...@wso2.com
>> phone:(+94) 777911226 <+94%2077%20791%201226>
>>
>> 
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "WSO2 IoT Team Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to iot-group+unsubscr...@wso2.com.
>> For more options, visit https://groups.google.com/a/wso2.com/d/optout.
>>
>
>
>
> --
>
> Madawa Soysa / Software Engineer
> mada...@wso2.com / +94714616050 <+94%2071%20461%206050>
>
> *WSO2 Inc.*
> lean.enterprise.middleware
>
>   
>
>
>
>


-- 
*Nuwan Jayawardene*
*Software Engineering intern*
*WSO2, Inc.:http://wso2.com *
*lean.enterprise.middleware*
*Mobile  :- +94 71 1813299*


   - *Linkedin* *:- **https://www.linkedin.com/in/nuwa
   **njaya/
   *
   - * *
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Image persisting and retrieval mechanism for WSO2 IoT Server

2018-01-15 Thread Ruwan Yatawara
As to my knowledge, image analysis is not supported, and won't be supported
in the near future.

@Mohan, @Ramindu, please correct me if I am wrong.

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 1:01 PM, Nuwan Jayawardene  wrote:

> Hi Madawa,
>
> Have you evaluated this approach? What are the advantages and drawbacks in
>> terms of storage and retrieval of images by following this approach?
>
>
> I've yet to look more into this option. I was actually hoping for some
> feedback on whether or not I should pursue this or stick with the RDBMS
> approach since I'm not experienced enough with Siddhi to do a knowledgeable
> assessment.
> At the moment, for the use case at hand, a simple storage and retrieval
> would suffice. But if we consider the long run IMO it would be smarter to
> go with a Siddhi based approach.
> Then again comes the issue of whether Siddhi streams support image
> analytics.
>
> On Tue, Jan 16, 2018 at 12:50 PM, Madawa Soysa  wrote:
>
>> Hi Nuwan,
>>
>> 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.
>>
>>
>> Have you evaluated this approach? What are the advantages and drawbacks
>> in terms of storage and retrieval of images by following this approach?
>>
>> On Tue, Jan 16, 2018 at 12:36 PM, Geeth Munasinghe 
>> wrote:
>>
>>>
>>>
>>> On Tue, Jan 16, 2018 at 10:52 AM, Nuwan Jayawardene 
>>> 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.

>>>
>>> +1 for retrieving as a BinaryStream. This will make it easy to handle in
>>> the java level unlike handling as a file. This has to work in the cluster
>>> of servers, hence retrieving as a file will cause other syncing issues.
>>>
>>>
 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 *
 *lean.enterprise.middleware*
 *Mobile  :- +94 71 1813299 <+94%2071%20181%203299>*


- *Linkedin* *:- **https://www.linkedin.com/in/nuwa
**njaya/
*
- * *


>>>
>>>
>>> --
>>> *Geeth Munasinghe*
>>> *WSO2, Inc. http://wso2.com  *
>>> *lean.enterprise.middleware.*
>>>
>>> email: ge...@wso2.com
>>> phone:(+94) 777911226 <+94%2077%20791%201226>
>>>
>>> 
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "WSO2 IoT Team Group" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to iot-group+unsubscr...@wso2.com.
>>> For more options, visit https://groups.google.com/a/wso2.com/d/optout.
>>>
>>
>>
>>
>> --
>>
>> Madawa Soysa / Software Engineer
>> mada...@wso2.com / +94714616050 <+94%2071%20461%206050>
>>
>> *WSO2 Inc.*
>> lean.enterprise.middleware
>>
>>   
>>
>>
>>
>>
>
>
> --
> *Nuwan Jayawardene*
> *Software Engineering intern*
> 

Re: [Dev] Image persisting and retrieval mechanism for WSO2 IoT Server

2018-01-15 Thread Geeth Munasinghe
On Tue, Jan 16, 2018 at 10:52 AM, Nuwan Jayawardene  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.
>

+1 for retrieving as a BinaryStream. This will make it easy to handle in
the java level unlike handling as a file. This has to work in the cluster
of servers, hence retrieving as a file will cause other syncing issues.


> 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 *
> *lean.enterprise.middleware*
> *Mobile  :- +94 71 1813299 <+94%2071%20181%203299>*
>
>
>- *Linkedin* *:- **https://www.linkedin.com/in/nuwa
>**njaya/
>*
>- * *
>
>


-- 
*Geeth Munasinghe*
*WSO2, Inc. http://wso2.com  *
*lean.enterprise.middleware.*

email: ge...@wso2.com
phone:(+94) 777911226


___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Image persisting and retrieval mechanism for WSO2 IoT Server

2018-01-15 Thread Madawa Soysa
Hi Nuwan,

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.


Have you evaluated this approach? What are the advantages and drawbacks in
terms of storage and retrieval of images by following this approach?

On Tue, Jan 16, 2018 at 12:36 PM, Geeth Munasinghe  wrote:

>
>
> On Tue, Jan 16, 2018 at 10:52 AM, Nuwan Jayawardene 
> 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.
>>
>
> +1 for retrieving as a BinaryStream. This will make it easy to handle in
> the java level unlike handling as a file. This has to work in the cluster
> of servers, hence retrieving as a file will cause other syncing issues.
>
>
>> 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 *
>> *lean.enterprise.middleware*
>> *Mobile  :- +94 71 1813299 <+94%2071%20181%203299>*
>>
>>
>>- *Linkedin* *:- **https://www.linkedin.com/in/nuwa
>>**njaya/
>>*
>>- * *
>>
>>
>
>
> --
> *Geeth Munasinghe*
> *WSO2, Inc. http://wso2.com  *
> *lean.enterprise.middleware.*
>
> email: ge...@wso2.com
> phone:(+94) 777911226 <+94%2077%20791%201226>
>
> 
>
> --
> You received this message because you are subscribed to the Google Groups
> "WSO2 IoT Team Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to iot-group+unsubscr...@wso2.com.
> For more options, visit https://groups.google.com/a/wso2.com/d/optout.
>



-- 

Madawa Soysa / Software Engineer
mada...@wso2.com / +94714616050 <+94%2071%20461%206050>

*WSO2 Inc.*
lean.enterprise.middleware

  
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Image persisting and retrieval mechanism for WSO2 IoT Server

2018-01-15 Thread Rasika Perera
​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  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 
> 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 *
>> *lean.enterprise.middleware*
>> *Mobile  :- +94 71 1813299 <+94%2071%20181%203299>*
>>
>>
>>- *Linkedin* *:- **https://www.linkedin.com/in/nuwa
>>**njaya/
>>*
>>- * *
>>
>>
>


-- 
With Regards,

*Rasika Perera*
Senior Software Engineer
LinkedIn: http://lk.linkedin.com/in/rasika90



WSO2 Inc. www.wso2.com
lean.enterprise.middleware
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Image persisting and retrieval mechanism for WSO2 IoT Server

2018-01-15 Thread Kamidu Punchihewa
Hi Nuwan,

 am +1 for the second option of retrieving the image as a binary stream
too. There are approaches which can be used and at the moment in use also
to represent an image using the binary information. IMO your concern
regarding this option will not be an issue.

Thanks and Best Regards,


On Tue, Jan 16, 2018 at 11:41 AM, Ruwan Yatawara  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 
> 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 *
>> *lean.enterprise.middleware*
>> *Mobile  :- +94 71 1813299 <+94%2071%20181%203299>*
>>
>>
>>- *Linkedin* *:- **https://www.linkedin.com/in/nuwa
>>**njaya/
>>*
>>- * *
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "WSO2 IoT Team Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to iot-group+unsubscr...@wso2.com.
> For more options, visit https://groups.google.com/a/wso2.com/d/optout.
>



-- 
Kamidu Sachith Punchihewa
*Senior Software Engineer*
WSO2, Inc.
lean . enterprise . middleware
Mobile : +94 (0) 770566749 <%2B94%20%280%29%20773%20451194>

Disclaimer: This communication may contain privileged or other confidential
information and is intended exclusively for the addressee/s. If you are not
the intended recipient/s, or believe that you may have received this
communication in error, please reply to the sender indicating that fact and
delete the copy you received and in addition, you should not print, copy,
retransmit, disseminate, or otherwise use the information contained in this
communication. Internet communications cannot be guaranteed to be timely,
secure, error or virus-free. The sender does not accept liability for any
errors or omissions.
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Image persisting and retrieval mechanism for WSO2 IoT Server

2018-01-15 Thread Ruwan Yatawara
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  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 *
> *lean.enterprise.middleware*
> *Mobile  :- +94 71 1813299 <+94%2071%20181%203299>*
>
>
>- *Linkedin* *:- **https://www.linkedin.com/in/nuwa
>**njaya/
>*
>- * *
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev