|
| 1 | +# Architecture and Module Structure |
| 2 | + |
| 3 | +## Three-Tier Architecture |
| 4 | + |
| 5 | +### 1. Client Layer |
| 6 | +- Gremlin/Cypher query interfaces |
| 7 | +- REST API endpoints |
| 8 | +- Multiple client language bindings |
| 9 | + |
| 10 | +### 2. Server Layer (hugegraph-server) |
| 11 | +- **REST API Layer** (hugegraph-api): GraphAPI, SchemaAPI, GremlinAPI, CypherAPI, AuthAPI |
| 12 | +- **Graph Engine Layer** (hugegraph-core): Schema management, traversal optimization, task scheduling |
| 13 | +- **Backend Interface**: Abstraction over storage backends |
| 14 | + |
| 15 | +### 3. Storage Layer |
| 16 | +- Pluggable backend implementations |
| 17 | +- Each backend extends `hugegraph-core` abstractions |
| 18 | +- Implements `BackendStore` interface |
| 19 | + |
| 20 | +## Multi-Module Structure |
| 21 | + |
| 22 | +The project consists of 7 main modules: |
| 23 | + |
| 24 | +### 1. hugegraph-server (13 submodules) |
| 25 | +Core graph engine, REST APIs, and backend implementations: |
| 26 | +- `hugegraph-core` - Core graph engine and abstractions |
| 27 | +- `hugegraph-api` - REST API implementations (includes OpenCypher in `opencypher/`) |
| 28 | +- `hugegraph-dist` - Distribution packaging and scripts |
| 29 | +- `hugegraph-test` - Test suites (unit, core, API, TinkerPop) |
| 30 | +- `hugegraph-example` - Example code |
| 31 | +- Backend implementations: |
| 32 | + - `hugegraph-rocksdb` (default) |
| 33 | + - `hugegraph-hstore` (distributed) |
| 34 | + - `hugegraph-hbase` |
| 35 | + - `hugegraph-mysql` |
| 36 | + - `hugegraph-postgresql` |
| 37 | + - `hugegraph-cassandra` |
| 38 | + - `hugegraph-scylladb` |
| 39 | + - `hugegraph-palo` |
| 40 | + |
| 41 | +### 2. hugegraph-pd (8 submodules) |
| 42 | +Placement Driver for distributed deployments (meta server): |
| 43 | +- `hg-pd-core` - Core PD logic |
| 44 | +- `hg-pd-service` - PD service implementation |
| 45 | +- `hg-pd-client` - Client library |
| 46 | +- `hg-pd-common` - Shared utilities |
| 47 | +- `hg-pd-grpc` - gRPC protocol definitions (auto-generated) |
| 48 | +- `hg-pd-cli` - Command line interface |
| 49 | +- `hg-pd-dist` - Distribution packaging |
| 50 | +- `hg-pd-test` - Test suite |
| 51 | + |
| 52 | +### 3. hugegraph-store (9 submodules) |
| 53 | +Distributed storage backend with RocksDB and Raft: |
| 54 | +- `hg-store-core` - Core storage logic |
| 55 | +- `hg-store-node` - Storage node implementation |
| 56 | +- `hg-store-client` - Client library |
| 57 | +- `hg-store-common` - Shared utilities |
| 58 | +- `hg-store-grpc` - gRPC protocol definitions (auto-generated) |
| 59 | +- `hg-store-rocksdb` - RocksDB integration |
| 60 | +- `hg-store-cli` - Command line interface |
| 61 | +- `hg-store-dist` - Distribution packaging |
| 62 | +- `hg-store-test` - Test suite |
| 63 | + |
| 64 | +### 4. hugegraph-commons |
| 65 | +Shared utilities across modules: |
| 66 | +- Locks and concurrency utilities |
| 67 | +- Configuration management |
| 68 | +- RPC framework components |
| 69 | + |
| 70 | +### 5. hugegraph-struct |
| 71 | +Data structure definitions shared between modules. |
| 72 | +**Important**: Must be built before PD and Store modules. |
| 73 | + |
| 74 | +### 6. install-dist |
| 75 | +Distribution packaging and release management: |
| 76 | +- License and NOTICE files |
| 77 | +- Dependency management scripts |
| 78 | +- Release documentation |
| 79 | + |
| 80 | +### 7. hugegraph-cluster-test |
| 81 | +Cluster integration tests for distributed deployments |
| 82 | + |
| 83 | +## Cross-Module Dependencies |
| 84 | + |
| 85 | +``` |
| 86 | +hugegraph-commons → (shared by all modules) |
| 87 | +hugegraph-struct → hugegraph-pd + hugegraph-store |
| 88 | +hugegraph-core → (extended by all backend implementations) |
| 89 | +``` |
| 90 | + |
| 91 | +## Distributed Architecture (Optional) |
| 92 | + |
| 93 | +For production distributed deployments: |
| 94 | +- **hugegraph-pd**: Service discovery, partition management, metadata |
| 95 | +- **hugegraph-store**: Distributed storage with Raft (3+ nodes) |
| 96 | +- **hugegraph-server**: Multiple server instances (3+) |
| 97 | +- Communication: All use gRPC with Protocol Buffers |
| 98 | + |
| 99 | +**Status**: Distributed components (PD + Store) are in BETA |
0 commit comments