K8's/TS/Http/MVC/MSA/AJAX Flashcards
A ________ tool helps in deployment, scaling, networking, and monitoring of your containers.
container orchestration
It provides a framework for managing containers and the microservices they contain at scale.
Container Orchestration
____ is a container orchestration tool.
Kubernetes
It provides tools that help deploy and manage containers that run over a network.
Kubernetes
It lets us build application services that span multiple containers, schedule containers across a cluster, scale those containers, and manage their health over time.
Kubernetes
Similar tools to Kubernetes
Docker Swarm and Apache Mesos
K8s Architecture
Cluster
Node
Pod
Containers
Primary node agent interacts with master node
Kubelet
Software that runs containers
Container runtime
Network proxy maintains network rules on nodes
Kube-proxy
Cmd line tool for k8s
Allows you to interact with the API in the master node to deploy and manage your cluster
Kubectl
Lets you query and manipulate the state of objects in K8s
API
Local k8s
Minikube
Azure K8s Service
AKS
Container runtime
Docker
Deploying with k8s
Object config file
Pods
Deployments
Services
Superset of JS, which means that all valid JS is valid ____
JS flavor that imposes type checking and “compile” time errors
Statically typed
CANNOT IN ITSELF BE RUN IN THE BROWSER HAS TO BE TRANSPILED BEFORE IT’S EXECUTED (using node.js and tsc)
Still JS under the hood
Typescript
All valid JS types are TS types
True
(TS type) literally any type, when you assign something to any, you are resigning to JS’s type inference system (i.e. letting JS take the wheel and infer the type for you)
Any
a type safe any. Ensures someone using the type declares what the type is
Unknown
a function that returns undefined or no return value. Like how you’d use void as a return type in C#
Void
what’s the difference between js classes and ts classes
TS classes have access modifiers
Modules in ts
Works like a JS module but has some additional support
Import multiple modules from a single script file, only import types (type safe way of importing)
This helps in organizing your code in their own files and using them in different places
So you expose something for use using the export keyword and you use that something in another file using the import keyword
Any declaration (variable, function, class, type alias, interface) can be exported by adding the export keyword before the type keyword.
Stands for Asynchronous Javascript and XML, More of technique than a specific technology
AJAX
An older implementation of AJAX
Object that is used to send a request to the server and receive the response
Again the XML in its name is for traditional reasons
XMLHttpRequest
Newer JS native implementation of AJAX
Fetch API
Uses promises to achieve asynchronisity
Fetch API
_____ represent the eventual completion (or failure) of an asynchronous operation and its resulting value
Promises
____ are objects in JS
Promises
what does MSA stand for?
Micro Service Architecture
Monolithic vs SOA vs MSA
monolithic = single unit SOA = coarse-grained microservices = fine-grained
Microservice Characteristics
SRP (single responsibility principle)
Encapsulated
Independent
MSA pros
Scalability Deployment Simplicity Fault tolerant Testability Language agnostic
MSA cons
Complexity
Monitoring
Eventual consistency
Chattiness
what does MVC stand for?
model view controller
Design pattern used to separate concerns (yes we’re discussing this again)
MVC
a web application framework developed by Microsoft that implements the model–view–controller pattern.
ASP.NET MVC
MVC vs ASP.NET MVC
MVC is a design pattern, ASP.NET MVC is a web app framework that implements the mvc design pattern
Send from client to server
HTTP request
what are the 3 parts to and http request
Start line
Method - describes action to be performed
Target - describes where to send the request
Header
Meta data
Ex: content type - what data type the body has
Body
Data you want the server to process
Describes what action the client wants the server to perform on a given resource
HTTP verbs/methods
Get resource
HTTP GET
Create a new resource
HTTP POST
Update resource
HTTP PUT
Delete resource
HTTP DELETE
Returns just the headers of a get response
HTTP HEAD
what are the less common http verbs?
connect, options, trace, patch
A method is said to be safe if it does not change the state of the resource
(Ex: HTTP GET, HTTP HEAD)
Safe methods
A method is said to be ______ if the state of the resource is only affected once by any changes implemented by this method
idempotent
examples of idempotent methods
DELETE, PUT, HEAD, GET
From server to client
HTTP Response
what are the 3 parts to an HTTP Response
Status line
Headers
Body
errors that are the client’s fault, client side errors (“Your fault”)
4xx
errors that are the server’s fault, server side errors (“My bad”)
5xx
redirection (“We moved that”)
3xx
communicating success (“Success”)
2xx
informational (“Mkay”)
1xx
____ give a short description of whether an interaction is successful or not.
Status codes
Bad request, generic error message
400
Payment Required
402
Not found
404
Method not allowed (if server does not support method)
405
Internal Server Error, try again later we’re having problems right now
500
Not Implemented, if a method isn’t implemented (if it’s under construction)
501
Bad Gateway
502
what does dns stand for?
Domain Name System (DNS)
_______ translates domain names to IP addresses so browsers can load Internet resources.
DNS
Used to describe a group of queries that are executed as a batch that should completely succeed or not have any effect on the database at all
Transactions
Sublanguage to control Transactions
TCL
TCL commands
Commit
Savepoint
Rollback
what does ACID stand for?
Atomic
Consistent
Isolation
Durable
All or nothing
Either the transaction completely succeeds without errors and persists to a non volatile data storage system or it fails
Atomic
Guarantees committed transaction state
Makes sure that your transaction is not half finished
Consistency is a property ensuring that only valid data following all rules and constraints is written in the database.
When a transaction results in invalid data, the database reverts to its previous state, which abides by all customary rules and constraints.
Consistent
guarantees the individuality of each transaction, and prevents them from being affected from other transactions. It ensures that transactions are securely and independently processed at the same time without interference, but it does not ensure the order of transactions.
Two transactions, affecting same data, one will have to wait
Isolation
A transaction isn’t considered complete until it is persisted in a non volatile data storage; by that it means your device could turn off and the data would still be saved
Durable
_____ define the degree to which a transaction must be isolated from the data modifications made by any other transaction in the database system
Isolation levels
Ways other transactions can affect your transaction:
Dirty Read
non-repeatable read
phantom read
when your transaction reads uncommitted updates done by another transaction
Dirty Read
when your transaction reads committed updates done by another transaction
Non Repeatable Read
some rows may be added or removed due to the updates done by another transaction
Phantom Read
Does not protect transaction from anything, your transaction can read uncommitted data from other transactions
Useful for when you read and write all the time, like netflix, or if you’re tracking number of covid cases, you can just reload
Read uncommitted (zero isolation)
Protects transaction from dirty read but not from non repeatable read.
Meaning you can still read committed data from other transactions.
Locks updates unless committed
SQLServer Default
Read committed
Protects transaction from non repeatable read but not from phantom read.
When querying batches of data you’d still be able to get a different set of rows when you query the table before and after updates from another table occur
Locks row
Repeatable read
Protects transaction from phantom read. Congratulations. You’ve reached the highest isolation level.
This guarantees total isolation.
It’s essentially locking the data set you’re working with from other transactions.
Serializable