Cloud Shapes is an event-driven database designed to dynamically generate, update, and delete projections based on CloudEvents. It supports real-time relationship management, embedded data synchronization, and write-time updates for efficient, event-driven materialization of data.
β
Projection-Based Data Model β Store and query data as projections, materialized from events.
β
Event-Driven Writes β Automatically create, update, or delete projections when CloudEvents occur.
β
Schema-Enforced Storage β Validate projection states using JSON Schema (JsonSchema
).
β
Real-Time Relationship Updates β Maintain data consistency with embedded relationships.
β
Write-Time Data Embedding β Merge related projection data at write time for optimized queries.
β
Indexing & Querying β Define indexes for fast lookups on projection properties.
β
Multi-Tenant & Scalable β Designed for distributed event-driven architectures.
-
Define a
ProjectionType
- Each projection type is defined by a schema (
JsonSchema
). - Triggers determine when new projections should be created from incoming CloudEvents.
- Each projection type is defined by a schema (
-
CloudEvents Ingestion
- Events trigger projections updates, ensuring real-time data synchronization.
-
Write-Time Relationship Management
- Projections can embed related projection data and update it dynamically when relationships change.
-
Indexing & Querying
- Projections can be indexed for efficient lookups and optimized queries.
A projection type defines how CloudEvents affect projections:
name: Order
description: >
The `Order` projection represents an **order entity**, materialized from CloudEvents.
It includes **embedded customer and item data** to ensure real-time consistency and optimized query performance.
schema:
type: object
indexes:
- name: store
fields: [ store ]
unique: false
descending: false
text: false
triggers:
create:
- event:
type: io.petstore.events.order.created.v1
correlation:
attribute: subject
state: '${ .data }'
update:
- event:
type: io.petstore.events.order.updated.v1
correlation:
attribute: subject
state: '${ .data }'
delete:
- event:
type: io.petstore.events.order.deleted.v1
correlation:
attribute: subject
relationships:
- type: one-to-one
target: Customer
key: customerId
path: customer
- type: one-to-many
target: OrderItem
key: orderId
path: items
When an order is processed, the system materializes the following JSON projection:
```json
{
"id": "order-123",
"customer": {
"id": "customer-456",
"name": "Alice Smith"
},
"items": [
{ "id": "item-1", "product": "Laptop", "price": 1000 },
{ "id": "item-2", "product": "Mouse", "price": 50 }
],
"status": "Processing"
}
```
πΉ Embedded relationships (customer
, items
) ensure real-time updates when related projections change.
Cloud Shapes dynamically updates projections when CloudEvents are received:
order.created
β Creates a new projectionorder.updated
β Modifies the projectionorder.deleted
β Removes the projection
πΉ Embedded relationships are updated dynamically at write time, ensuring consistency.
β
Fully Event-Driven β No manual updates, all changes are event-driven.
β
Real-Time Consistency β Embedded data updates instantly on related projection changes.
β
Write-Time Optimizations β Data embedding reduces query-time overhead.
β
Schema-Enforced Validation β Ensures data integrity using JSON Schema (JsonSchema
).
β
Scalable & Distributed β Built for high-throughput event-driven systems.
1οΈβ£ Clone the Cloud Shapes repository:
git clone https://github.com/neuroglia-io/cloud-shapes.git
2οΈβ£ Start Cloud Shapes using Docker:
docker-compose -f deployments/docker-compose/docker-compose.yml up -d
3οΈβ£ Define Projection Types and their Triggers
4οΈβ£ Start ingesting CloudEvents into the system.
5οΈβ£ Query real-time projections with pre-embedded data.
- π Documentation (Coming Soon)
- π API Reference (Coming Soon)
Cloud Shapes is open-source and available under the Apache-2.0 License.