Skip to content

[Feature]: ACID analysis of the source database with Neo4j output #27

Description

@peter7775

Context

The application analyzes, visualizes, and monitors source SQL databases (schema analysis in internal/application/services/schema_analyzer_service.go, performance monitoring via PerformanceAnalyzerPort / PerformanceSchemaAdapter / PerformanceAnalyzer in internal/application/services/performance/). Analysis results are mapped into a graph representation (GraphPerformanceMapper) and projected into Neo4j as nodes/edges with properties such as Issues, Severity, Recommendations, etc.

There is no equivalent analysis module for ACID consistency of the source database - not application tests, but a new capability of the application itself: actively evaluate how ACID-compliant the connected database (and its current configuration) is, and surface any findings through the same kind of output that already exists for performance issues.

Proposed solution

Add an ACIDAnalyzerPort (analogous to PerformanceAnalyzerPort in internal/application/ports/performance_analyzer_port.go) and a corresponding implementation (e.g. internal/application/services/acid/) that evaluates the source database for:

  • Atomicity: storage engine configuration (e.g. MyISAM vs InnoDB in MySQL), transaction support per table/schema.
  • Consistency: enabled/disabled FK constraints, sql_mode (STRICT_TRANS_TABLES, etc.), integrity constraints.
  • Isolation: currently configured transaction isolation level, comparison against the recommended level, detection of risks (dirty/non-repeatable/phantom reads) stemming from the configuration.
  • Durability: innodb_flush_log_at_trx_commit setting, sync/fsync behavior, replication/binlog configuration.

The output should be an ACIDAnalysisResult containing a list of ACIDIssue items (type, severity, description, recommendation - same shape as the existing PerformanceIssue), which is projected into Neo4j the same way performance data is (new properties/labels on table nodes, or a separate ACIDComplianceReport node linked to the affected tables/database).

Use case

  • When connecting a new database to monitoring, I want to see whether and where ACID inconsistencies are at risk (e.g. a MyISAM table without transaction support, disabled FKs, an unsafe isolation level).
  • I want these findings visualized directly in the graph in Neo4j alongside performance metrics, not as a separate test report.

Open questions / scope

  • Which database engines to cover in the first iteration (MySQL has priority, but the project also supports PostgreSQL/Oracle - docker-compose.postgresql.yml, docker-compose.oracle.yml).
  • Whether this is purely static configuration/schema analysis, or should also include runtime detection (e.g. observing actual isolation-level conflicts via Performance Schema, similar to performance_schema_adapter.go).

Definition of Done

  • ACIDAnalyzerPort + implementation for at least MySQL
  • ACIDIssue/ACIDAnalysisResult data structures
  • Mapping of results into Neo4j (nodes/properties, consistent with the existing performance mapping logic)
  • README documentation on how to run the ACID analysis and how to read the output

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    databaseDatabase related changes - MySQL, Neo4j, queriesfeatureNew feature or functionalityneeds-triageNeeds initial assessment and labeling

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions