Installation¶
ProductGraph can be deployed in several configurations depending on your scale requirements.
Development¶
From Source¶
# Clone the repository
git clone https://github.com/plexusone/productgraph.git
cd productgraph
# Install dependencies
go mod download
# Start PostgreSQL
make docker-up
# Build and run
make run-ingestion
Using Docker Compose¶
Production Deployment¶
Prerequisites¶
- PostgreSQL 16+ with the following extensions:
uuid-ossppgcrypto
- Go 1.22+ (for building from source)
Database Setup¶
- Create the database:
- Run the initialization script to set up RLS functions:
-- Enable extensions
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE EXTENSION IF NOT EXISTS "pgcrypto";
-- Create roles
CREATE ROLE service_role NOLOGIN;
CREATE ROLE app_role NOLOGIN;
-- Function to set current org context
CREATE OR REPLACE FUNCTION set_current_org(org_id uuid)
RETURNS void AS $$
BEGIN
PERFORM set_config('app.current_org_id', org_id::text, false);
END;
$$ LANGUAGE plpgsql SECURITY DEFINER;
- Run Ent migrations:
Environment Variables¶
| Variable | Description | Default |
|---|---|---|
PORT |
HTTP server port | 8080 |
DATABASE_URL |
PostgreSQL connection string | postgres://pg:pg@localhost:5432/productgraph?sslmode=disable |
DEBUG |
Enable debug logging | false |
Build the Binary¶
The binary is output to bin/ingestion.
Run the Service¶
With debug logging:
Health Checks¶
The service exposes two health endpoints:
| Endpoint | Purpose |
|---|---|
GET /health |
Basic health check |
GET /ready |
Readiness check (database connectivity) |
Example health check script:
Scaling¶
See the Scaling Guide for production deployment patterns:
- Starter: Single PostgreSQL instance
- Growth: Add Kafka, ClickHouse, Redis
- Scale: Sharded, multi-region deployment
Next Steps¶
- Quick Start - Send your first events
- Architecture Overview - Understand the system
- Scaling Guide - Plan for growth