SlideShare a Scribd company logo
Back-end Development
Intro to AWS and Flask
Rough Plan (please add to this, it is just some rough
ideas I had)
Me:
intro to AWS slides
○ What it is
○ why should you learn about it
○ AWS services
○ pricing
○ what is RDS
● Setting up an RDS database
● me connecting to it
● set up AWS user and permissions for Milind to connect
Milind stuff
● slides talking about what flask is, what it’s used for, flask basics, quick recap on HTTP methods (don’t really need to go into detail just
maybe say what for example a POST request is used for generally and give an example of a complete POST request (an example
payload, and response) , maybe just list out all the SQL commands we are going to use ahead of time on the slides just so they don’t
get overwhelmed when they see them in the code). They should have some exposure to SQL because of the WISC sql workshops
though), etc
● Make a REST api with endpoints GET api/articles/:id, GET api/articles/, POST api/articles, /PUT api/articles/id (let’s use ‘articles’
instead of posts to make it less confusing (HTTP post vs an actual post)
● a post consists of three things: title, body, author (let’s avoid using images to avoid unnecessary complexity)
● push your stuff to a git repository
● Basically just a bunch of servers that can be accessed through the internet
● For example.
○ Ex. you could be storing documents in the cloud if you use
OneDrive/Google Drive/etc
○ If you run your python program on Google’s servers, you can say that
you are running your python program in the ‘cloud’
What is the cloud?
What is AWS?
● Amazon Web Services (AWS) is a cloud service provider
● on-demand delivery of IT resources over the internet
● Examples of it’s services include:
○ Elastic Compute Engine (EC2) - virtual machine
○ Relational Database Service (RDS) - database
○ Amazon S3 - cloud object storage
○ Over 200 more!
● Anything your app needs, AWS probably has a service to help you!
○ youtube.com/watch?v=JIbIYCM48to
Why learn AWS?
● AWS is the leading cloud service provider in the world
● Used by companies like Netflix, Sony, Disney, Nasa, Epic Games, Reddit, etc .
● It’s an extremely useful skill to have on your resume!
source:https://www.statista.com/chart/18819/worldwide-market-share-of-leading-cloud-infrastructure-service-providers/:
Benefits of using the cloud
● Trade capital expense for variable expense
● Don’t need to know how much hardware you need upfront
● Increase Agility ex. only takes a couple clicks to launch a website
● Extremely easy to deploy your products globally
● Benefit from massive economies of scale -> costs less to do stuff in the cloud!
● Don’t need to maintain hardware anymore!
From a software engineering POV
What we’ll be doing in today’s workshop
REST API (running
on AWS EC2)
Database (running
on AWS RDS)
● “A software intermediary that allows two applications to talk to each other.”
● How can the front-end get data from the back-end?
What is an API
?
What’s an API’s purpose?
● We could let the front-end deal with all the complexity of retrieving the data
○ i.e connecting to database, querying the database, structuring/filtering
the data that came from the database, etc
What is an API? continued
What is an API? continued
What’s an API’s purpose?
● Better way:
○ Front-end send requests to specific ‘endpoints’ on the back-end and
waits for data to be sent back
■ Ex. http://some-server/api/cats
■ Ex. http://some-server/api/users/2
○ Let the back-end deal with all the internal complexity!
○ Similar to how we create public interfaces with classes in languages
like Python/Java/etc (users need to know what’s going on internally in
class, we can just use its methods and attributes)
● Say I want to retrieve some data about all the users of my application
● I can just send a GET request to http://my-server/api/users and I will get
back some data like this:
●
[
{
first_name: “Bobby”,
last_name: “Daniels”
},
{
first_name: “Paul”,
last_name: “Smith”
}
[
For example...
HTTP Request Methods
GET: Retrieve a resource (some data) on the server
POST: Create a new resource on the server
PUT: Update a resource on the server
DELETE: Delete a resource
etc.
and when to use each
Quick Demo of what we will be making
AWS Services that we will be
using today to make it
EC2 = Elastic Compute Engine
● A virtual machine that runs on AWS’ physical servers
● You can run any OS you want on it, including Ubuntu, Amazon Linux,
MacOS, WIndows, etc.
● You can upgrade an EC2 instance to whatever specs you’d like (including
memory, cpu, storage)
● Examples of what you can do:
○ Run demanding tasks (maybe training a ML model, performing large
scale data analysis, etc)
○ Host a minecraft server
○ Do (almost) anything you could with a normal computer!
AWS EC2
RDS = Relational Database Service
● A managed PostgreSQL/MySQL/Oracle/etc database
● Some cool features of this service
○ Offers automatic database backups
○ Auto-scaling (the database can scale up and down in terms of its
processing power depending on the current demand)
○ etc.
AWS RDS
Additional AWS Topics
A security group acts as a firewall that controls what gets in and out of your
EC2/RDS/etc instances.
Example:
AWS Security Group
AWS VPC
VPC - Virtual Private Cloud
● Your own private network within AWS
● A logically isolated section of the AWS Cloud where you can launch AWS
resources in a virtual network that you define
● Don’t worry about this for this workshop!
AWS Free Tier
AWS RDS Pricing
Let’s set up a Database on AWS!
Flask is Python based lightweight framework used to
build web applications.
We will be using Flask to make an API today.
API (Application Programming Interface) is an application
that provides an interface so that the database and the
frontend can interact. API uses HTTP request to
communicate with frontend.
Python Flask
200 OK: The response has succeeded!
201 Created: The request has succeeded, and the resource has been created (usually for POST)
400 Bad Request: The server could not understand the request due to invalid syntax
401 Unauthorized: The client is not allowed to get the requested response
404 Not Found: The server cannot find the requested resource
418 Unprocessable Entity: The server unable to process the contained instructions.
500 Internal Server Error: The server has encountered an issue while processing your request
HTTP Request
We can make different types of requests: GET, POST, PUT, PATCH, etc
Example:
POST /articles
{
author: ‘gdsc’,
title: ‘welcome to apis’,
body: ‘blah blah blah’
}
Making a request
Allows you to use ORM (Object Relational mapping), which provides an interface
for using OOPs to interact with database.
This allows you to not write raw SQL
Flask SQLAlchemy
db.Model Ability to create and manipulate models/tables
db.session Ability to create and manipulate transactions/queries
db.session.add(person) It is used as an insert SQL Query
db.session.commit() It is used to run the transaction
Model is a description of the database table in ‘class’ form. This helps
SQLAlchemy map the database table to an object.
Serialization is converting the object in a more readable form.
For example:
<Article 1> is an object of article but you don’t want to send the object itself so
you convert this object to something like:
{
title: ‘welcome to gdsc’,
body: ‘blah blah blah’
}
Model and Serialization
Useful functions
MyModel.query Used to return the query table
MyModel.query.filter_by(<expression>)
eg : name = 'Milind'
Used to filter the query object and return
only the one/many you asked for
MyModel.query.filter(<expression>)
eg: Person.name ="Milind", Team.name = "Pod7"
More flexible to use like filter_by method
MyModel.query.first() Used to get the first result of a query/list of
responses
MyModel.query.all() Used to get all the results of a query
MyModel.query.limit(<number>).all() Used to get a limited number of response
Note that “MyModel” is just some arbitrary model that we made up for this slide
api.py (used to create the endpoints)
Basics
model.py (used to describe the database)
Connecting to Database
Let’s create an API !!
IF YOU START UP ANY AWS RESOURCES,
PLEASE REMEMBER TO DELETE THEM
WHEN YOU ARE DONE USING THEM. WE
ARE NOT RESPONSIBLE FOR ANY
FINANCIAL LOSSES if you forget to do
this :)))
Thanks for coming
today!
Ad

More Related Content

Similar to Back-end (Flask_AWS) (20)

Introduction to amazon web services for developers
Introduction to amazon web services for developersIntroduction to amazon web services for developers
Introduction to amazon web services for developers
Ciklum Ukraine
 
AWS glue technical enablement training
AWS glue technical enablement trainingAWS glue technical enablement training
AWS glue technical enablement training
Info Alchemy Corporation
 
Not Your Father’s Web App: The Cloud-Native Architecture of images.nasa.gov
Not Your Father’s Web App: The Cloud-Native Architecture of images.nasa.govNot Your Father’s Web App: The Cloud-Native Architecture of images.nasa.gov
Not Your Father’s Web App: The Cloud-Native Architecture of images.nasa.gov
Chris Shenton
 
Deep dive into cloud security - Jaimin Gohel & Virendra Rathore
Deep dive into cloud security - Jaimin Gohel & Virendra RathoreDeep dive into cloud security - Jaimin Gohel & Virendra Rathore
Deep dive into cloud security - Jaimin Gohel & Virendra Rathore
NSConclave
 
Building Linked Data Platform with AWS
Building Linked Data Platform with AWSBuilding Linked Data Platform with AWS
Building Linked Data Platform with AWS
EugeneMorozov
 
AWS Interview Questions and Answers_2023.pdf
AWS Interview Questions and Answers_2023.pdfAWS Interview Questions and Answers_2023.pdf
AWS Interview Questions and Answers_2023.pdf
nishajeni1
 
AWS Interview Questions and Answers.pdf
AWS Interview Questions and Answers.pdfAWS Interview Questions and Answers.pdf
AWS Interview Questions and Answers.pdf
nishajeni1
 
Windows Azure and a little SQL Data Services
Windows Azure and a little SQL Data ServicesWindows Azure and a little SQL Data Services
Windows Azure and a little SQL Data Services
ukdpe
 
AWS SECURITY STATAGIES AND FRAMEWORK PRINCIPLES
AWS SECURITY STATAGIES AND FRAMEWORK PRINCIPLESAWS SECURITY STATAGIES AND FRAMEWORK PRINCIPLES
AWS SECURITY STATAGIES AND FRAMEWORK PRINCIPLES
jldavis3
 
node.js: Javascript's in your backend
node.js: Javascript's in your backendnode.js: Javascript's in your backend
node.js: Javascript's in your backend
David Padbury
 
Azure for ug
Azure for ugAzure for ug
Azure for ug
dotNETUserGroupDnipro
 
Scaling on AWS to the First 10 Million Users
Scaling on AWS to the First 10 Million Users Scaling on AWS to the First 10 Million Users
Scaling on AWS to the First 10 Million Users
mauerbac
 
Build Modern Web Apps Using ASP.NET Web API and AngularJS
Build Modern Web Apps Using ASP.NET Web API and AngularJSBuild Modern Web Apps Using ASP.NET Web API and AngularJS
Build Modern Web Apps Using ASP.NET Web API and AngularJS
Taiseer Joudeh
 
AWS Certified Solutions Architect Professional Course S15-S18
AWS Certified Solutions Architect Professional Course S15-S18AWS Certified Solutions Architect Professional Course S15-S18
AWS Certified Solutions Architect Professional Course S15-S18
Neal Davis
 
Building Cloud-Native Applications with Microsoft Windows Azure
Building Cloud-Native Applications with Microsoft Windows AzureBuilding Cloud-Native Applications with Microsoft Windows Azure
Building Cloud-Native Applications with Microsoft Windows Azure
Bill Wilder
 
PPT
PPTPPT
PPT
webhostingguy
 
PHP LAMP AWS RightSscale
PHP LAMP AWS RightSscalePHP LAMP AWS RightSscale
PHP LAMP AWS RightSscale
maxgribov
 
Cloud computing and the Windows Azure Services Platform (KU Leuven)
Cloud computing and the Windows Azure Services Platform (KU Leuven)Cloud computing and the Windows Azure Services Platform (KU Leuven)
Cloud computing and the Windows Azure Services Platform (KU Leuven)
Maarten Balliauw
 
HTTP Plugin for MySQL!
HTTP Plugin for MySQL!HTTP Plugin for MySQL!
HTTP Plugin for MySQL!
Ulf Wendel
 
An Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDBAn Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDB
Lee Theobald
 
Introduction to amazon web services for developers
Introduction to amazon web services for developersIntroduction to amazon web services for developers
Introduction to amazon web services for developers
Ciklum Ukraine
 
Not Your Father’s Web App: The Cloud-Native Architecture of images.nasa.gov
Not Your Father’s Web App: The Cloud-Native Architecture of images.nasa.govNot Your Father’s Web App: The Cloud-Native Architecture of images.nasa.gov
Not Your Father’s Web App: The Cloud-Native Architecture of images.nasa.gov
Chris Shenton
 
Deep dive into cloud security - Jaimin Gohel & Virendra Rathore
Deep dive into cloud security - Jaimin Gohel & Virendra RathoreDeep dive into cloud security - Jaimin Gohel & Virendra Rathore
Deep dive into cloud security - Jaimin Gohel & Virendra Rathore
NSConclave
 
Building Linked Data Platform with AWS
Building Linked Data Platform with AWSBuilding Linked Data Platform with AWS
Building Linked Data Platform with AWS
EugeneMorozov
 
AWS Interview Questions and Answers_2023.pdf
AWS Interview Questions and Answers_2023.pdfAWS Interview Questions and Answers_2023.pdf
AWS Interview Questions and Answers_2023.pdf
nishajeni1
 
AWS Interview Questions and Answers.pdf
AWS Interview Questions and Answers.pdfAWS Interview Questions and Answers.pdf
AWS Interview Questions and Answers.pdf
nishajeni1
 
Windows Azure and a little SQL Data Services
Windows Azure and a little SQL Data ServicesWindows Azure and a little SQL Data Services
Windows Azure and a little SQL Data Services
ukdpe
 
AWS SECURITY STATAGIES AND FRAMEWORK PRINCIPLES
AWS SECURITY STATAGIES AND FRAMEWORK PRINCIPLESAWS SECURITY STATAGIES AND FRAMEWORK PRINCIPLES
AWS SECURITY STATAGIES AND FRAMEWORK PRINCIPLES
jldavis3
 
node.js: Javascript's in your backend
node.js: Javascript's in your backendnode.js: Javascript's in your backend
node.js: Javascript's in your backend
David Padbury
 
Scaling on AWS to the First 10 Million Users
Scaling on AWS to the First 10 Million Users Scaling on AWS to the First 10 Million Users
Scaling on AWS to the First 10 Million Users
mauerbac
 
Build Modern Web Apps Using ASP.NET Web API and AngularJS
Build Modern Web Apps Using ASP.NET Web API and AngularJSBuild Modern Web Apps Using ASP.NET Web API and AngularJS
Build Modern Web Apps Using ASP.NET Web API and AngularJS
Taiseer Joudeh
 
AWS Certified Solutions Architect Professional Course S15-S18
AWS Certified Solutions Architect Professional Course S15-S18AWS Certified Solutions Architect Professional Course S15-S18
AWS Certified Solutions Architect Professional Course S15-S18
Neal Davis
 
Building Cloud-Native Applications with Microsoft Windows Azure
Building Cloud-Native Applications with Microsoft Windows AzureBuilding Cloud-Native Applications with Microsoft Windows Azure
Building Cloud-Native Applications with Microsoft Windows Azure
Bill Wilder
 
PHP LAMP AWS RightSscale
PHP LAMP AWS RightSscalePHP LAMP AWS RightSscale
PHP LAMP AWS RightSscale
maxgribov
 
Cloud computing and the Windows Azure Services Platform (KU Leuven)
Cloud computing and the Windows Azure Services Platform (KU Leuven)Cloud computing and the Windows Azure Services Platform (KU Leuven)
Cloud computing and the Windows Azure Services Platform (KU Leuven)
Maarten Balliauw
 
HTTP Plugin for MySQL!
HTTP Plugin for MySQL!HTTP Plugin for MySQL!
HTTP Plugin for MySQL!
Ulf Wendel
 
An Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDBAn Introduction To NoSQL & MongoDB
An Introduction To NoSQL & MongoDB
Lee Theobald
 

More from GDSC UofT Mississauga (20)

CSSC ML Workshop
CSSC ML WorkshopCSSC ML Workshop
CSSC ML Workshop
GDSC UofT Mississauga
 
ICCIT Council × GDSC: UX / UI and Figma
ICCIT Council × GDSC: UX / UI and FigmaICCIT Council × GDSC: UX / UI and Figma
ICCIT Council × GDSC: UX / UI and Figma
GDSC UofT Mississauga
 
Community Projects Info Session Fall 2023
Community Projects Info Session Fall 2023Community Projects Info Session Fall 2023
Community Projects Info Session Fall 2023
GDSC UofT Mississauga
 
GDSC x Deerhacks - Origami Workshop
GDSC x Deerhacks - Origami WorkshopGDSC x Deerhacks - Origami Workshop
GDSC x Deerhacks - Origami Workshop
GDSC UofT Mississauga
 
Reverse Engineering 101
Reverse Engineering 101Reverse Engineering 101
Reverse Engineering 101
GDSC UofT Mississauga
 
Michael's OWASP Juice Shop Workshop
Michael's OWASP Juice Shop WorkshopMichael's OWASP Juice Shop Workshop
Michael's OWASP Juice Shop Workshop
GDSC UofT Mississauga
 
MCSS × GDSC: Intro to Cybersecurity Workshop
MCSS × GDSC: Intro to Cybersecurity WorkshopMCSS × GDSC: Intro to Cybersecurity Workshop
MCSS × GDSC: Intro to Cybersecurity Workshop
GDSC UofT Mississauga
 
Basics of C
Basics of CBasics of C
Basics of C
GDSC UofT Mississauga
 
Discord Bot Workshop Slides
Discord Bot Workshop SlidesDiscord Bot Workshop Slides
Discord Bot Workshop Slides
GDSC UofT Mississauga
 
Web Scraping Workshop
Web Scraping WorkshopWeb Scraping Workshop
Web Scraping Workshop
GDSC UofT Mississauga
 
Devops Workshop
Devops WorkshopDevops Workshop
Devops Workshop
GDSC UofT Mississauga
 
Express
ExpressExpress
Express
GDSC UofT Mississauga
 
HTML_CSS_JS Workshop
HTML_CSS_JS WorkshopHTML_CSS_JS Workshop
HTML_CSS_JS Workshop
GDSC UofT Mississauga
 
DevOps Workshop Part 1
DevOps Workshop Part 1DevOps Workshop Part 1
DevOps Workshop Part 1
GDSC UofT Mississauga
 
Docker workshop GDSC_CSSC
Docker workshop GDSC_CSSCDocker workshop GDSC_CSSC
Docker workshop GDSC_CSSC
GDSC UofT Mississauga
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]
GDSC UofT Mississauga
 
Git Init (Introduction to Git)
Git Init (Introduction to Git)Git Init (Introduction to Git)
Git Init (Introduction to Git)
GDSC UofT Mississauga
 
Database Workshop Slides
Database Workshop SlidesDatabase Workshop Slides
Database Workshop Slides
GDSC UofT Mississauga
 
ChatGPT General Meeting
ChatGPT General MeetingChatGPT General Meeting
ChatGPT General Meeting
GDSC UofT Mississauga
 
Elon & Twitter General Meeting
Elon & Twitter General MeetingElon & Twitter General Meeting
Elon & Twitter General Meeting
GDSC UofT Mississauga
 
ICCIT Council × GDSC: UX / UI and Figma
ICCIT Council × GDSC: UX / UI and FigmaICCIT Council × GDSC: UX / UI and Figma
ICCIT Council × GDSC: UX / UI and Figma
GDSC UofT Mississauga
 
Community Projects Info Session Fall 2023
Community Projects Info Session Fall 2023Community Projects Info Session Fall 2023
Community Projects Info Session Fall 2023
GDSC UofT Mississauga
 
MCSS × GDSC: Intro to Cybersecurity Workshop
MCSS × GDSC: Intro to Cybersecurity WorkshopMCSS × GDSC: Intro to Cybersecurity Workshop
MCSS × GDSC: Intro to Cybersecurity Workshop
GDSC UofT Mississauga
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]
GDSC UofT Mississauga
 
Ad

Recently uploaded (20)

Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Ad

Back-end (Flask_AWS)

  • 2. Rough Plan (please add to this, it is just some rough ideas I had) Me: intro to AWS slides ○ What it is ○ why should you learn about it ○ AWS services ○ pricing ○ what is RDS ● Setting up an RDS database ● me connecting to it ● set up AWS user and permissions for Milind to connect Milind stuff ● slides talking about what flask is, what it’s used for, flask basics, quick recap on HTTP methods (don’t really need to go into detail just maybe say what for example a POST request is used for generally and give an example of a complete POST request (an example payload, and response) , maybe just list out all the SQL commands we are going to use ahead of time on the slides just so they don’t get overwhelmed when they see them in the code). They should have some exposure to SQL because of the WISC sql workshops though), etc ● Make a REST api with endpoints GET api/articles/:id, GET api/articles/, POST api/articles, /PUT api/articles/id (let’s use ‘articles’ instead of posts to make it less confusing (HTTP post vs an actual post) ● a post consists of three things: title, body, author (let’s avoid using images to avoid unnecessary complexity) ● push your stuff to a git repository
  • 3. ● Basically just a bunch of servers that can be accessed through the internet ● For example. ○ Ex. you could be storing documents in the cloud if you use OneDrive/Google Drive/etc ○ If you run your python program on Google’s servers, you can say that you are running your python program in the ‘cloud’ What is the cloud?
  • 4. What is AWS? ● Amazon Web Services (AWS) is a cloud service provider ● on-demand delivery of IT resources over the internet ● Examples of it’s services include: ○ Elastic Compute Engine (EC2) - virtual machine ○ Relational Database Service (RDS) - database ○ Amazon S3 - cloud object storage ○ Over 200 more! ● Anything your app needs, AWS probably has a service to help you! ○ youtube.com/watch?v=JIbIYCM48to
  • 5. Why learn AWS? ● AWS is the leading cloud service provider in the world ● Used by companies like Netflix, Sony, Disney, Nasa, Epic Games, Reddit, etc . ● It’s an extremely useful skill to have on your resume! source:https://www.statista.com/chart/18819/worldwide-market-share-of-leading-cloud-infrastructure-service-providers/:
  • 6. Benefits of using the cloud ● Trade capital expense for variable expense ● Don’t need to know how much hardware you need upfront ● Increase Agility ex. only takes a couple clicks to launch a website ● Extremely easy to deploy your products globally ● Benefit from massive economies of scale -> costs less to do stuff in the cloud! ● Don’t need to maintain hardware anymore! From a software engineering POV
  • 7. What we’ll be doing in today’s workshop REST API (running on AWS EC2) Database (running on AWS RDS)
  • 8. ● “A software intermediary that allows two applications to talk to each other.” ● How can the front-end get data from the back-end? What is an API ?
  • 9. What’s an API’s purpose? ● We could let the front-end deal with all the complexity of retrieving the data ○ i.e connecting to database, querying the database, structuring/filtering the data that came from the database, etc What is an API? continued
  • 10. What is an API? continued What’s an API’s purpose? ● Better way: ○ Front-end send requests to specific ‘endpoints’ on the back-end and waits for data to be sent back ■ Ex. http://some-server/api/cats ■ Ex. http://some-server/api/users/2 ○ Let the back-end deal with all the internal complexity! ○ Similar to how we create public interfaces with classes in languages like Python/Java/etc (users need to know what’s going on internally in class, we can just use its methods and attributes)
  • 11. ● Say I want to retrieve some data about all the users of my application ● I can just send a GET request to http://my-server/api/users and I will get back some data like this: ● [ { first_name: “Bobby”, last_name: “Daniels” }, { first_name: “Paul”, last_name: “Smith” } [ For example...
  • 12. HTTP Request Methods GET: Retrieve a resource (some data) on the server POST: Create a new resource on the server PUT: Update a resource on the server DELETE: Delete a resource etc. and when to use each
  • 13. Quick Demo of what we will be making
  • 14. AWS Services that we will be using today to make it
  • 15. EC2 = Elastic Compute Engine ● A virtual machine that runs on AWS’ physical servers ● You can run any OS you want on it, including Ubuntu, Amazon Linux, MacOS, WIndows, etc. ● You can upgrade an EC2 instance to whatever specs you’d like (including memory, cpu, storage) ● Examples of what you can do: ○ Run demanding tasks (maybe training a ML model, performing large scale data analysis, etc) ○ Host a minecraft server ○ Do (almost) anything you could with a normal computer! AWS EC2
  • 16. RDS = Relational Database Service ● A managed PostgreSQL/MySQL/Oracle/etc database ● Some cool features of this service ○ Offers automatic database backups ○ Auto-scaling (the database can scale up and down in terms of its processing power depending on the current demand) ○ etc. AWS RDS
  • 18. A security group acts as a firewall that controls what gets in and out of your EC2/RDS/etc instances. Example: AWS Security Group
  • 19. AWS VPC VPC - Virtual Private Cloud ● Your own private network within AWS ● A logically isolated section of the AWS Cloud where you can launch AWS resources in a virtual network that you define ● Don’t worry about this for this workshop!
  • 20. AWS Free Tier AWS RDS Pricing
  • 21. Let’s set up a Database on AWS!
  • 22. Flask is Python based lightweight framework used to build web applications. We will be using Flask to make an API today. API (Application Programming Interface) is an application that provides an interface so that the database and the frontend can interact. API uses HTTP request to communicate with frontend. Python Flask
  • 23. 200 OK: The response has succeeded! 201 Created: The request has succeeded, and the resource has been created (usually for POST) 400 Bad Request: The server could not understand the request due to invalid syntax 401 Unauthorized: The client is not allowed to get the requested response 404 Not Found: The server cannot find the requested resource 418 Unprocessable Entity: The server unable to process the contained instructions. 500 Internal Server Error: The server has encountered an issue while processing your request HTTP Request
  • 24. We can make different types of requests: GET, POST, PUT, PATCH, etc Example: POST /articles { author: ‘gdsc’, title: ‘welcome to apis’, body: ‘blah blah blah’ } Making a request
  • 25. Allows you to use ORM (Object Relational mapping), which provides an interface for using OOPs to interact with database. This allows you to not write raw SQL Flask SQLAlchemy db.Model Ability to create and manipulate models/tables db.session Ability to create and manipulate transactions/queries db.session.add(person) It is used as an insert SQL Query db.session.commit() It is used to run the transaction
  • 26. Model is a description of the database table in ‘class’ form. This helps SQLAlchemy map the database table to an object. Serialization is converting the object in a more readable form. For example: <Article 1> is an object of article but you don’t want to send the object itself so you convert this object to something like: { title: ‘welcome to gdsc’, body: ‘blah blah blah’ } Model and Serialization
  • 27. Useful functions MyModel.query Used to return the query table MyModel.query.filter_by(<expression>) eg : name = 'Milind' Used to filter the query object and return only the one/many you asked for MyModel.query.filter(<expression>) eg: Person.name ="Milind", Team.name = "Pod7" More flexible to use like filter_by method MyModel.query.first() Used to get the first result of a query/list of responses MyModel.query.all() Used to get all the results of a query MyModel.query.limit(<number>).all() Used to get a limited number of response Note that “MyModel” is just some arbitrary model that we made up for this slide
  • 28. api.py (used to create the endpoints) Basics model.py (used to describe the database)
  • 31. IF YOU START UP ANY AWS RESOURCES, PLEASE REMEMBER TO DELETE THEM WHEN YOU ARE DONE USING THEM. WE ARE NOT RESPONSIBLE FOR ANY FINANCIAL LOSSES if you forget to do this :)))