Cloud Computing
Cloud-based computing usually involves groups of AWS resources, such as Amazon EC2 instances and Amazon Relational Database Service (RDS) instances, which must be created and managed collectively. For example, a web application typically requires application servers, database servers, load balancers, and so on. This group of instances is typically called a stack. AWS OpsWorks provides a simple and flexible way to create and manage stacks and applications. Here's the structure of our application server stack. It consists of a Node.js application servers running behind an Elastic Load Balancing load balancer, with a backend Amazon RDS database server. There is an OpsWorks tutorial attached below.
We implemented an AWS OpsWorks stack with a Node.js server layer and a mySQL/RDS database layer, shown in the screenshot below.
The Node.js server is established with StrongLoop. The StrongLoop API Platform features the popular open source LoopBack framework. LoopBack is a highly extensible, open-source Node.js framework. LoopBack enables you to quickly compose scalable APIs, runs on top of the Express web framework and conforms to the Swagger 2.0 specification. We created a model within our LoopBack application, and added five properties to each entry of our model, including temperature, humidity, VOC, CO2, and dust, corresponding to the data gathered by multiple sensors on Atmel board.
LoopBack memory is connected to Amazon RDS database and real-time data from the sensors will be stored into the database. After uploading our Node.js code to github, we attached it to OpsWorks App recipe and deployed the app to the whole stack.
LoopBack memory is connected to Amazon RDS database and real-time data from the sensors will be stored into the database. After uploading our Node.js code to github, we attached it to OpsWorks App recipe and deployed the app to the whole stack.
As for the database layer, we first used MySQL provided by OpsWorks. It turned out OpsWorks would create an EC2 instance for MySQL database and it's quite expensive to have an extra EC2 instance running for weeks. So we switched to AWS's own database, RDS.
Proudly powered by Weebly