Transform an IoT application from monolothic to microservices










0















I have a system composed of 3 sensors (Temperature, humidity, camera) attached to Arduino, 1 cloud, and 1 Mobile phone. I developed a monolithic IoT application that has different tasks needed to be executed in these three different locations (Arduino, cloud Mobile). all these sensors have common tasks which are: data detection, data transferring (executed on Arduino), data saving, data analysis and data notification (on the cloud), data visualization (on Mobile).



The problem here I know that a microservice is independent and it has its database. How to transform this application that I have to a one using microservice architecture? the first idea is representing each task as a microservice.



At the first, I considered each task as a component and I thought to represent each one as a microservice but they are linked. I mean that the output of the previous task is the input of the present one, So I can't make it like this because they aren't independent. Another thing for data collection microservice it should be placed on Arduino and the data should be sent to the cloud to be stored there in the database, so here we have a distant DB. For the data collection, I have the same idea as you since there are different things (sensors) so there will be diff microservices like (temperature data collection, camera data collection...).










share|improve this question
























  • your question is very abstract,it helps to have a more specific questions. Still I will try to give you direction:There are three sensors , temperature , humidity and camera, assuming all are collecting data about a single product feature like room. I will create one microservice for Data Collection (if data are about diff. things I will create multiple). One micro for sending notifications , one for data analysis .I am sure you have lots of doubts on why like this, then ask specific question and I will be able to ans. one reason is even if analysis don't work , collection should still work.

    – techagrammer
    Nov 15 '18 at 13:59











  • @techagrammer Thank you for your response. Exactly I am confused here because I know that a component and microservice are diff things. Please check the edited question.

    – Latifa
    Nov 15 '18 at 15:52
















0















I have a system composed of 3 sensors (Temperature, humidity, camera) attached to Arduino, 1 cloud, and 1 Mobile phone. I developed a monolithic IoT application that has different tasks needed to be executed in these three different locations (Arduino, cloud Mobile). all these sensors have common tasks which are: data detection, data transferring (executed on Arduino), data saving, data analysis and data notification (on the cloud), data visualization (on Mobile).



The problem here I know that a microservice is independent and it has its database. How to transform this application that I have to a one using microservice architecture? the first idea is representing each task as a microservice.



At the first, I considered each task as a component and I thought to represent each one as a microservice but they are linked. I mean that the output of the previous task is the input of the present one, So I can't make it like this because they aren't independent. Another thing for data collection microservice it should be placed on Arduino and the data should be sent to the cloud to be stored there in the database, so here we have a distant DB. For the data collection, I have the same idea as you since there are different things (sensors) so there will be diff microservices like (temperature data collection, camera data collection...).










share|improve this question
























  • your question is very abstract,it helps to have a more specific questions. Still I will try to give you direction:There are three sensors , temperature , humidity and camera, assuming all are collecting data about a single product feature like room. I will create one microservice for Data Collection (if data are about diff. things I will create multiple). One micro for sending notifications , one for data analysis .I am sure you have lots of doubts on why like this, then ask specific question and I will be able to ans. one reason is even if analysis don't work , collection should still work.

    – techagrammer
    Nov 15 '18 at 13:59











  • @techagrammer Thank you for your response. Exactly I am confused here because I know that a component and microservice are diff things. Please check the edited question.

    – Latifa
    Nov 15 '18 at 15:52














0












0








0








I have a system composed of 3 sensors (Temperature, humidity, camera) attached to Arduino, 1 cloud, and 1 Mobile phone. I developed a monolithic IoT application that has different tasks needed to be executed in these three different locations (Arduino, cloud Mobile). all these sensors have common tasks which are: data detection, data transferring (executed on Arduino), data saving, data analysis and data notification (on the cloud), data visualization (on Mobile).



The problem here I know that a microservice is independent and it has its database. How to transform this application that I have to a one using microservice architecture? the first idea is representing each task as a microservice.



At the first, I considered each task as a component and I thought to represent each one as a microservice but they are linked. I mean that the output of the previous task is the input of the present one, So I can't make it like this because they aren't independent. Another thing for data collection microservice it should be placed on Arduino and the data should be sent to the cloud to be stored there in the database, so here we have a distant DB. For the data collection, I have the same idea as you since there are different things (sensors) so there will be diff microservices like (temperature data collection, camera data collection...).










share|improve this question
















I have a system composed of 3 sensors (Temperature, humidity, camera) attached to Arduino, 1 cloud, and 1 Mobile phone. I developed a monolithic IoT application that has different tasks needed to be executed in these three different locations (Arduino, cloud Mobile). all these sensors have common tasks which are: data detection, data transferring (executed on Arduino), data saving, data analysis and data notification (on the cloud), data visualization (on Mobile).



The problem here I know that a microservice is independent and it has its database. How to transform this application that I have to a one using microservice architecture? the first idea is representing each task as a microservice.



At the first, I considered each task as a component and I thought to represent each one as a microservice but they are linked. I mean that the output of the previous task is the input of the present one, So I can't make it like this because they aren't independent. Another thing for data collection microservice it should be placed on Arduino and the data should be sent to the cloud to be stored there in the database, so here we have a distant DB. For the data collection, I have the same idea as you since there are different things (sensors) so there will be diff microservices like (temperature data collection, camera data collection...).







microservices iot






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 16 '18 at 16:57







Latifa

















asked Nov 15 '18 at 0:01









LatifaLatifa

1315




1315












  • your question is very abstract,it helps to have a more specific questions. Still I will try to give you direction:There are three sensors , temperature , humidity and camera, assuming all are collecting data about a single product feature like room. I will create one microservice for Data Collection (if data are about diff. things I will create multiple). One micro for sending notifications , one for data analysis .I am sure you have lots of doubts on why like this, then ask specific question and I will be able to ans. one reason is even if analysis don't work , collection should still work.

    – techagrammer
    Nov 15 '18 at 13:59











  • @techagrammer Thank you for your response. Exactly I am confused here because I know that a component and microservice are diff things. Please check the edited question.

    – Latifa
    Nov 15 '18 at 15:52


















  • your question is very abstract,it helps to have a more specific questions. Still I will try to give you direction:There are three sensors , temperature , humidity and camera, assuming all are collecting data about a single product feature like room. I will create one microservice for Data Collection (if data are about diff. things I will create multiple). One micro for sending notifications , one for data analysis .I am sure you have lots of doubts on why like this, then ask specific question and I will be able to ans. one reason is even if analysis don't work , collection should still work.

    – techagrammer
    Nov 15 '18 at 13:59











  • @techagrammer Thank you for your response. Exactly I am confused here because I know that a component and microservice are diff things. Please check the edited question.

    – Latifa
    Nov 15 '18 at 15:52

















your question is very abstract,it helps to have a more specific questions. Still I will try to give you direction:There are three sensors , temperature , humidity and camera, assuming all are collecting data about a single product feature like room. I will create one microservice for Data Collection (if data are about diff. things I will create multiple). One micro for sending notifications , one for data analysis .I am sure you have lots of doubts on why like this, then ask specific question and I will be able to ans. one reason is even if analysis don't work , collection should still work.

– techagrammer
Nov 15 '18 at 13:59





your question is very abstract,it helps to have a more specific questions. Still I will try to give you direction:There are three sensors , temperature , humidity and camera, assuming all are collecting data about a single product feature like room. I will create one microservice for Data Collection (if data are about diff. things I will create multiple). One micro for sending notifications , one for data analysis .I am sure you have lots of doubts on why like this, then ask specific question and I will be able to ans. one reason is even if analysis don't work , collection should still work.

– techagrammer
Nov 15 '18 at 13:59













@techagrammer Thank you for your response. Exactly I am confused here because I know that a component and microservice are diff things. Please check the edited question.

– Latifa
Nov 15 '18 at 15:52






@techagrammer Thank you for your response. Exactly I am confused here because I know that a component and microservice are diff things. Please check the edited question.

– Latifa
Nov 15 '18 at 15:52













1 Answer
1






active

oldest

votes


















0














First let me clear a confusion : when we say microservices are independent then how can we design a microservice in which output of the previous task is input for the next one.



First when we say microservice it means it is indepently deployable and manageable but as in any system there are dependencies microservices also depends upon each other. You can read about reactice microservice.



So you can have microservices which depend on one another, but we want these dependencies to be minimum.



Now lets understand benefits we want to adopt while doing microservice (this will help to answer your question):



  1. Indepently deployable components (which scale up the deployment speed)- As in any big application there are components which are relatively independent of each other then if I want to change something in one component I should be confident another will not be impacted. In monolithic as all are inone binary impact would be high.


  2. Independently Scalable - as diff. components require diff. scale we can have diff. types of databases and machine requirement.


and there are various and also some overhead which a microservice architecture bring (cant go in detail here , read on these things online)



NOW WE WILL DISCUSS the approach



  1. As data collection is independent on how and what kind of analysis happen on that. I would have a DataCollectionService on cloud (collects data from all sensors, we create diff. for diff. sensors if those data are completely independent).


  2. DataAnalysis as separate service (dosent need to know a thing about how data is collected like is it using mqtt , webscoket , periodic or in batches or whatever). This service needs data and will act upon it.


  3. Notification Service


  4. DataSendClient on Arduino : some client which sends data to data collection service.






share|improve this answer























  • Thank you again for this explication, it helps me a lot. I have another question. In my case, I have a distributed system with three diff locations (Arduino, cloud and mobile phone). Can I have a microservice running on the mobile phone? for example, Data visualization microservice that shows graphs according to demanded sensors data (we can have an M1 phone asking for temperature & humidity and another one M2 asking only for camera data)

    – Latifa
    Nov 16 '18 at 19:00











  • here software running on phones will be termed as clients , microservice will be that Code running in the cloud which provides the data to these clients.

    – techagrammer
    Nov 20 '18 at 15:27










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53310576%2ftransform-an-iot-application-from-monolothic-to-microservices%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














First let me clear a confusion : when we say microservices are independent then how can we design a microservice in which output of the previous task is input for the next one.



First when we say microservice it means it is indepently deployable and manageable but as in any system there are dependencies microservices also depends upon each other. You can read about reactice microservice.



So you can have microservices which depend on one another, but we want these dependencies to be minimum.



Now lets understand benefits we want to adopt while doing microservice (this will help to answer your question):



  1. Indepently deployable components (which scale up the deployment speed)- As in any big application there are components which are relatively independent of each other then if I want to change something in one component I should be confident another will not be impacted. In monolithic as all are inone binary impact would be high.


  2. Independently Scalable - as diff. components require diff. scale we can have diff. types of databases and machine requirement.


and there are various and also some overhead which a microservice architecture bring (cant go in detail here , read on these things online)



NOW WE WILL DISCUSS the approach



  1. As data collection is independent on how and what kind of analysis happen on that. I would have a DataCollectionService on cloud (collects data from all sensors, we create diff. for diff. sensors if those data are completely independent).


  2. DataAnalysis as separate service (dosent need to know a thing about how data is collected like is it using mqtt , webscoket , periodic or in batches or whatever). This service needs data and will act upon it.


  3. Notification Service


  4. DataSendClient on Arduino : some client which sends data to data collection service.






share|improve this answer























  • Thank you again for this explication, it helps me a lot. I have another question. In my case, I have a distributed system with three diff locations (Arduino, cloud and mobile phone). Can I have a microservice running on the mobile phone? for example, Data visualization microservice that shows graphs according to demanded sensors data (we can have an M1 phone asking for temperature & humidity and another one M2 asking only for camera data)

    – Latifa
    Nov 16 '18 at 19:00











  • here software running on phones will be termed as clients , microservice will be that Code running in the cloud which provides the data to these clients.

    – techagrammer
    Nov 20 '18 at 15:27















0














First let me clear a confusion : when we say microservices are independent then how can we design a microservice in which output of the previous task is input for the next one.



First when we say microservice it means it is indepently deployable and manageable but as in any system there are dependencies microservices also depends upon each other. You can read about reactice microservice.



So you can have microservices which depend on one another, but we want these dependencies to be minimum.



Now lets understand benefits we want to adopt while doing microservice (this will help to answer your question):



  1. Indepently deployable components (which scale up the deployment speed)- As in any big application there are components which are relatively independent of each other then if I want to change something in one component I should be confident another will not be impacted. In monolithic as all are inone binary impact would be high.


  2. Independently Scalable - as diff. components require diff. scale we can have diff. types of databases and machine requirement.


and there are various and also some overhead which a microservice architecture bring (cant go in detail here , read on these things online)



NOW WE WILL DISCUSS the approach



  1. As data collection is independent on how and what kind of analysis happen on that. I would have a DataCollectionService on cloud (collects data from all sensors, we create diff. for diff. sensors if those data are completely independent).


  2. DataAnalysis as separate service (dosent need to know a thing about how data is collected like is it using mqtt , webscoket , periodic or in batches or whatever). This service needs data and will act upon it.


  3. Notification Service


  4. DataSendClient on Arduino : some client which sends data to data collection service.






share|improve this answer























  • Thank you again for this explication, it helps me a lot. I have another question. In my case, I have a distributed system with three diff locations (Arduino, cloud and mobile phone). Can I have a microservice running on the mobile phone? for example, Data visualization microservice that shows graphs according to demanded sensors data (we can have an M1 phone asking for temperature & humidity and another one M2 asking only for camera data)

    – Latifa
    Nov 16 '18 at 19:00











  • here software running on phones will be termed as clients , microservice will be that Code running in the cloud which provides the data to these clients.

    – techagrammer
    Nov 20 '18 at 15:27













0












0








0







First let me clear a confusion : when we say microservices are independent then how can we design a microservice in which output of the previous task is input for the next one.



First when we say microservice it means it is indepently deployable and manageable but as in any system there are dependencies microservices also depends upon each other. You can read about reactice microservice.



So you can have microservices which depend on one another, but we want these dependencies to be minimum.



Now lets understand benefits we want to adopt while doing microservice (this will help to answer your question):



  1. Indepently deployable components (which scale up the deployment speed)- As in any big application there are components which are relatively independent of each other then if I want to change something in one component I should be confident another will not be impacted. In monolithic as all are inone binary impact would be high.


  2. Independently Scalable - as diff. components require diff. scale we can have diff. types of databases and machine requirement.


and there are various and also some overhead which a microservice architecture bring (cant go in detail here , read on these things online)



NOW WE WILL DISCUSS the approach



  1. As data collection is independent on how and what kind of analysis happen on that. I would have a DataCollectionService on cloud (collects data from all sensors, we create diff. for diff. sensors if those data are completely independent).


  2. DataAnalysis as separate service (dosent need to know a thing about how data is collected like is it using mqtt , webscoket , periodic or in batches or whatever). This service needs data and will act upon it.


  3. Notification Service


  4. DataSendClient on Arduino : some client which sends data to data collection service.






share|improve this answer













First let me clear a confusion : when we say microservices are independent then how can we design a microservice in which output of the previous task is input for the next one.



First when we say microservice it means it is indepently deployable and manageable but as in any system there are dependencies microservices also depends upon each other. You can read about reactice microservice.



So you can have microservices which depend on one another, but we want these dependencies to be minimum.



Now lets understand benefits we want to adopt while doing microservice (this will help to answer your question):



  1. Indepently deployable components (which scale up the deployment speed)- As in any big application there are components which are relatively independent of each other then if I want to change something in one component I should be confident another will not be impacted. In monolithic as all are inone binary impact would be high.


  2. Independently Scalable - as diff. components require diff. scale we can have diff. types of databases and machine requirement.


and there are various and also some overhead which a microservice architecture bring (cant go in detail here , read on these things online)



NOW WE WILL DISCUSS the approach



  1. As data collection is independent on how and what kind of analysis happen on that. I would have a DataCollectionService on cloud (collects data from all sensors, we create diff. for diff. sensors if those data are completely independent).


  2. DataAnalysis as separate service (dosent need to know a thing about how data is collected like is it using mqtt , webscoket , periodic or in batches or whatever). This service needs data and will act upon it.


  3. Notification Service


  4. DataSendClient on Arduino : some client which sends data to data collection service.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 16 '18 at 6:06









techagrammertechagrammer

728414




728414












  • Thank you again for this explication, it helps me a lot. I have another question. In my case, I have a distributed system with three diff locations (Arduino, cloud and mobile phone). Can I have a microservice running on the mobile phone? for example, Data visualization microservice that shows graphs according to demanded sensors data (we can have an M1 phone asking for temperature & humidity and another one M2 asking only for camera data)

    – Latifa
    Nov 16 '18 at 19:00











  • here software running on phones will be termed as clients , microservice will be that Code running in the cloud which provides the data to these clients.

    – techagrammer
    Nov 20 '18 at 15:27

















  • Thank you again for this explication, it helps me a lot. I have another question. In my case, I have a distributed system with three diff locations (Arduino, cloud and mobile phone). Can I have a microservice running on the mobile phone? for example, Data visualization microservice that shows graphs according to demanded sensors data (we can have an M1 phone asking for temperature & humidity and another one M2 asking only for camera data)

    – Latifa
    Nov 16 '18 at 19:00











  • here software running on phones will be termed as clients , microservice will be that Code running in the cloud which provides the data to these clients.

    – techagrammer
    Nov 20 '18 at 15:27
















Thank you again for this explication, it helps me a lot. I have another question. In my case, I have a distributed system with three diff locations (Arduino, cloud and mobile phone). Can I have a microservice running on the mobile phone? for example, Data visualization microservice that shows graphs according to demanded sensors data (we can have an M1 phone asking for temperature & humidity and another one M2 asking only for camera data)

– Latifa
Nov 16 '18 at 19:00





Thank you again for this explication, it helps me a lot. I have another question. In my case, I have a distributed system with three diff locations (Arduino, cloud and mobile phone). Can I have a microservice running on the mobile phone? for example, Data visualization microservice that shows graphs according to demanded sensors data (we can have an M1 phone asking for temperature & humidity and another one M2 asking only for camera data)

– Latifa
Nov 16 '18 at 19:00













here software running on phones will be termed as clients , microservice will be that Code running in the cloud which provides the data to these clients.

– techagrammer
Nov 20 '18 at 15:27





here software running on phones will be termed as clients , microservice will be that Code running in the cloud which provides the data to these clients.

– techagrammer
Nov 20 '18 at 15:27



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53310576%2ftransform-an-iot-application-from-monolothic-to-microservices%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

Barbados

How to read a connectionString WITH PROVIDER in .NET Core?

Node.js Script on GitHub Pages or Amazon S3