Skip to content

Epic AUD-QUERY-001: Audit Query Microservice

Status: 🔄 In Progress (70% complete)
Owner: Query Team
Target: Q4 2025


Epic Description

The Audit Query Microservice provides the primary read interface to the Audit Trail Platform (ATP). It exposes optimized APIs and projections for retrieving audit records by tenant, actor, resource, or event type. The service consumes audit data from Storage and Ingestion microservices, maintains efficient read models, and supports full-text and metadata search as well as streaming queries over gRPC.


Epic Objectives

  • Implement REST and gRPC APIs for retrieving and filtering audit records
  • Support advanced query parameters (pagination, sorting, filtering, date range)
  • Maintain read-side projections for query-optimized data access
  • Integrate optional full-text search via Elastic or Azure Cognitive Search
  • Implement result caching and asynchronous refresh mechanisms
  • Expose streaming endpoints for real-time monitoring of audit data

Features

Feature AUD-QUERY-API-001: Read APIs ✅

Status: Complete
Delivered: Q3 2025

Tasks: - ✅ Implement query filtering, pagination, and sorting - ✅ Expose gRPC streaming queries - ✅ Add authentication and tenant isolation

Key Deliverables: - REST endpoints: GET /api/audit-records, GET /api/audit-records/{id} - gRPC service: SubscribeAuditStream(FilterCriteria) - Swagger/OpenAPI documentation - Integration tests (100% coverage)


Feature AUD-QUERY-PROJ-001: Read Model Projections 🔄

Status: In Progress (80%)
Target: November 2025

Tasks: - ✅ Build read projections and refresh jobs - 🔄 Implement projection rebuild workflow (in review) - ⏳ Add projection changefeed notifications

Current Work: - Optimizing projection refresh performance (< 60s SLA) - Testing delta update handling for late-arriving events - Implementing admin rebuild API

Blockers: - None


Feature AUD-QUERY-CACHE-001: Result Caching ✅

Status: Complete
Delivered: Q3 2025

Tasks: - ✅ Implement query result cache (Redis) - ✅ Add cache invalidation hooks - ✅ Monitor and alert on cache performance

Metrics: - Cache hit ratio: 87% (target: >85%) ✅ - Average latency: 45ms (cached), 280ms (uncached) - Invalidation latency: 8 seconds (target: <10s) ✅


Feature AUD-QUERY-SEARCH-001: Full-Text Search Integration ⏳

Status: Planned
Target: Q1 2026

Tasks: - ⏳ Integrate search indexer - ⏳ Expose search API endpoints

Dependencies: - Requires AUD-SEARCH-001 (Search Index Microservice) - Azure Cognitive Search provisioning in staging


Current Sprint Work

Sprint 2025-10-28 to 2025-11-08

Focus: Complete projection rebuild workflow

Tasks: 1. 🔄 Implement /admin/projections/rebuild endpoint 2. 🔄 Add scoped rebuild (tenant-level) 3. ⏳ Non-blocking rebuild process design 4. ⏳ Projection lag metrics dashboard

Team Capacity: - 3 engineers @ 80% allocation - 1 QA engineer for integration testing


Dependencies

Upstream (Depends On)

  • ✅ AUD-STORAGE-001: Storage Service (complete)
  • ✅ AUD-INGEST-001: Ingestion Service (complete)
  • ⏳ AUD-SEARCH-001: Search Index Service (planned)

Downstream (Blocks)

  • AUD-EXPORT-001: Export needs query APIs
  • AUD-ADMIN-001: Admin Console needs query endpoints
  • AUD-SDK-001: SDKs need stable query contracts

Metrics & KPIs

Metric Target Current Status
API Latency (P95) < 300ms 285ms
Cache Hit Rate > 85% 87%
Projection Refresh < 60s 58s
Query Throughput 1K req/sec 850 req/sec ⚠️
Test Coverage > 80% 92%

Action Items: - ⚠️ Throughput below target - investigating database query optimization


Risks & Mitigation

Risk Severity Mitigation Owner
Projection rebuild blocks live queries Medium Implement non-blocking rebuild with blue-green index swap @alice
Full-text search delayed Low Basic search via SQL sufficient for MVP @bob
Cache invalidation race conditions Medium Add distributed lock around invalidation @charlie

Recent Updates

2025-10-30: - ✅ Projection refresh performance optimized (60s → 58s avg) - 🔄 Rebuild API endpoint under code review - 📝 Query performance benchmark completed

2025-10-15: - ✅ Cache invalidation hooks deployed to production - ✅ gRPC streaming queries performance validated - 📊 Dashboard shows 87% cache hit rate

2025-10-01: - ✅ Feature AUD-QUERY-CACHE-001 marked complete - 🎯 Started work on projection rebuild workflow




Next Review: 2025-11-07 (Sprint Planning)
Contact: #atp-query-team on Slack