Test2 Flashcards
Internet Protocol Stack (TCP/IP)
konzeptuelles Model und set von Kommunkiations Protokollen, welche im Internet benutzt werden
- Application Layer, HTTP (Prozess zu Prozess)
- Transport Layer, TCP (Host zu Host)
- Internet Layer, IP
- Link Layer, LAN
Sichere und idempotente Operation
Sichere: ändert state gar nicht (GET)
Idempotente: ändert state absolut -> mehrmaliges ausführen der gleichen Operation hat gleiches Ergebnis wie einmaliges ausführen (PUT, DELETE)
HTTPS
HTTP + TLS zusätziche Protokoll Ebene -> Transport Layer Security - designed um Kommunikations-Sicherheit zu bieten - Verschlüsselung ist transparent
Protocol or network stacks
architectural patterns for network designs
- enable data transmission through communication networks
- Consist of individual protocols
- Protocols can be considered layers of the stack
- Each protocol interacts only with the immediate above or below protocols
- Lowest protocol interacts with communication hardware
- Topmost protocol interacts with user
Open Systems Interconnection (OSI) Model
Konzept Model, welches Kommunikations Funktionen standartisiert, ohne zugrunde liegende Struktur und Technologie zu beachten Application L Presentation L Session L Transport L Network L Data Link L Physical L
Internet Protocol (IP)
Kern Protokoll des Internets
- Verbindungslos
- für packet-switch Netzwerke
- best effort delivery
- Hosts werden über eindeutige (IP-) Adressen identifiziert
- unterteilt in unterschiedliche Netze
IPv4 : 32-Bit e.g. 130.149.7.201
IPv6: 128-Bit e.g. 2607:f8b0:4004:0815:0000:0000:0000:2003
Transmission Control Protocol (TCP)
Stellt host-to-host Verbindung
reliable, ordered, and error-checked delivery of a stream of bytes zwischen apps die auf hosts laufen, welche über ein IP Netz kommunizieren
benutzt Ports zum identifizieren
Hypertext Transfer Protocol (HTTP)
request-response aplication layer protocol for client-server communication
- HTTP client establishes TCP connection to particular port on host
- HTTP server listening on that port waits for client to send a request
- upon receiving request, server sends back status line e.g. HTTP/1.1 200 OK
HTTP status codes
1xx: Informtional
2xx: Success
3xx: Redirection
4xx: Client Error
5xx: Server Error
Ressource Identification
URI-Uniform Resource Identifiers: reference identifying an abstract or physical resource
can be URL, URN oder both
-> ://?
URL-Uniform Resource Locators: subset of URIs that identifies resources by their primary access mechanism (e.g. network location), is physical address of a ressource
-> transport://user:password@host:port/path[?search][#fragmentid]
URN: identify a resource independent of its primary storage location, logical address of a resource
CRUD Resource Lifecycle
resource Created with POST
Read with GET
Updatet with PUT and
Deleted with DELETE
Domain Name System (DNS=
hirachisches, dezentrales Namensgebungs System für Resourcen im Internet
übersetzt lesbare Domains (e.g. tu-berlin.de) zu IP Adressen
HTML
vorhersschende markup language für web pages
beschreibt die Struktur der Text-basierten Informationen eines Dokuments
In tags geschreiben
CSS
stylesheet language
-> definiert Farbe, Fonts, Layout, etc.
designed um Dokument Präsentation und Inhalt zu trennen
Document Object Model (DOM)
Iinterface für HTML
HTML Dokument wird wie ein Baum behandelt, jeder Knoten ein Objekt der Teil des Dokuments repräsentiert
definiert:
- HTML elements als obkects
- properties der Elemente
- methods um auf Elemente zuzugreifen
- events für alle Elemente
auf HTML DOM kann mit JavaScript zugegriffen werden
Browser Page Rendering
Browser zeigt nicht HTml tags und scripts, sondern interpretiert und zeigt deren Inhalt
CSS Dokumente werden mit HTML vom Browser verlinkt
Offline Web applications
Work offline with a locally deployed application on a local database, and synchronize when going online again
JavaScript Pro-Con
Pro:
- Dynamic: JavaScript kann user Aktionen erkennen (keystroke)
- Usability: da JS im Browser läuft, kann es schnell auf User Aktionen reagieren
- Distribution: von allen modernen Browsern unterstützt, viele development tool/frameworks existieren
Con:
- Debugging: schwieriger da dynamic typing und Logik sowohl auf Server und Cient Seite
- Security: Klartext in Browser zugänglich für Hacker
- Performance: Fat Clients mit viel Code müssen geladen werden, Problem bei mobile devices
- Cross-browser incompatibilities: mehrmaliges Testen und unterschiedliche Versionen von Code für verschiedene browser
JQuery
Einfachere DOM travesierung
unterstüzt event-handling und Ajax
- Tag Selector: $(‘some-tag-name’)
- Class Selector: $(‘.some-class’)
- ID Selector: $(’#some-id’)
AJAX
Asynchronous JavaScript and XML
Gruppe von Web-Dev Technken um interaktive Web-Anwendungen zu kreieren
ermöglicht Datenaustausch Website-Server ohne neuladen der Websiite
- XML, (X)HTML and CSSto render information
- DOM(Document Object Model) to interact with the information
- JavaScriptto glue everything together
- XMLHttpRequest (XHR) object to retrieve data asynchronously from the Web server
Asynchronous Processing in AJAX
- Kick off an HTTP request performed in background via XMLHttpRequestobject
- XMLHttpRequestasynchronously contacts server and retrieves data 3.Server retrieves data and sends it backCan take any amount of time
- Event listener used to detect when the XMLHttpRequestfinished retrieving dataListens for changes in “readyState” variable
- Callback into JavaScript code
AJAX Pro-Con
Pro:
- Seamless HTML integration: muss nicht in HTML integriert werden
- Standards-based cross-browser support: funktioniert in fast jedem Browser, kein plug-in benötigt
- Backend agnostic: funktioniert mit jedem HTTP-kompatiblem Backend
Con:
- Performance: Server Aufrufe können steigen, viele feine asynchrone Aufrufe
- Security: Cross-origin resource sharing (CORS) prohibited
REpresentational State Transfer (REST)
- “abstract architecture” of the Web
- constraint-based design
- Resource Identification
- Name everythingthat you want to talk about
- identified by URI’s - Uniform Interface
- same small set of operations (verbs, e.g. HTTP) applies to a large set of resources (nouns)
- Verbs are universal
- > No need to learn about functions - Self-Describing Messages
- Resources are abstract entities, resources are never exchanged or otherwise processed directly
- All interactions use resource representations
- Data format of a representation is known as a media type - Hypermedia as the Engine of Application State
- Resource representations contain links to identified resources
- applications navigateinstead of calling
- Application statealso is represented as a resource - Stateless Interaction
- move state to clients or resources
- Every request happens in complete isolation, all information required for the server to fulfil the request are included in the request
-> scalability, mashup-ability, usability, accessibility
Cookies
frequently used mechanism for managing state by the client
The ideal RESTful cookie is never sent to the server
REST Weakness
- REST-style synchronous semantics on top of back end systems creates design mismatches
- Challenging to identify and locate resources appropriately in all applications
- lack of standards
JSON
- text-based, human-readable data interchange
- Language-independent text format
Structure:
- A collection of name/value pairs
- An ordered list of values
Well-formed and valid XML documents
Well-formed:
•The document has exactly one root element
•Every element is opened and closed
•Every element has to be closed before its surrounding element is closed
•There cannot be more than one attribute with the same name with in one element
Valid: A valid document additionally conforms to some semantic rules.
XSD
Schema language to validate XML documents
Simple types are XML nodes which are either empty or contain only content, nested elements and attributes are not allowed
•length, minLength, maxLength
•pattern, enumeration
•minInclusive, maxInclusive, minExlusive, maxExclusive(for numbers)
Complex types may have nested subelements and attributes
- minOccursand maxOccurs
- use: required, optional and forbidden
- sequence
- choice
- all
SOAP
Netzwerkprotokoll, mit dessen Hilfe Daten zwischen Systemen ausgetauscht und Remote Procedure Calls durchgeführt werden können.
Eigenschaften:
•Protokoll zum Austausch XML-basierter Nachrichten über ein Computernetzwerk. SOAP stellt Regeln für das Nachrichtendesign auf,
• regelt, wie Daten in der Nachricht abzubilden und zu interpretieren sind, und
• gibt eine Konvention für RPC vor.
• SOAP macht keine Vorschriften zur Semantik applikationsspezifischer Daten, die versendet werden sollen, sondern stellt ein Rahmenwerk zur Verfügung, welches erlaubt, dass beliebige applikationsspezifische Informationen übertragen werden können.
• SOAP wird für entfernte Prozeduraufrufe ebenso genutzt wie für einfache Nach-richtensysteme, beziehungsweise zum Datenaustausch
SOAP messages
seen as envelopeswhere the application encloses the data to be sent
- Header (divided into blocks)
- Body (also divided into blocks)
WSDL
XML-based
- What a service does (the operations)
- Where a service resides (an address)
- How to invoke a service (dataformats, protocols)
WS-* vs. REST
Architectural style for distributed hypermedia systems
-> REST simplicity = freedom from choice
Middleware interoperability standards
->WS-* complexity = freedom of choice
Modern, RPC-style, contract-first services
- Write the server interface using a programming-language independent IDL
- Compile IDL into programming language-specific client stubs and server-side skeletons
- Implement server and client (programming language-specific)
- Stubs and skeletons serve as proxiesfor clients and servers, respectively. Stubs and skeletons mesh perfectly, even if they are compiled into different programming languages.
- Requests pass from client to server through thebroker using stubs and skeletons
IDL
interface definition language
is a specification language used to describe a component’s interface in a programming language-neutralway
Interpreted vs. Compiled Languages
Interpreted language
•Code is directly interpretedby a “runtime engine”
•Often dynamically typed languages
Compiled language
•A compiler transforms language codeinto machine-readable code
•The compiled artifacts are called binaries or executables
•Binaries are platform-specific
Deployment Process
- Find VM where application should run (or is running in a previous version)
- Make sure Java (in the right version!) is installed on VM
- Upload *.jar-archive to VM
- Copy/Update configuration to run
- Stop old version (use right command)
- Start new version (use right command
Virtualization + Hypervisors
creating a virtual (in contrast to actual) version of a resource
•To applications („guests“) inside a virtual environment, the fact that it is virtual may be unknown
Hypervisors (also called Virtual Machine Monitors, VMMs) are special software, which enable managing virtualized resources and provide isolation
Container
packageconsisting of the application and its dependencies
Immutable Infrastructure
no incremental changes to a running application’s context
Update:
“Snapshotted environment”: couple infrastructure configuration to specific software version; environments are killed and replaced
Environment Handling:
Phoenix (dies and returns as it was originally)
Environment Configuration:
Either version 1 or version 2 no in-betweens
Application State:
Requires decoupling of state or special handling of stateful applications
Build-Test-Deployment
build dependencies are resolved
-> software artifact
identify errors regarding functionality and interoperability
-> test report
create runnable instance of software artifact in specific environment
-> running production instance or production-ready “bundle”
Java Persistence API
contains more features
@Entity @Id @OneToMany(mappedBY = "...") @Table @Column @JoinColumn
NoSQL
BASE systems:
• Basically Available
• Soft State
• Eventually Consistent
Key-Value Stores
Document Stores
Column Stores
Graph Stores
Runtime Environment
can refer to an individual layer or their combination
• Each layer requires configuration
• Virtualization allows abstraction from physical hardware
• Assuming environments to be immutable makes deployment safer and repeatable
• In practice, this is done by creating images of VMs or containers that contain the software artifac