Skip to content

WordPress + ThemisDB integration feasibility study: Hybrid approach recommended over 1:1 SQL replacement - #284

Merged
makr-code merged 4 commits into
developfrom
copilot/check-wordpress-aql-migration
Jan 8, 2026
Merged

makr-code merged 4 commits into
developfrom
copilot/check-wordpress-aql-migration

Conversation

Copilot AI commented Jan 8, 2026 •

Copy link
Copy Markdown
Contributor

Assessed migrating WordPress from MySQL to ThemisDB/AQL to enable LLM-powered frontend. Analyzed three approaches: full SQL replacement, hybrid architecture, and database abstraction layer.

Key Findings

Option A (Full Replace): Requires WordPress core rewrite. 800h initial + 400h/year maintenance. Plugin ecosystem incompatible. Not viable.

Option B (Hybrid): ✅ Recommended. WordPress core stays on MySQL, ThemisDB adds LLM features. 160h initial + 80h/year. Full compatibility. $400/month savings vs external LLM APIs.

Option C (Abstraction Layer): Technically possible but impractical. 1,240-2,280h development, 5-25x performance degradation, 40-60% plugin compatibility.

Deliverables

Documentation (4,300 lines)

  • Feasibility study covering architecture, costs, risks for all 3 options
  • Option C deep-dive identifying 10 critical SQL→AQL translation challenges
  • Code examples showing WordPress queries translated to AQL with performance analysis

Proof-of-Concept Plugin (1,120 lines)

Working WordPress plugin demonstrating hybrid approach:

// Posts auto-sync to ThemisDB with embeddings
add_action('save_post', [$this, 'sync_post_to_themis']);

// Semantic search via vector similarity
public function ajax_semantic_search() {
    $embedding = $this->client->query(
        'LLM EMBED @query USING MODEL "sentence-transformers"',
        ['params' => ['query' => $query]]
    );
    
    $results = $this->client->vectorSearch($embedding['embedding'], 10);
    // Fetch full posts from MySQL by ID
    wp_send_json_success($results);
}

// RAG-powered chat using WordPress content
public function ajax_rag_query() {
    $result = $this->client->query(
        'LLM RAG @query FROM COLLECTION wordpress_posts TOP 5 USING MODEL @model',
        ['params' => ['query' => $query, 'model' => 'llama-2-7b']]
    );
    wp_send_json_success(['answer' => $result['answer']]);
}

Critical Blockers for 1:1 Replacement

Challenge Severity Impact
Multi-table JOINs 9/10 10-20x slower, complex nested FOR loops
AUTO_INCREMENT 7/10 Race conditions without distributed ID generator
Transaction SAVEPOINTs 9/10 Not supported, requires full transaction replay
MySQL functions 6/10 100+ functions need manual mapping
Query optimization 9/10 No cost-based optimizer, sequential scans common

Example: WordPress taxonomy query with 3 JOINs becomes 4 nested subqueries in AQL, 5-10x performance penalty.

Files

  • clients/WORDPRESS_THEMISDB_FEASIBILITY_STUDY.md - Main analysis
  • clients/WORDPRESS_OPTION_C_DEEP_DIVE.md - Abstraction layer technical assessment
  • clients/WORDPRESS_SQL_TO_AQL_EXAMPLES.md - Query translation examples
  • clients/wordpress-integration-example/ - Working plugin with semantic search + RAG
  • clients/WORDPRESS_FINAL_SUMMARY.md - Executive overview
Original prompt

Prüfe ob wir das Wordpress von einer SQL auf AQL (ThemisDB) umstellen können um die Wordpress als Frontend mit LLM unterstützung verwenden zu können (.\clients)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Check migration of Wordpress from SQL to AQL WordPress + ThemisDB integration feasibility study: Hybrid approach recommended over 1:1 SQL replacement Jan 8, 2026
Copilot AI requested a review from makr-code January 8, 2026 06:51
@makr-code
makr-code marked this pull request as ready for review January 8, 2026 12:54
@makr-code
makr-code merged commit 40950b8 into develop Jan 8, 2026
@makr-code makr-code added this to the v1.0.2 milestone Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants