Documentation
¶
Overview ¶
Streaming worker for the page-view-counters example.
Reads page-view events from Kafka, aggregates daily-bucketed counts per page-ID into DynamoDB, and (optionally) write-throughs to a Valkey cache.
In production this binary runs as an ECS Fargate service. Locally:
docker compose up -d kafka dynamodb-local valkey
aws --endpoint-url=http://localhost:8000 dynamodb create-table \
--table-name page_views \
--attribute-definitions AttributeName=pk,AttributeType=S AttributeName=sk,AttributeType=N \
--key-schema AttributeName=pk,KeyType=HASH AttributeName=sk,KeyType=RANGE \
--billing-mode PAY_PER_REQUEST
export DDB_LOCAL_ENDPOINT=http://localhost:8000
export VALKEY_ADDRESS=localhost:6379
export KAFKA_BROKERS=localhost:9092
go run ./examples/page-view-counters/cmd/worker
Click to show internal directories.
Click to hide internal directories.