Skip to content

Instantly share code, notes, and snippets.

View JenHsuan's full-sized avatar

Sean Hsieh JenHsuan

View GitHub Profile
Asychronous Sychronous
Wait Doesn't wait workflow to complete wait for workflow to complete
Immediate You don't need an immediate response (messaging service) You need an immediate response (microservice)
Idempotence Must manage idempotence
AWS service Can be invoke from API gateway or Lambda function
standard express
Max duration up to 1 year up to 5 minutes
Execution model Exactly-once execution
Execution rate Over 2000/second Over 100000/second
Execution history up to 90 days or using CloudWatch CloudWatch Logs
Pricing # of state transitions # of executions. durations. and memory consumption
Use case Non-idempotent actions (e.g. processing payments) IoT data ingestion. streaming data. mobile app branch
Operation Action
POST Sends a message from the server to the connected WS client
GET Gets the latest connection status of the connected WS client
POST Disconnect the connected client from the WS connection
Authoriser HTTP API REST API
Lambda o o
IAM o o
Resource-based policies o
Cognito o o
Native OpenID Connect/Oauth 2.0/JWT o
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
...
constructor(...) {
...
convertHierarchyPointNodesToSimpleNodes = (nodes: d3.HierarchyPointNode<TopoNode>[]): TopoNode[] => {
const data: TopoNode[] = [];
nodes.forEach(node => {
const newNode: TopoNode = _.cloneDeep(node.data);
data.push(newNode);
});
return data;
}
this.topologyDataSubject.next({
nodes: this.convertHierarchyPointNodesToSimpleNodes(this.flattenedNodes),
edges: this.edges
});
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
...
private topologyDataSubject = new BehaviorSubject<Topology | null>(null);
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
...
constructor(...) {
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
...
private updateChart(rootNode: d3.HierarchyNode<TopoNode>, source: d3.HierarchyPointNode<TopoNode>, svg: d3.Selection<SVGGElement, unknown, HTMLElement, any>) {
...