Complex custom backend architecture diagram showing homeservers, custom aggregation logic, inference engines, and specialized API services

This architectural design introduces a more sophisticated data flow model, incorporating an intermediary backend layer between the client application and the home server. This backend functions as a middleware, enhancing the system’s flexibility and data processing capabilities.

The backend can be potentially comprised with many components. These components will depend on the client app needs, but these are the main ones

  1. Indexer: Responsible for data normalization, ensuring consistent data structures and optimizing query performance.
  2. Aggregator: Implements event filtering logic, allowing for selective data propagation based on predefined criteria.

This architecture supports two distinct data consumption patterns:

a) For scenarios requiring both data normalization and event filtering, the client interacts with the backend layer, as an endpoint. The aggregator processes the event stream from the home servers, applying filtering rules before passing the data to the indexer for normalization.

b) In cases where only data normalization is necessary, the backend can bypass or not implement the aggregator, consuming events directly from the home server via the indexer.

This modular approach allows for fine-grained control over data processing, enabling efficient resource utilization and optimized client-side performance based on specific application requirements.

Pubky Nexus: Production Implementation

Pubky Nexus is the production-grade implementation of this custom backend architecture. It combines sophisticated aggregation, normalization, indexation, filtering (compliance), and powerful Social Semantic Graph inference capabilities.

Nexus powers the Pubky App social features with:

  • Real-time event aggregation from multiple homeservers
  • High-performance graph database (Neo4j) for relationship queries
  • Redis caching layer for sub-millisecond response times
  • Comprehensive REST API with full OpenAPI specification
  • Advanced moderation and filtering capabilities

Resources: