Docsity

Assignment 2 for Cloud Computing 1644, Assignments of Distributed Programming and Computing

Toggle sidebar
bg1
ASSIGNMENT 2 FRONT SHEET
Qualification
BTEC Level 5 HND Diploma in Computing
Unit number and title
Unit 16: Cloud Computing
Submission date
Date Received 1st
submission
Re-submission Date
Date Received 2nd
submission
Student Name
PHAN MINH TRI
Student ID
GCD201632
Class
GCD0904
Assessor name
TRAN TRONG MINH
Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that
making a false declaration is a form of malpractice.
Student’s signature
Grading grid
P5
P6
P7
P8
M3
M4
D2
D3
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d

Partial preview of the text

Download Assignment 2 for Cloud Computing 1644 and more Assignments Distributed Programming and Computing in PDF only on Docsity!

ASSIGNMENT 2 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing

Unit number and title Unit 16 : Cloud Computing

Submission date Date Received 1st submission

Re-submission Date Date Received 2nd submission

Student Name PHAN MINH TRI Student ID GCD

Class GCD0904 Assessor name TRAN TRONG MINH

Student declaration

I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that

making a false declaration is a form of malpractice.

Student’s signature

Grading grid

P5 P6 P7 P8 M3 M4 D2 D

Summative Feedback:Resubmission Feedback:

Grade: Assessor Signature: Date:

Internal Verifier’s Comments:

Signature & Date:

Table of Contents

  • Chapter 1 – Configure a Cloud Computing platform with a cloud service provider’s framework (P5)
    • I. Tools
        1. IDE
        1. Framework
        1. Database
    • II. Deploy Website on Heroku...............................................................................................................................
  • Chapter 2 – Implement a Cloud platform with open – source tools (P6)
    • I. Code Implementation
        1. Database connection
        1. Authentication.............................................................................................................................................
        1. CRUD Function
    • II. Screen shots for the project
  • appropriate solutions to these problems (P7) Chapter 3 – Analyze the most common problems which arise in a Cloud Computing platform and discuss
    • I. Optimizing Cloud Expenses
    • II. Migrating Existing Applications onto the Cloud
    • III. Cost Calculations Within Limits
    • IV. Proprietary Lock – in
    • V. Consistent Performance
    • VI. Data Security Violation
  • Chapter 4 – Assess the most common security issues in cloud environments (P8)
    • I. Misconfiguration.............................................................................................................................................
    • II. Unauthorized Access
    • III. Insecure Interfaces/APIs
    • IV. Hijacking of Accounts
    • V. External Sharing of Data.................................................................................................................................
    • VI. Lack of Visibility
  • References
  • Figure 1: Visual Studio Code Table of Figures
  • Figure 2: ExpressJS Framework.....................................................................................................................................
  • Figure 3: PostgreSQL on Heroku
  • Figure 4: Set up repository on local and push to GitHub..............................................................................................
  • Figure 5: Repository on GitHub
  • Figure 6: Create new app on Heroku
  • Figure 7: Set up database on Heroku..........................................................................................................................
  • Figure 8: Database credential on Heroku
  • Figure 9: Set up database on pgAdmin
  • Figure 10: Connect repository to Heroku
  • Figure 11: Deploy application on Heroku
  • Figure 12: Testing application on Heroku
  • Figure 13: Model
  • Figure 14: View
  • Figure 15: Controller
  • Figure 16: Connect Database Server...........................................................................................................................
  • Figure 17: Authentication function
  • Figure 18: Display Table function
  • Figure 19: Implement Add Function
  • Figure 20: Add Function
  • Figure 21: Read Function
  • Figure 22: Update Function
  • Figure 23: Implement Update Function......................................................................................................................
  • Figure 24: Delete Function..........................................................................................................................................
  • Figure 25: Implement Delete Function
  • Figure 26: Home Page
  • Figure 27: Login Page
  • Figure 28: Login page when user login
  • Figure 29: Products Page when boss login
  • Figure 30: Before adding.............................................................................................................................................
  • Figure 31: After Adding
  • Figure 32: Read Function
  • Figure 33: Before Updating
  • Figure 34: After updating
  • Figure 35: Delete Function..........................................................................................................................................
  • Terminal Support: When the user has to start from the root of the directory to do a certain task,

the in-built terminal or console allows the user to avoid switching between two displays.

  • Web Support: Web application support is integrated in. VSC can thus build and support web

applications.

  • Git Support: Online resources may be retrieved from Git Hub Repo, and vice versa; saving is

also possible. Cloning code that is publicly accessible on the internet is often referred to as

resource pulling. This code can be modified and saved later

  1. Framework

❖ I plan to utilize the Express framework for this project. Express is a Node.js web application

framework that provides a strong feature set for online and mobile apps. Creating a strong API is

quick and straightforward with a plethora of HTTP utility methods and middleware building tools

at your disposal. Express delivers a robust set of fundamental web application functionality without

obscuring the Node.js features you know and love.

Figure 2 : ExpressJS Framework

  1. Database

❖ I decide to use PostgreSQL for this project instead of MonogoDB because these reasons:

  • PostgreSQL has advanced features such as Multi-Version Concurrency Control (MVCC), point

in time recovery, tablespaces, asynchronous replication, nested transactions, online/hot backups,

a powerful query planner/optimizer, and write ahead logging for fault tolerance.

  • PostgreSQL runs on most common operating systems, including practically all Linux and Unix

variants, Windows, and Mac OS X. Its open-source nature makes it simple to upgrade and

enhance. You may design your own data types in PostgreSQL, create custom functions, and even

write code in another programming language (such as Python) without having to recompile the

database. And, of course, PostgreSQL is free on Heroku

Figure 3 : PostgreSQL on Heroku II. Deploy Website on Heroku

❖ Step 1 : Set up repository on Visual Studio Code and push to GitHub

Figure 4 : Set up repository on local and push to GitHub

❖ Step 3 : Set up PostgreSQL on Heroku

Figure 7 : Set up database on Heroku

❖ Step 4 : Connect PostgreSQL on Heroku with pgAdmin on local

Figure 8 : Database credential on Heroku

Figure 9 : Set up database on pgAdmin

❖ Step 5 : Connect Heroku with repository on GitHub

Figure 10 : Connect repository to Heroku

Figure 12 : Testing application on Heroku

Chapter 2 – Implement a Cloud platform with open – source tools (P6)

I. Code Implementation

❖ This project following MVC model so that I can handle source code easier.

  • Model (M): This part is responsible for all functions of the project Figure 13 : Model
  • View (V): This part is used for display view for the project Figure 14 : View
  • Controller (C): This part has folder “routes”, which implemented all functions of the project Figure 15 : Controller

❖ Class tableDisplay.js is in responsible of showing product information based on which user logs in,

such as the boss; he/she can keep track of all product data, but other shops in the firm just read the

product data that they have from the database.

Figure 18 : Display Table function

  1. CRUD Function

❖ Create Function : In the class users.js, code for the 'Add' product method. This is a function logic

since it oversees processing the information entered by the user. The 'url' module is required to break

a web URL into readable bits. Then we execute the method 'addAction' (from the AddFunction.js

class) with the parameter'req' (this is data provided through user request). Finally, the function

renders the user.ejs class, sending data to that class for display.

Figure 19 : Implement Add Function

Figure 20 : Add Function

❖ Read Function : Class tableDisplay.js is responsible for showing data in a table by receiving data

from a database and returning it to the table; subsequent functions will use this 'tableDisplay' method

to display data again.

❖ Update Function : Users.js contains the code for the 'Edit' product function. This is a function logic

since it oversees processing the information entered by the user. The 'url' module is required to divide

up a web URL into readable bits to execute a user request. Then we call the EditFunction.js class

function 'editAction' with the argument’s 'id' and 'body'.

Figure 22 : Update Function Figure 23 : Implement Update Function

❖ Delete Function : In the class users.js, code for the 'Delete' product method. This is a function logic

since it oversees processing the information entered by the user. The 'url' module is required to break

a web URL into readable bits. The method 'deleteAction' (from the DeleteFunction.js class) is then

called with the parameter 'id' (created from the beginning). Finally, the code will show the user.ejs

class by transferring the data to it.

Figure 24 : Delete Function Figure 25 : Implement Delete Function