Life ConnectLife Connect
Wiki index
Architecture
Services
Concepts
Runbooks
Infra
Swagger Docs
GitHub
Wiki index
Architecture
Services
Concepts
Runbooks
Infra
Swagger Docs
GitHub
  • Architecture

    • Architecture overview
    • Service-to-service communication
    • Data layer
    • Authentication
    • ADB monorepo audit — use cases & flow maps
Last updated 2026-05-03

Data layer

AI-generated content

This document was generated by an AI assistant. Verify accuracy before relying on the details.

ADB combines four distinct stores. Each one has a specific role and is consumed by a subset of the services.

flowchart LR
    subgraph Services
        persons[adb-persons]
        parts[adb-parts]
        contracts[adb-contracts]
        accounting[adb-accounting]
        files[adb-files]
        utilities[adb-utilities]
        views[adb-views]
        reports[adb-reports]
        aggregates[adb-aggregates]
    end

    subgraph Mongo[MongoDB Atlas]
        m_persons[(adb-persons)]
        m_parts[(adb-parts)]
        m_contracts[(adb-contracts)]
        m_accounting[(adb-accounting)]
        m_files[(adb-files)]
        m_utilities[(adb-utilities)]
        m_views[(adb-views)]
        m_reports[(adb-reports)]
    end

    s3[(AWS S3)]
    neo4j[(Neo4j)]

    persons --> m_persons
    parts --> m_parts
    contracts --> m_contracts
    accounting --> m_accounting
    files --> m_files
    files --> s3
    utilities --> m_utilities
    views --> m_views
    reports --> m_reports

    aggregates -.reads via HTTP.-> persons
    aggregates -.reads via HTTP.-> parts
    aggregates -.reads via HTTP.-> contracts

    adbgraph[adb-graph<br/>deprecated] --> neo4j

1. MongoDB Atlas

All business data lives in MongoDB Atlas, a managed multi-environment cluster (adb-development, adb-integration, adb-production). Each service has its own database (adb-<service>): no cross-service joins — data is propagated via HTTP or events. Exception: adb-aggregates has no own database — it fetches data directly from other services at query time

Databases and collections

DatabaseServiceMain collections
adb-personsadb-personspersons, organization, invitations, company_settings
adb-partsadb-partsparts, assets, charges, budget_lines, sales
adb-contractsadb-contractscontracts, propose_contracts, direct_debits, template_values
adb-accountingadb-accountinginvoices, payments, accounting_entries, accounting_events, journals, ledger_account, ledger_auxiliary_accounts, fiscal_year, rental_allowance_statements, tenant_rental_allowances, serial, accounting_sequence, transaction_reads, configurations, resume_token, accounting_event_fallback
adb-filesadb-filesfiles (metadata)
adb-utilitiesadb-utilitiesallocationkeys, configurations, dashboards, catalog, indexes, notifications, notification_definitions, serials
adb-viewsadb-viewsparts, contracts_entries, accounting_event (denormalized projections)
adb-reportsadb-reportstemplates, template_meta_data

adb-views hosts denormalized projections kept up to date by SQS listeners — this is intentional, to serve dashboards quickly.

Connection

Each service reads its connection string from the MONGO_DB_URI variable (format mongodb+srv://...). Credentials come from Kubernetes secrets.

Reactive stack

Access goes through Spring Data MongoDB Reactive (ReactiveMongoRepository). Services avoid any blocking call; BlockHound is enabled in cloud environments for adb-views and adb-accounting to detect blocking calls at runtime.

2. AWS S3

Two main buckets:

BucketVariableMain serviceContent
{ENV_NAME}.files.life-connect.frBUCKET_FILESadb-filesUser-uploaded documents
{ENV_NAME}.templates.life-connect.frBUCKET_TEMPLATESadb-views, adb-reports, adb-contracts, adb-accountingFreeMarker templates, PDF templates

adb-files issues pre-signed S3 URLs for direct uploads and downloads from the browser (avoiding a round-trip through the Java service).

3. Neo4j

⚠️ Deprecated — adb-graph is shut down and Neo4j is no longer in use.

The adb-graph service (out-of-monorepo) maintains a graph of the relationships between persons, parts, contracts and tickets. It is fed by RabbitMQ events (persons.graph, parts.graph, contracts.graph, tickets.graph).

Helm/Terraform for Neo4j: see adb-charts/terraform/ and the scripts under adb-charts/scripts/cypher_r4.cypher.

4. Messaging — AWS SQS / SNS

Detailed in Service-to-service communication §4. Single region: eu-west-1. Queues are named by convention <env>-<service>-<event> (e.g. dev-views-contract-modified-queue).

Each service has:

  • One SNS topic per emitted event type.
  • One DLQ (<env>-<service>-dlq) for unprocessed messages.

Migrations / setup scripts

adb-infrastructure/mongodb-atlas/data-scripts/ contains around 37 migration and setup scripts. Tooling: MongoDB Atlas CLI + Realm CLI. No Terraform yet — managed manually or through the CLI.

Common environment variables

VariableRole
MONGO_DB_URIMongoDB Atlas connection string
AWS_REGIONeu-west-1
AWS_ACCESS_KEY / AWS_SECRET_KEYAWS credentials (S3 + SQS/SNS)
BUCKET_FILESS3 bucket for documents
BUCKET_TEMPLATESS3 bucket for templates
<SERVICE>_<EVENT>_QUEUEURL of each consumed SQS queue
<SERVICE>_DLQ_TOPICService DLQ
Edit this page
Last Updated:
Contributors: Yevhenii Khudolii
Prev
Service-to-service communication
Next
Authentication