-
Notifications
You must be signed in to change notification settings - Fork 1
DISTRIBUTION_BEST_PRACTICES
Stand: 22. Dezember 2025
Version: v1.3.0
Kategorie: 🏢 Enterprise
Purpose: Document best practices for distributing enterprise source code
This document outlines best practices for distributing enterprise source code separately from the community edition, following industry standards established by GitLab, MongoDB, Elastic, and other successful commercial open-source projects.
- Current Implementation
- Industry Best Practices
- Recommended Approach
- Distribution Options
- License Management
- FAQ
Public Repository (GitHub):
- ✅ Enterprise source code removed from git tracking
- ✅
.gitignoreprevents re-adding enterprise files - ✅ Build system handles missing enterprise gracefully
- ✅ Community Edition fully functional
- ✅ Clear documentation (ENTERPRISE.md)
What Happens Now:
| User Type | Current Clones | New Clones |
|---|---|---|
| Existing Users | Keep enterprise files locally | Get only Community Edition |
| New Users | N/A | Get only Community Edition |
| Enterprise Customers | Keep enterprise files locally | Need separate enterprise package |
Used by: GitLab, Sentry, PostHog
Structure:
Public Repository (Community Edition):
- Full-featured community version
- Plugin interfaces/hooks for enterprise
- Documentation of enterprise features (not implementation)
Private Repository or Package (Enterprise Edition):
- Enterprise implementations
- Only accessible to licensed customers
- Integrates via documented interfaces
Advantages:
- ✅ Clear separation of concerns
- ✅ Community can build and test independently
- ✅ Enterprise fully protected
- ✅ No destructive updates
- ✅ Professional image
ThemisDB Status: ✅ Already following this model!
Used by: MongoDB, Confluent Kafka
Structure:
Public Repository:
- Core database engine (community)
- Modular architecture with plugin system
Separate Distribution:
- Enterprise modules as compiled binaries
- OR: Source code in private repository
- Installed as additional packages
Advantages:
- ✅ Modular design encourages clean architecture
- ✅ Can distribute as binaries (no source needed)
- ✅ Easy upgrades
ThemisDB Status: ✅ Already supports this via DLL architecture!
Used by: Elasticsearch, MongoDB (newer versions)
Structure:
- Single repository with all code
- Different licenses for different parts
- Server Side Public License (SSPL) restricts commercial cloud use
Not Recommended for ThemisDB:
- ❌ Controversial licensing
- ❌ Complex legal implications
- ❌ Community friction
For ThemisDB, we recommend continuing with the current approach plus:
Setup:
# 1. Create private repository (GitHub/GitLab/Bitbucket)
ThemisDB-Enterprise (Private)
├── src/enterprise/
├── include/enterprise/
├── plugins/enterprise/
├── LICENSE-ENTERPRISE.txt
├── README-ENTERPRISE.md
└── INTEGRATION.md
# 2. Grant access to licensed customers
# Via GitHub/GitLab team membership
# 3. Customers integrate via git submodule or manual copyCustomer Workflow:
# Clone public repository
git clone https://github.com/makr-code/ThemisDB.git
cd ThemisDB
# Add enterprise source (Option 1: Submodule)
git submodule add https://github.com/makr-code/ThemisDB-Enterprise.git enterprise-src
cp -r enterprise-src/src/enterprise src/
cp -r enterprise-src/include/enterprise include/
cp -r enterprise-src/plugins/enterprise plugins/
# OR (Option 2: Direct clone)
git clone https://github.com/makr-code/ThemisDB-Enterprise.git ../ThemisDB-Enterprise
cp -r ../ThemisDB-Enterprise/src/enterprise src/
cp -r ../ThemisDB-Enterprise/include/enterprise include/
# Build with enterprise
cmake -B build -S . -DTHEMIS_BUILD_ENTERPRISE=ON
cmake --build buildAdvantages:
- ✅ Version control for enterprise code
- ✅ Easy updates (git pull)
- ✅ Access control via Git platform
- ✅ Audit trail of who has access
Setup:
# Package enterprise source
./scripts/package-enterprise.sh v1.3.0
# Creates:
themisdb-enterprise-v1.3.0.tar.gz
└── themisdb-enterprise-v1.3.0/
├── src/enterprise/
├── include/enterprise/
├── plugins/enterprise/
├── LICENSE-ENTERPRISE.txt
└── INTEGRATION.mdDistribution:
- Email to customers with license key
- Download portal with authentication
- Customer portal with license management
Customer Workflow:
# Clone public repository
git clone https://github.com/makr-code/ThemisDB.git
cd ThemisDB
# Download and extract enterprise package
curl -H "Authorization: Bearer <LICENSE_KEY>" \
https://enterprise.themisdb.com/download/v1.3.0 \
-o themisdb-enterprise-v1.3.0.tar.gz
tar -xzf themisdb-enterprise-v1.3.0.tar.gz
cp -r themisdb-enterprise-v1.3.0/src/enterprise src/
cp -r themisdb-enterprise-v1.3.0/include/enterprise include/
cp -r themisdb-enterprise-v1.3.0/plugins/enterprise plugins/
# Build with enterprise
cmake -B build -S . -DTHEMIS_BUILD_ENTERPRISE=ON
cmake --build buildAdvantages:
- ✅ Simple to implement
- ✅ No additional Git infrastructure
- ✅ Easy to version
- ✅ Works with any download mechanism
- ✅ Customers don't need git access setup
For customers who don't need source access:
# Distribute pre-compiled enterprise DLLs
themisdb-enterprise-binaries-v1.3.0.zip
└── lib/enterprise/
├── themis_enterprise_sharding.dll
├── themis_enterprise_analytics.dll
├── themis_enterprise_replication.dll
└── ...
# Customer just copies to build directory
cp lib/enterprise/*.dll /opt/themisdb/lib/enterprise/Advantages:
- ✅ Protect source code completely
- ✅ Simplest for customers
- ✅ Smaller download size
- ✅ Faster deployment
Disadvantages:
- ❌ Platform-specific (need Windows, Linux, macOS builds)
- ❌ Customers can't modify/debug
- ❌ Requires CI/CD for multiple platforms
In enterprise source/binaries, add license validation:
// src/enterprise/common/license_validation.cpp
#include "enterprise/license_validation.h"
namespace themis::enterprise {
bool validateLicense(const std::string& license_key) {
// Online validation
auto response = http_client.post(
"https://license.themisdb.com/validate",
{{"key", license_key}, {"product", "ThemisDB-Enterprise"}}
);
if (response.status == 200) {
auto data = json::parse(response.body);
return data["valid"] && data["expires"] > now();
}
return false;
}
} // namespace themis::enterpriseLicense file format:
{
"license_key": "THEMIS-ENT-1234-5678-90AB-CDEF",
"customer": "Acme Corporation",
"tier": "enterprise",
"features": ["sharding", "analytics", "replication"],
"issued": "2024-01-01",
"expires": "2025-12-31",
"signature": "..."
}A: No. ❌ Not recommended.
Reasons:
- Destructive to licensed customers
- Could cause data loss if locally modified
- Bad user experience
- Breaks builds for active customers
Better approach:
- New clones: Get only community edition
- Existing clones: Keep what they have
- Licensed customers: Get enterprise via separate channel
A: This is acceptable and common in commercial open source.
Reasoning:
- Past commits are always in git history anyway
- Source code without license key has limited value
- Focus on preventing future access, not past
- License enforcement is legal, not technical
Similar examples:
- GitLab EE source was public until 2018
- MongoDB enterprise source still semi-accessible via old commits
- Most commercial OSS has "leaky" history
A: Most use one of these approaches:
- GitLab: Private repo + compiled binaries in omnibus package
- MongoDB: SSPL license + enterprise modules
- Elastic: Dual licensing (Elastic License + SSPL)
- Confluent: Apache Kafka (free) + Confluent Platform (paid)
- Redis: BSD for core + Commons Clause for modules
ThemisDB's approach (GitLab-style) is considered best practice.
A: Yes, but adds complexity.
Pros:
- ✅ Clean separation
- ✅ Version tracking
- ✅ Easy updates
Cons:
- ❌ More complex for customers
- ❌ Requires git access setup
- ❌ Submodule gotchas (detached HEAD, etc.)
Recommendation: Use for internal development, but offer zip/tar for customers.
A: No, that defeats the purpose.
If you want transparency:
- Keep high-level docs public (you already do this ✅)
- Offer "source available" for large customers (view but not redistribute)
- Focus on feature documentation, not implementation
- Remove enterprise from public repo
- Update .gitignore
- Update build system
- Documentation (ENTERPRISE.md)
Option A: Simple Zip Distribution (Fastest)
- Create packaging script
- Setup download mechanism (email, portal, etc.)
- Document customer integration process
- Update ENTERPRISE.md with instructions
Option B: Private Repository (More Professional)
- Create private GitHub/GitLab repository
- Setup access management
- Write integration documentation
- Automate customer onboarding
- Implement license key validation
- Create customer portal
- Setup automated delivery
- Add telemetry (optional)
Why:
- ✅ Fastest to implement
- ✅ No additional infrastructure
- ✅ Works for all customers
- ✅ Easy to version and maintain
Implementation Steps:
-
Create packaging script:
scripts/package-enterprise.sh - Test integration: Verify customers can integrate easily
- Update ENTERPRISE.md: Add integration instructions
- Setup distribution: Email, Google Drive, or simple web server
Later upgrades:
- Private Git repository (when team grows)
- Automated portal (when sales increase)
- License server (when scaling)
Current Status: ✅ ThemisDB already follows best practices
Recommendation:
- Continue current approach (enterprise in .gitignore)
- Add simple zip distribution for customers
- Consider private repo later as business scales
Key Principle:
"Make it easy for customers to succeed, hard for non-customers to access."
Questions? Contact: engineering@themisdb.com
See Also:
- ENTERPRISE.md - Customer-facing documentation
- IMPLEMENTATION_SUMMARY.md - Technical implementation
- Architecture-ACCESS-MODEL-IMPLEMENTATION-SUMMARY
- Architecture-ADR-003-pg-dump-sql-parser
- Architecture-BASEENTITY-PRINCIPLE
- Architecture-CACHE-STORAGE-INTEGRATION
- Architecture-CMAKE-ARCHITECTURE
- Architecture-CMAKE-FLAGS-REFERENCE
- Architecture-CMAKE-MODULAR-ARCHITECTURE
- Architecture-CONCERNS-ARCHITECTURE-DIAGRAM
- Architecture-CONCERNS-IMPLEMENTATION-SUMMARY
- Architecture-CONTENT-MODEL
- Architecture-COPILOT-THEMISDB-GRAPH-RAG-BACKEND-ARCHITECTURE
- Architecture-CRYPTO-AND-KEYS
- Architecture-FEATURE-FLAGS-REFERENCE
- Architecture-GPU-ARCHITECTURE-REVIEW-TEMPLATE
- Architecture-HTTP-SHUTDOWN-HARDENING
- Architecture-MIGRATION-GUIDE-CONCERNS
- Architecture-MIGRATION-GUIDE-v13-v14
- Architecture-MODULARIZATION-GUIDE
- Architecture-MODULAR-ARCHITECTURE-ROADMAP
- Architecture-MODULE-ARCHITECTURE-INDEX
- Architecture-P1D01-ISSMPLUGIN-DESIGN-REVIEW
- Architecture-P1-D01-ISSMPLUGIN-DESIGN-REVIEW
- Architecture-P1-D08-MAMBA-GOVERNANCE-CONTRACT
- Architecture-P1-P2-IMPLEMENTATION-COMPLETION-INDEX
- Architecture-PHASE0-COMPLETION-ASSESSMENT
- Architecture-PHASE3-QUERYENGINE-DI-ARCHITECTURE
- Architecture-PHASE4-INDEX-MANAGER-DI
- Architecture-POSTGRESQL-WIRE-PROTOCOL
- Architecture-QUERYENGINE-IMPLEMENTATION-GUIDE
- Architecture-QUERY-SCHEDULING
- Architecture-RAFT-CONSENSUS-DESIGN
- Architecture-README
- Architecture-README-SSM-HYBRID-IMPLEMENTATION
- Architecture-REFACTORING-SUMMARY
- Architecture-RESOURCE-POOLING
- Architecture-SOURCE-DIRECTORY-GUIDE
- Architecture-THEMIS-CORE-GUIDE
- Architecture-UNIFIED-ACCESS-MODEL
- Architecture-WAL-GRPC-MTLS-CONFIGURATION
- Architecture-WIRE-PROTOCOL-RETRY
- Architecture-boltzmann-observability-draft
- Architecture-experimental-logarithmic-vector-storage
- Architecture-llm-wiki-mvp-adr
- Architecture-rewrite-engine-architecture
- Architecture-rope-api-architecture
- Architecture-ssm-gguf-mamba-status
- Architecture-ssm-hybrid-analysis
- Architecture-ssm-hybrid-rollout-plan
- Architecture-ssm-plugin-interface-design-review
- Architecture-transaction-coordinators
- Architecture-wiki-secondary-index
- Architecture-wire-protocol
- Governance-DISABLED-STUB-POLICY
- Governance-DOCS-PR-POLICY
- Governance-GA-PROMOTION-SIGN-OFF
- Governance-GITHUB-MILESTONES-SETUP
- Governance-MATURITY-CLAIM-VERIFICATION-CHECKLIST
- Governance-MATURITY-EVIDENCE-REGISTRY
- Governance-MERGE-GATE-BOT-CONFIG
- Governance-MERGE-GATE-STATUS-LIVE
- Governance-PHASE3-ENFORCEMENT-RUNBOOK
- Governance-PHASE-1-CLOSURE-REPORT
- Governance-PHASE-CLOSURE-POLICY
- Governance-PHASE-DEPENDENCY-GRAPH
- Governance-PLUGIN-SUBMODULE-ROLLBACK
- Governance-PRODUCTION-READY-2026-DELIVERY-PLAN
- Governance-PR-VERSION-TARGETING
- Governance-PR-VERSION-TARGETING-BACKFILL
- Governance-QUERY-MODULE-STATUS
- Governance-README
- Governance-RELEASE-PROMOTION-GATE-POLICY
- Governance-RELEASE-VALIDATION-CHECKLIST
- Governance-SECURITY-MODULE-5671-EVIDENCE-SUMMARY
- Governance-SHARDING-P6-RESIDUAL-RISK-ACCEPTANCE
- Governance-SOURCECODE-COMPLIANCE-GOVERNANCE
- Governance-UPDATES-DEVELOPMENT-STATUS-SIGN-OFF
- Governance-WAVE-C-IMPLEMENTATION-COMPLETE
- Module-acceleration-Roadmap
- Module-access-model-Roadmap
- Module-ai-Roadmap
- Module-analytics-Roadmap
- Module-api-Roadmap
- Module-aql-Roadmap
- Module-auth-Roadmap
- Module-base-Roadmap
- Module-cache-Roadmap
- Module-cdc-Roadmap
- Module-chaos-Roadmap
- Module-chimera-Roadmap
- Module-config-Roadmap
- Module-content-Roadmap
- Module-core-Roadmap
- Module-distributed-knowledge-Roadmap
- Module-distributed-tensor-Roadmap
- Module-document-Roadmap
- Module-ethics-ai-Roadmap
- Module-evaluation-Roadmap
- Module-execution-Roadmap
- Module-exporters-Roadmap
- Module-failover-Roadmap
- Module-geo-Roadmap
- Module-governance-Roadmap
- Module-gpu-Roadmap
- Module-graph-Roadmap
- Module-image-analysis-Roadmap
- Module-importers-Roadmap
- Module-index-Roadmap
- Module-ingestion-Roadmap
- Module-llama-cpp-Roadmap
- Module-llm-Roadmap
- Module-llm-streaming-Roadmap
- Module-llm-wiki-Roadmap
- Module-maintenance-Roadmap
- Module-metadata-Roadmap
- Module-network-Roadmap
- Module-observability-Roadmap
- Module-onnx-clip-Roadmap
- Module-performance-Roadmap
- Module-plugins-Roadmap
- Module-process-Roadmap
- Module-projects-Roadmap
- Module-prompt-engineering-Roadmap
- Module-query-Roadmap
- Module-rag-Roadmap
- Module-replication-Roadmap
- Module-retrieval-Roadmap
- Module-rpc-grpc-Roadmap
- Module-scheduler-Roadmap
- Module-scraper-Roadmap
- Module-search-Roadmap
- Module-security-Roadmap
- Module-server-Roadmap
- Module-sharding-Roadmap
- Module-stable-diffusion-Roadmap
- Module-storage-Roadmap
- Module-temporal-Roadmap
- Module-tensor-Roadmap
- Module-themis-Roadmap
- Module-timeseries-Roadmap
- Module-toolbox-Roadmap
- Module-training-Roadmap
- Module-transaction-Roadmap
- Module-updates-Roadmap
- Module-user-storage-encrypted-Roadmap
- Module-utils-Roadmap
- Module-vector-search-Roadmap
- Module-voice-Roadmap
- Module-whisper-Roadmap