Skip to content

Commit 2c53e79

Browse files
authored
Merge pull request #17 from spinframework/chore/hub-content
chore(hub): bring over hub content
2 parents ab7feb6 + 2825374 commit 2c53e79

File tree

74 files changed

+2679
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2679
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
title = "CQRS With Go"
2+
template = "render_hub_content_body"
3+
date = "2024-04-03T13:50:00Z"
4+
content-type = "text/plain"
5+
tags = ["http", "go", "architecture"]
6+
7+
[extra]
8+
author = "Thorsten Hans"
9+
type = "hub_document"
10+
category = "Architecture"
11+
language = "Go"
12+
created_at = "2024-04-03T13:50:00Z"
13+
last_updated = "2024-04-03T13:50:00Z"
14+
spin_version = ">=v2.4.0"
15+
summary = "A Command and Query Responsibility Segregation (CQRS) implementation in Go"
16+
url = "https://github.com/fermyon/enterprise-architectures-and-patterns/tree/main/cqrs-go"
17+
keywords = "Architecture, HTTP, CQRS"
18+
19+
---
20+
21+
This is a simple Command and Query Responsibility Segregation (CQRS) implementation written in Go.
22+
23+
### What Is Command and Query Responsibility Segregation (CQRS)
24+
25+
CQRS is a software architectural pattern that separates the responsibility of handling commands (requests that change the system's state) from handling queries (requests that fetch data without modifying state). In a CQRS architecture, commands are handled by a separate component or layer known as the Command side, while queries are handled by another component or layer called the Query side. This segregation allows each side to be optimized independently, as they often have different scalability, performance, and optimization requirements.
26+
27+
On the Command side, operations are focused on enforcing business rules, validation, and updating the state of the system. This side typically utilizes a domain-driven design approach to model the business logic effectively. On the Query side, the emphasis is on efficiently retrieving data to fulfill read requests from clients. This side often employs de-normalized data models and specialized data storage mechanisms optimized for fast read access. By separating the concerns of commands and queries, CQRS promotes a clearer separation of concerns and can lead to improved scalability, performance, and maintainability in complex software systems.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
title = "CQRS With Rust"
2+
template = "render_hub_content_body"
3+
date = "2024-04-03T13:50:00Z"
4+
content-type = "text/plain"
5+
tags = ["http", "rust", "architecture"]
6+
7+
[extra]
8+
author = "Thorsten Hans"
9+
type = "hub_document"
10+
category = "Architecture"
11+
language = "Rust"
12+
created_at = "2024-04-03T13:50:00Z"
13+
last_updated = "2024-04-03T13:50:00Z"
14+
spin_version = ">=v2.4.0"
15+
summary = "A Command and Query Responsibility Segregation (CQRS) implementation in Rust"
16+
url = "https://github.com/fermyon/enterprise-architectures-and-patterns/tree/main/cqrs-rust"
17+
keywords = "Architecture, HTTP, CQRS"
18+
19+
---
20+
21+
This is a simple Command and Query Responsibility Segregation (CQRS) implementation written in Rust.
22+
23+
### What Is Command and Query Responsibility Segregation (CQRS)
24+
25+
CQRS is a software architectural pattern that separates the responsibility of handling commands (requests that change the system's state) from handling queries (requests that fetch data without modifying state). In a CQRS architecture, commands are handled by a separate component or layer known as the Command side, while queries are handled by another component or layer called the Query side. This segregation allows each side to be optimized independently, as they often have different scalability, performance, and optimization requirements.
26+
27+
On the Command side, operations are focused on enforcing business rules, validation, and updating the state of the system. This side typically utilizes a domain-driven design approach to model the business logic effectively. On the Query side, the emphasis is on efficiently retrieving data to fulfill read requests from clients. This side often employs de-normalized data models and specialized data storage mechanisms optimized for fast read access. By separating the concerns of commands and queries, CQRS promotes a clearer separation of concerns and can lead to improved scalability, performance, and maintainability in complex software systems.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
title = "CRUD APIs With Go and SQLite"
2+
template = "render_hub_content_body"
3+
date = "2024-04-03T13:50:00Z"
4+
content-type = "text/plain"
5+
tags = ["http", "Go", "architecture"]
6+
7+
[extra]
8+
author = "Thorsten Hans"
9+
type = "hub_document"
10+
category = "Architecture"
11+
language = "Go"
12+
created_at = "2024-04-03T13:50:00Z"
13+
last_updated = "2024-04-03T13:50:00Z"
14+
spin_version = ">=v2.4.0"
15+
summary = "A full-fledged CRUD API with SQLite backend written in Go"
16+
url = "https://github.com/fermyon/enterprise-architectures-and-patterns/tree/main/http-crud-go-sqlite"
17+
keywords = "Architecture, HTTP, CRUD"
18+
19+
---
20+
21+
This is a sample implementation of CRUD (Create, Read, Update, Delete) in Go. The sample is using SQLite for persistence and provides the following API endpoints via HTTP:
22+
23+
- `GET /items` - To retrieve a list of all items
24+
- `GET /items/:id` - To retrieve a item using its identifier
25+
- `POST /items` - To create a new item
26+
- `PUT /items/:id` - To update an existing item using its identifier
27+
- `DELETE /items` - To delete multiple items providing an array of identifiers as payload (`{ "ids": []}`)
28+
- `DELETE /items/:id` - To delete an existing item using its identifier
29+
30+
Send data to `POST /items` and `PUT /items/:id` using the following structure:
31+
32+
```jsonc
33+
{
34+
"name": "item name",
35+
// boolean (either true or false)
36+
"active": true
37+
}
38+
```
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
title = "CRUD APIs with JavaScript and PostgreSQL"
2+
template = "render_hub_content_body"
3+
date = "2024-04-03T13:50:00Z"
4+
content-type = "text/plain"
5+
tags = ["http", "JavaScript", "architecture"]
6+
7+
[extra]
8+
author = "Thorsten Hans"
9+
type = "hub_document"
10+
category = "Architecture"
11+
language = "JS/TS"
12+
created_at = "2024-04-03T13:50:00Z"
13+
last_updated = "2024-04-03T13:50:00Z"
14+
spin_version = ">=v2.4.0"
15+
summary = "A full-fledged CRUD API with PostgreSQL backend written in JavaScript"
16+
url = "https://github.com/fermyon/enterprise-architectures-and-patterns/tree/main/http-crud-js-pg"
17+
keywords = "Architecture, HTTP, CRUD"
18+
19+
---
20+
21+
This is a sample implementation of CRUD (Create, Read, Update, Delete) in JavaScript. The sample is using PostgreSQL for persistence and provides the following API endpoints via HTTP:
22+
23+
- `GET /items` - To retrieve a list of all items
24+
- `GET /items/:id` - To retrieve a item using its identifier
25+
- `POST /items` - To create a new item
26+
- `PUT /items/:id` - To update an existing item using its identifier
27+
- `DELETE /items` - To delete multiple items providing an array of identifiers as payload (`{ "ids": []}`)
28+
- `DELETE /items/:id` - To delete an existing item using its identifier
29+
30+
Send data to `POST /items` and `PUT /items/:id` using the following structure:
31+
32+
```jsonc
33+
{
34+
"name": "item name",
35+
// boolean (either true or false)
36+
"active": true
37+
}
38+
```
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
title = "CRUD APIs with JavaScript and SQLite"
2+
template = "render_hub_content_body"
3+
date = "2024-04-03T13:50:00Z"
4+
content-type = "text/plain"
5+
tags = ["http", "JavaScript", "architecture"]
6+
7+
[extra]
8+
author = "Thorsten Hans"
9+
type = "hub_document"
10+
category = "Architecture"
11+
language = "JS/TS"
12+
created_at = "2024-04-03T13:50:00Z"
13+
last_updated = "2024-04-03T13:50:00Z"
14+
spin_version = ">=v2.4.0"
15+
summary = "A full-fledged CRUD API with SQLite backend written in JavaScript"
16+
url = "https://github.com/fermyon/enterprise-architectures-and-patterns/tree/main/http-crud-js-sqlite"
17+
keywords = "Architecture, HTTP, CRUD"
18+
19+
---
20+
21+
This is a sample implementation of CRUD (Create, Read, Update, Delete) in JavaScript. The sample is using SQLite for persistence and provides the following API endpoints via HTTP:
22+
23+
- `GET /items` - To retrieve a list of all items
24+
- `GET /items/:id` - To retrieve a item using its identifier
25+
- `POST /items` - To create a new item
26+
- `PUT /items/:id` - To update an existing item using its identifier
27+
- `DELETE /items` - To delete multiple items providing an array of identifiers as payload (`{ "ids": []}`)
28+
- `DELETE /items/:id` - To delete an existing item using its identifier
29+
30+
Send data to `POST /items` and `PUT /items/:id` using the following structure:
31+
32+
```jsonc
33+
{
34+
"name": "item name",
35+
// boolean (either true or false)
36+
"active": true
37+
}
38+
```
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
title = "Polyglot Publish-Subscribe"
2+
template = "render_hub_content_body"
3+
date = "2024-04-03T13:50:00Z"
4+
content-type = "text/plain"
5+
tags = ["publish-subscribe", "architecture", "polyglot"]
6+
7+
[extra]
8+
author = "Thorsten Hans"
9+
type = "hub_document"
10+
category = "Architecture"
11+
language = "Polyglot"
12+
created_at = "2024-04-03T13:50:00Z"
13+
last_updated = "2024-04-03T13:50:00Z"
14+
spin_version = ">=v2.4.0"
15+
summary = "Publish-Subscribe implementation using multiple programming languages (Rust, Go, JavaScript)"
16+
url = "https://github.com/fermyon/enterprise-architectures-and-patterns/tree/main/pub-sub-polyglot"
17+
keywords = "Architecture"
18+
19+
---
20+
This sample contains a Publish-Subscribe (sometimes referred to as _pub/sub_) pattern implemented using different programming languages.
21+
22+
### What is Publish-Subscribe
23+
24+
The Publish-Subscribe pattern is a messaging pattern widely used in distributed systems to facilitate communication between multiple components or modules in a decoupled manner. In this pattern, publishers are responsible for producing messages containing data or events of interest, while subscribers express interest in specific types of messages by subscribing to relevant topics or channels. When a publisher generates a message, it is broadcasted to all subscribed subscribers without the publisher needing to have any knowledge of the subscribers' identities or how they process the messages. This decoupling enables loose coupling between components, making systems more flexible, scalable, and easier to maintain.
25+
26+
Subscribers can react to messages they are interested in by executing predefined actions or processing the data contained within the messages. This pattern is commonly implemented using message brokers or event buses, where publishers send messages to a centralized location and subscribers receive messages from this central hub. By leveraging Publish-Subscribe, you can design systems where components are highly modular and can be easily extended or modified without affecting other parts of the system. Additionally, this pattern supports asynchronous communication, enabling efficient handling of large volumes of messages and improving system responsiveness.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
title = "Signed Webhooks"
2+
template = "render_hub_content_body"
3+
date = "2024-04-03T13:50:00Z"
4+
content-type = "text/plain"
5+
tags = ["webhooks", "rust", "python", "architecture"]
6+
7+
[extra]
8+
author = "Thorsten Hans"
9+
type = "hub_document"
10+
category = "Architecture"
11+
language = "Rust"
12+
created_at = "2024-04-03T13:50:00Z"
13+
last_updated = "2024-04-03T13:50:00Z"
14+
spin_version = ">=v2.4.0"
15+
summary = "An implementation of signed webhooks using the WebAssembly Component Model."
16+
url = "https://github.com/fermyon/enterprise-architectures-and-patterns/tree/main/signed-webhooks"
17+
keywords = "Architecture, HTTP, webhooks"
18+
19+
---
20+
21+
This sample demonstrates how to implement signed webhooks by extracting signing and verification logic into a dedicated WebAssembly Component and re-using it from within WebAssembly Components written in different programming languages.
22+
23+
### What Are Signed Webhooks?
24+
25+
Webhooks are automated messages sent from one application to another when a specific event occurs. They enable real-time communication and trigger actions in response to events, eliminating the need for continuous polling.
26+
27+
Signing the payload of webhooks is crucial for ensuring the integrity and authenticity of the data being transmitted between applications. By signing the payload, you can verify that the data received from a webhook hasn't been tampered with during transit and originates from a trusted source. This security measure helps prevent various forms of attacks, such as data tampering or injection, which could potentially compromise the integrity and reliability of the system.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
title = "Transparent Cache with Rust"
2+
template = "render_hub_content_body"
3+
date = "2024-04-03T13:50:00Z"
4+
content-type = "text/plain"
5+
tags = ["http", "key-value", "rust", "architecture"]
6+
7+
[extra]
8+
author = "Thorsten Hans"
9+
type = "hub_document"
10+
category = "Architecture"
11+
language = "Rust"
12+
created_at = "2024-04-03T13:50:00Z"
13+
last_updated = "2024-04-03T13:50:00Z"
14+
spin_version = ">=v2.4.0"
15+
summary = "A transparent cache implementation using key-value store"
16+
url = "https://github.com/fermyon/enterprise-architectures-and-patterns/tree/main/caching-rust"
17+
keywords = "Architecture, HTTP"
18+
19+
---
20+
21+
This example illustrates how to implement caching when building HTTP APIs.
22+
23+
### What Is a Transparent Cache
24+
25+
A transparent cache is a caching mechanism that operates without the explicit involvement or awareness of the end user or client application. In other words, users interacting with a system are unaware that caching is taking place behind the scenes. From the perspective of the user or client application, the caching process is invisible and does not impact the functionality or behavior of the system. Transparent caching is commonly employed in systems where performance optimization is crucial, such as web applications or content delivery networks (CDNs), to reduce latency and server load without affecting user experience.

0 commit comments

Comments
 (0)