Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Messenger Tarantool Laravel Package

alexlcdee/messenger-tarantool

Symfony Messenger transport for Tarantool Queue. Install via Composer and use either tarantool/client or the ext-tarantool PECL extension to connect to Tarantool and run messenger messages through a Tarantool-backed queue.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Use Case Alignment: The package (alexlcdee/messenger-tarantool) bridges Laravel’s built-in Messenger queue system with Tarantool, a high-performance in-memory database and Lua application server. This is ideal for:
    • High-throughput messaging (e.g., real-time notifications, event-driven workflows).
    • Low-latency processing where Redis/MQTT may not suffice.
    • Hybrid architectures leveraging Tarantool’s key-value/document storage for queue metadata.
  • Laravel Compatibility: Designed as a Queue driver, it integrates seamlessly with Laravel’s Queue facade, dispatch() syntax, and job payload serialization (via Laravel’s Illuminate\Contracts\Queue\Job).
  • Tarantool-Specific Features:
    • Supports Tarantool’s Lua scripting for custom queue logic (e.g., prioritization, retries).
    • Leverages Tarantool’s pub/sub for event-driven architectures.
    • Atomic operations for queue visibility (e.g., reserve/release patterns).

Integration Feasibility

  • Prerequisites:
    • Tarantool Server: Requires a running Tarantool instance (v1.10+ recommended). Schema setup (e.g., spaces for queues/jobs) must be predefined or scripted.
    • PHP Extension: ext-tarantool must be installed (PECL or compiled from source).
    • Laravel Version: Tested with Laravel 5.x/6.x (may need adjustments for Laravel 8+/9+ due to queue interface changes).
  • Data Flow:
    1. Laravel serializes jobs (via Illuminate\Queue\SerializesJobs).
    2. Package pushes jobs to Tarantool’s queue space (customizable schema).
    3. Workers (Laravel’s queue:work or custom) pull jobs via Tarantool’s Lua API.
  • Serialization: Defaults to Laravel’s JSON serialization. Custom payloads (e.g., complex objects) may require shouldBeQueued() overrides.

Technical Risk

Risk Area Severity Mitigation
Tarantool Schema Dependency High Document schema requirements; provide migration scripts for Tarantool.
Lua/PHP Interop Medium Test edge cases (e.g., nested objects, large payloads). Use try-catch in Lua.
Worker Stuck Jobs High Implement Tarantool’s release() logic; add TTL to jobs.
No Active Maintenance Critical Fork/review codebase; add tests for Laravel 9+ compatibility.
Performance Bottlenecks Medium Benchmark against Redis; optimize Tarantool’s space configuration.

Key Questions

  1. Tarantool Infrastructure:
    • Is Tarantool already deployed? If not, what’s the provisioning timeline?
    • Are there existing Lua scripts for queue management (e.g., retries, dead-letter queues)?
  2. Laravel Version:
    • What Laravel version is used? Are there breaking changes in Illuminate\Queue\Queue?
  3. Failure Modes:
    • How will job failures be handled (e.g., retries, dead-letter queues)?
    • What’s the RTO/RPO for queue data if Tarantool fails?
  4. Monitoring:
    • Are there metrics for queue depth, processing latency, or worker health?
  5. Alternatives:
    • Why Tarantool over Redis/RabbitMQ? What unique requirements does it solve?

Integration Approach

Stack Fit

  • Laravel Ecosystem:
    • Queue Drivers: Replace database, redis, or sync drivers in .env:
      QUEUE_CONNECTION=tarantool
      
    • Job Classes: Existing jobs (e.g., App\Jobs\SendNotification) require no changes.
    • Workers: Use Laravel’s queue:work or custom workers with TarantoolQueue binding.
  • Tarantool Stack:
    • Schema: Define spaces for queues/jobs (example):
      -- Tarantool Lua setup (e.g., in init.lua)
      box.schema.space.create('queues', { if_not_exists = true })
      box.schema.space.create('jobs', { if_not_exists = true })
      
    • Authentication: Configure tarantool.connect() with credentials in Laravel’s config.
    • Clustering: For HA, use Tarantool’s replication/vshard; ensure Laravel workers connect to the same cluster.

Migration Path

  1. Phase 1: Proof of Concept
    • Set up Tarantool locally with a minimal schema.
    • Test a single job type (e.g., SendEmailJob) with the package.
    • Validate serialization/deserialization of payloads.
  2. Phase 2: Pilot Integration
    • Replace one low-criticality queue (e.g., analytics) with Tarantool.
    • Monitor latency, failures, and throughput vs. current system.
  3. Phase 3: Full Rollout
    • Update Laravel config (config/queue.php) to default to tarantool.
    • Migrate historical jobs (if any) via Tarantool’s insert API.
    • Deploy workers with Tarantool-specific health checks.

Compatibility

Component Compatibility Notes
Laravel Jobs Works with ShouldQueue, Handle, and Dispatchable.
Delayed Jobs Supported via Tarantool’s delay field (custom Lua logic may be needed).
Middleware Laravel’s QueueMiddleware applies; add Tarantool-specific middleware if needed.
Horizon Not natively supported; build custom dashboard using Tarantool’s HTTP API or Lua.
Queue Retries Requires Tarantool Lua script to handle release() on failure.

Sequencing

  1. Pre-requisites:
    • Install ext-tarantool and configure php.ini.
    • Set up Tarantool server with queue spaces.
  2. Laravel Configuration:
    • Publish the package config (php artisan vendor:publish --provider="Alexlcdee\MessengerTarantool\ServiceProvider").
    • Update .env and config/queue.php.
  3. Testing:
    • Write PHPUnit tests for job serialization/deserialization.
    • Test worker failure scenarios (e.g., kill worker mid-job).
  4. Deployment:
    • Roll out workers with Tarantool connection pooling.
    • Monitor queue backlog and worker metrics.

Operational Impact

Maintenance

  • Package:
    • No Active Maintenance: Risk of unpatched bugs. Plan to fork or wrap the package in a private repo.
    • Dependencies: Monitor ext-tarantool and Tarantool server updates for breaking changes.
  • Tarantool Schema:
    • Schema changes (e.g., adding fields) require Lua script updates and potential job payload migrations.
    • Document schema evolution (e.g., via GitHub/GitLab issues).
  • Laravel:
    • Standard queue maintenance (e.g., queue:failed-table cleanup) applies, but Tarantool may need custom scripts.

Support

  • Troubleshooting:
    • Debugging: Use Tarantool’s box.space.jobs:select() to inspect jobs. Enable Lua debug logs.
    • Common Issues:
      • Connection Drops: Implement exponential backoff in workers.
      • Job Stuck: Add a heartbeat field to track worker activity.
      • Serialization Errors: Validate payloads with json_encode()/json_decode().
  • Support Channels:
    • Limited community support; rely on Tarantool’s forums or Lua experts.
    • Build internal runbooks for Tarantool-specific issues (e.g., "How to recover from a crashed Tarantool node").

Scaling

  • Horizontal Scaling:
    • Workers: Scale Laravel workers as needed; Tarantool handles concurrent reserve() calls.
    • Tarantool: Scale Tarantool nodes with replication/vshard for HA and sharding.
  • Performance Tuning:
    • Tarantool:
      • Adjust space memory limits (box.cfg{memtx_max_size}).
      • Optimize Lua scripts for job processing (avoid blocking calls).
    • Laravel:
      • Use QUEUE_CONNECTION=tarantool&timeout=60 for long-running jobs.
      • Implement batch processing for high-volume queues.
  • Throughput:
    • Benchmark against Redis (Tarantool may excel at <10ms latency for simple jobs but requires Lua overhead).

Failure Modes

Failure Scenario Impact Mitigation
Tarantool Node Crash Job loss if
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity