Architecture Flashcards
Event driven architecture
Systems with decouple services that all react to events
Microservices
MVC
Simple 3 layer architecture
Model - Model is core business logic, data structure etc
View - View is a presentation layer, responsible for controlling output to a “user”
Controller - Adapts user input into the model
DDD
Entire design of a system should be based around the business domain, with clear decoupling between the domains (separated by bounded contexts).
Concepts include Entities (the business objects), value objects (immutable data), aggregate root (single source with which to retrieve data)
REST
Stateless, idempodent, resource based, built for the web
HATEOAS (Hypermedia as the Engine of Application State) - Essentially dynamic linking between resources and allows a consumer to explore the api easily. Also allows for independent evolution of versions independently between client and server by communicating more of the schema through URIs. Clients can take a URI directly from the JSON response as opposed to building their own.
As an aside, I certainly see the benefit but it definitely adds complication and it may not always be necessary.
Clean Architecture
Layers build around the core (entities), entities are acted upon by Use Cases (both comprise the business logic). Controllers/Gateways/Presenters). Then the surrounding architecture around that liek databases, UI, web layer
SQL Vs NoSQL, differences and when to use
SQL -
For relational data, data stored as rows and columns with a strict schema. Databases enforce strict data consistency so are well suited when data integrity is critical.
NoSQL - Data is non-relational, or rather amorphous with no strictly defined schemas (making the dbs more flexible). We are simply storing objects of a number of different types. MongoDB is the most popular. NoSQL databases enforce eventual consistency and are therefore better when data integrity is not critical.
What is SSR and what is it used for
Server can create a fully “interactive”, high feature html page with javascript, ui libraries etc, and ship the whole page to the client. It is beneficial for SEO
Virtual DOM
Used by modern frameworks React and Vue. Responds to the problem that most UI frameworks were updating the DOM too often which caused performance problems.
Instead of rebuilding and rerendering entire parts of the DOM, we update a virtual DOM which in turns is reconciled with the actual DOM, and only minimal changes are made.