How flipkart/foxtrot works
Main Components
• Clients/Users: Represent different types of consumers:
• Web Console (built using Twitter Bootstrap, jQuery, D3, Flot, etc.)
• External REST API consumers and command-line FQL clients.
• Foxtrot Server: The central service (built with Dropwizard) that exposes REST endpoints.
• Business Logic and Core Processing (Foxtrot Core):
• Query execution, caching, scheduling jobs, internal event handling (using Guava Event Bus) and alerting.
• Query and SQL Processing (Foxtrot SQL):
• FQL parsing and transformation into actions/queries.
• Data Translation (Foxtrot Translator):
• Handling document transformation and possibly data segregation.
• Shared Utilities (Foxtrot Common):
• POJOs and utility classes used across all modules.
• External Data Stores:
• HBase: for fast row get/put operations.
• Elasticsearch: for indexing, aggregation, and search.
• Hazelcast: as a distributed caching layer.
• Authentication & Authorization:
• Different auth providers (Google, IDMAN, and others) integrated into the server (using modules under foxtrot-server/auth).
• Deployment & Configuration:
• Docker and Docker Compose setups, various configuration files (YAML) that enable custom deployment pipelines.
• Frontend / Client Layer:
• Service Layer (Foxtrot Server):
• REST API endpoints.
• Authentication & Authorization (e.g., JWT Auth, Auth Providers).
• Endpoints for event ingestion, console management, and FQL queries.
• Server to the “Business Logic / Core” layer below it.
• Business Logic / Core Layer:
• Inside “Foxtrot Core” include key responsibilities:
• Query Store for executing actions.
• Cache management (using Hazelcast).
• Scheduled jobs (e.g., data deletion, session cleanup, and index optimization).
• Internal event bus for propagating alerts/notifications.
• That this layer uses “Foxtrot Common” for shared data models and utilities.
• Query Processing / SQL Engine:
• Mention its role in parsing FQL and acting as the query translation layer.
• Data Translation:
• “Foxtrot Translator” as an adjacent or integrated module that helps with document transformation and identity key distribution.
• Data Storage/External Services:
• “HBase Cluster” for fast raw data storage.
• “Elasticsearch Cluster” for analytics and indexing.
• “Hazelcast Cluster” for distributed caching.
• Infrastructure & Deployment:
• Optionally denote a containerization layer – with Dockerfiles and docker-compose files – that “envelops” these services, indicating that deployment configurations support different pull-in environments for tests, production, and even specialized deployments (e.g., using different docker-compose files for authentication).
Architectural Patterns & Design Principles
• Layered Architecture: Clearly separate the UI/Client interactions (REST API and web console) from the service logic (server, core, SQL processing) and from the external data storage.
• Modular Design: Emphasize the separation between foxtrot-common, foxtrot-core, foxtrot-server, etc.
• Extensibility: Note that new analytics operations are easily added by creating annotated classes – show an “extensibility point” marker if desired.
• Separation of Concerns: Authentication, query processing, data translation, and data storage are each handled in separate modules; connect them through well-defined interfaces.
Final Suggestions
• To capture important design principles such as modularity and extensibility points.