AWS Cloud Developer: Fullstack-Building and Deploying Flashcards
How should code be split?
by feature
What is the benefit of splitting code based on features
Reduces technical debt
The goal as the system continues to grow, is to minimize refactoring outside of specific features. As you continue to learn cloud and explore microservices, often entire features might be ported to their own servers infrastructure making this loose coupling even more critical.
How should backend file-structure be structured?
src/ server.js controllers/ v0/ index.router.js feed/ models/ Feed.js routes/ feed.router.js user/ models/ User.js routes/ user.router.js
ORM
Intro to Object-Relational Maps (ORM)
The Object part is the one you use with your programming language ( python in this case )
The Relational part is a Relational Database Manager System ( A database that is ) there are other types of databases but the most popular is relational ( you know tables, columns, pk fk etc eg Oracle MySQL, MS-SQL )
And finally the Mapping part is where you do a bridge between your objects and your tables.
(ORM) is a technique that lets you query and manipulate data from a database using an object-oriented paradigm. When talking about ORM, most people are referring to a library that implements the Object-Relational Mapping technique, hence the phrase “an ORM”.
An ORM library is a completely ordinary library written in your language of choice that encapsulates the code needed to manipulate the data, so you don’t use SQL anymore; you interact directly with an object in the same language you’re using.
Models
A model is the data representation of some group of data. In object-oriented programing terms, a model is an object and is represented by a new class. It should usually represent a noun such as a user, a feed item, an order, etc. We use the @Table decorator and extend the base sequelize Model class to link our model to our database table.
Migrations
Migration refers to modifying the database (by adding or removing tables or columns, for instance, or switching to a different dialect of SQL) to a newer version (usually based on new business requirements).
Up migration is the process of modifying the database to a newer state.
Down migration is the process of reversing an up migration, to a prior state.
Seeding
Seeds are default rows of data that will be inserted upon database formation. This may be helpful when provisioning databases frequently for specific applications and having welcome data populated, or when running tests on staging systems to simulate real-world conditions.
Associations
Associations allow our models to reference other models. For example, consider people and dog relationships. We might represent this as a person table and dog table.
One-To-One Association
If the person has only one dog, we can use a foreign key column in the person table to reference a single row in the dog table. This is known as a One-To-One association.
One-To-Many Association
However, a person may have many dogs. In SQL we might represent this using a new separate table known as a Join table. This is essentially a table of two foreign key columns, one for person table and one for dog table. We can then find all dog foreign keys for a given person foreign key to find the relationship.
Reverse proxy
In computer networks, a reverse proxy is a type of proxy server that retrieves resources on behalf of a client from one or more servers. These resources are then returned to the client, appearing as if they originated from the reverse proxy server itself.
Proxy
a proxy server is a server application or appliance that acts as an intermediary for requests from clients seeking resources from servers
NGINX proxy
NGINX reverse proxy is setup to help rout traffic, balance load, and handle concurrent requests
Basic Elastic Beanstalk architecture
Load Balancer EC2 instance - NGINX reverse proxy -Application DB FS
Config.yml file
This is the set of instructions Elastic Beanstalk will follow when provisioning your AWS infrastructure and deploying your code.