JCRON projesi, yüksek performanslı cron scheduling için birden fazla implementasyon içerir. Bu dokümanda, Go port'u (ana Go kü## ✅ Syntax Compatibility Analizi (Sonraki İnceleme)
Ayrıntılı İnceleme: Bkz. syntax_compatibility_check.md
- Basic Cron: 100% uyumlu (5, 6, 7-field)
- Advanced Patterns: 100% uyumlu (L, #, W syntax)
- EOD/SOD Modifiers: 100% uyumlu
- Extensions: 95% uyumlu (WOY, TZ - minor UTC offset eksik)
- Multi-Pattern (|): ❌ Go'da YOK
- Overall: 88% uyumlu
- Multi-Pattern Operator (|) - PostgreSQL'de çalışır, Go'da değil
- UTC Offset Timezone (TZ:+03:00) - Go sadece IANA names destekler
Go port'u, tam-featured, production-ready bir scheduling library iken, SQL-ports temel zaman hesaplama fonksiyonlarına odaklanır.
Syntax açısından: Go ve SQL-ports'ta 88% uyumluluk var. Kritik eksiklik Go'da multi-pattern support'u.
Execution açısından: En kritik eksiklik, SQL-ports'ta job execution engine'inin olmamasıdır.
- Job execution wrapper'larını ekle (scheduler guide'ı expand et)
- Error handling - retry ve error reporting ekle
- Monitoring - execution logs ve metrics ekle
- Multi-Pattern Support - Pipe operator (|) desteği ekle
- UTC Offset Timezone - TZ:+03:00 format parsing ekle
- Hybrid Integration - Go ve SQL port'ları arasında seamless integration
- Wrapper Functions - next_end(), prev_start(), get_duration() consistency
- Documentation - Compatibility matrix açık hale getir
- Multi-Pattern Support (Go) - Syntax completeness için gerekli
- Job execution engine (SQL) - Scheduling functionality için gerekli
- UTC Offset TZ (Go) - Timezone flexibility
- Error handling (SQL) - Robustness
- Wrapper functions - Developer experience
- WOY Multi-year edge cases - Advanced scenarios
- Additional helper functions - Enhancement
Bu karşılaştırma, hangi port'un hangi use case için uygun olduğunu belirlemek için temel referans olarak kullanılabilir.
Son Güncelleme: 24 Ekim 2025
Uyum Durumu: 88% (Syntax), 50% (Execution)
Referans: syntax_compatibility_check.md, missing_features_go_port.md-ports (PostgreSQL SQL fonksiyonları) arasındaki temel farklar, özellik karşılaştırması ve kritik eksiklikler detaylıca incelenmiştir.
Tarih: 24 Ekim 2025
Versiyon: Go Port v4.2.0, SQL-Ports v4.0
Go port'u, tam teşekküllü bir Go kütüphanesi olarak tasarlanmıştır:
- Engine: Cron expression parsing ve zaman hesaplaması
- Runner: Job execution engine (start/stop, concurrency control)
- Job Management: Add/remove jobs, retry policies, panic recovery
- Schedule Struct: Detaylı scheduling konfigürasyonu
- Core operations: 152-289ns
- Zero-allocation hot paths
- Sub-nanosecond bit operations (0.3ns)
- Aggressive caching with RWMutex
- ✅ 5-field ve 6-field cron syntax
- ✅ Advanced patterns: L (last), # (nth), W (weekday)
- ✅ Week of Year (WOY) support
- ✅ Timezone support (IANA zones)
- ✅ EOD/SOD modifiers (End/Start of Day/Week/Month/Hour)
- ✅ Thread-safe concurrent operations
- ✅ Built-in error handling & retries
- ✅ Panic recovery
- ✅ Structured logging (slog integration)
- ✅ PostgreSQL integration
- ✅ Job execution with configurable options
type Schedule struct {
Second, Minute, Hour, DayOfMonth, Month, DayOfWeek, Year, WeekOfYear, Timezone *string
}
type Runner struct {
// Job management, execution control
}
func (e *Engine) NextTime(schedule Schedule, from time.Time) (time.Time, error)
func (r *Runner) AddFuncCron(pattern string, fn func() error) (*Job, error)SQL-ports, PostgreSQL için saf SQL fonksiyonları olarak implement edilmiştir:
- Core Functions: next_time, match_time, prev_time
- Helper Functions: Timezone conversion, pattern validation
- Scheduler Guide: Manuel job table ve execution logic
- 10,000+ patterns/second throughput
- Sub-0.1ms average latency
- Optimized for PostgreSQL query execution
- ✅ Full cron syntax (6-field)
- ✅ Advanced patterns: L, #, W
- ✅ Week of Year (WOY) support
- ✅ Timezone support
- ✅ EOD/SOD modifiers (E/S + D/W/M/H)
- ✅ Pattern validation
- ✅ Batch processing support
-- Core functions
jcron.next_time(pattern TEXT, from_time TIMESTAMPTZ DEFAULT NOW()) RETURNS TIMESTAMPTZ
jcron.match_time(pattern TEXT, check_time TIMESTAMPTZ) RETURNS BOOLEAN
jcron.prev_time(pattern TEXT, from_time TIMESTAMPTZ) RETURNS TIMESTAMPTZ
-- Helper functions
jcron.get_duration(pattern TEXT, from_time TIMESTAMPTZ) RETURNS INTERVAL
jcron.next_end(pattern TEXT) RETURNS TIMESTAMPTZ
jcron.prev_start(pattern TEXT) RETURNS TIMESTAMPTZ| Özellik | Go Port | SQL-Ports |
|---|---|---|
| Execution Model | In-memory Go runtime | PostgreSQL database functions |
| Job Execution | Built-in runner with goroutines | Manual implementation required |
| Concurrency | Go goroutines + channels | PostgreSQL connection pooling |
| Persistence | Optional PostgreSQL integration | Native database storage |
| Language | Go application code | SQL queries/stored procedures |
| Özellik | Go Port | SQL-Ports |
|---|---|---|
| Cron Syntax Support | ✅ Full | ✅ Full |
| Advanced Patterns (L, #, W) | ✅ | ✅ |
| Week of Year (WOY) | ✅ | ✅ |
| Timezone Support | ✅ IANA zones | ✅ IANA zones |
| EOD/SOD Modifiers | ✅ D/W/M/H | ✅ D/W/M/H |
| Job Scheduling | ✅ Built-in | ❌ Manual |
| Retry Policies | ✅ Configurable | ❌ None |
| Error Handling | ✅ Panic recovery | ❌ Basic |
| Logging | ✅ Structured | ❌ None |
| Monitoring | ✅ Built-in metrics | ❌ Manual |
| Metrik | Go Port | SQL-Ports |
|---|---|---|
| Single Operation | 152-289ns | ~0.092ms |
| Throughput | High (in-memory) | 10,861 patterns/sec |
| Memory Usage | Low (Go heap) | Database memory |
| Scaling | Vertical (Go app) | Horizontal (PostgreSQL cluster) |
-
Built-in Job Execution Engine
- Eksiklik: SQL-ports'ta job execution için runner yok. Manuel implementation gerekli.
- Etki: Production-ready scheduler için ek development needed.
- Go'da Mevcut:
Runner.Start(),AddFuncCron(), automatic execution.
-
Retry ve Error Handling
- Eksiklik: SQL fonksiyonları error handling yapmaz, retry logic yok.
- Etki: Failed jobs için recovery mechanism eksik.
- Go'da Mevcut: Configurable retry policies, panic recovery.
-
Concurrent Job Execution Control
- Eksiklik: Multiple jobs aynı anda çalıştırılamaz, concurrency control yok.
- Etki: High-load scenarios'da bottleneck.
- Go'da Mevcut: Goroutine-based execution with limits.
-
Structured Logging ve Monitoring
- Eksiklik: Execution logs, metrics, health checks yok.
- Etki: Debugging ve monitoring zor.
- Go'da Mevcut: slog integration, execution statistics.
-
Real-time Job Management
- Eksiklik: Add/remove jobs runtime'da yapılamaz.
- Etki: Dynamic scheduling için limitation.
- Go'da Mevcut:
AddJob(),RemoveJob()methods.
-
Timezone Handling
- Go: Compile-time IANA validation
- SQL: Runtime PostgreSQL timezone conversion
- Fark: SQL'de daha flexible, ama error-prone
-
WOY Edge Cases
- Go: Robust handling of week/year conflicts
- SQL: 2.7% error rate in complex WOY patterns
- Fark: Go daha reliable, SQL'de edge case issues
-
Memory vs Database Trade-offs
- Go: In-memory caching, fast access
- SQL: Database queries, network latency
- Fark: Go low-latency, SQL high-throughput
| Feature Category | Go Port Score | SQL-Ports Score | Notes |
|---|---|---|---|
| Cron Syntax | 10/10 | 10/10 | Both full support |
| Performance | 10/10 | 9/10 | Go faster single ops, SQL better throughput |
| Advanced Patterns | 10/10 | 9/10 | SQL has WOY edge cases |
| Job Execution | 10/10 | 2/10 | Critical gap |
| Error Handling | 9/10 | 3/10 | Critical gap |
| Concurrency | 10/10 | 4/10 | Critical gap |
| Monitoring | 8/10 | 1/10 | Critical gap |
| Ease of Use | 9/10 | 6/10 | Go more developer-friendly |
| Production Ready | 10/10 | 5/10 | SQL needs more infrastructure |
- Microservices architectures (Go uygulamaları)
- Real-time job scheduling (low latency needed)
- Complex retry/error handling required
- In-memory performance critical
- Go ecosystem integration
- Database-centric applications
- Batch processing workloads
- High-throughput scenarios
- Existing PostgreSQL infrastructure
- SQL-based scheduling logic
- Go port for job execution
- SQL-ports for complex time calculations
- PostgreSQL for persistence
Go port'u, tam-featured, production-ready bir scheduling library iken, SQL-ports temel zaman hesaplama fonksiyonlarına odaklanır. En kritik eksiklik, SQL-ports'ta job execution engine'inin olmamasıdır.
- SQL-Ports Enhancement: Job execution wrapper'ları ekle (scheduler guide'ı expand et)
- Error Handling: SQL fonksiyonlarına retry ve error reporting ekle
- Monitoring: Execution logs ve metrics ekle
- Hybrid Integration: Go ve SQL port'ları arasında seamless integration
- High Priority: Job execution engine for SQL-ports
- Medium Priority: Error handling improvements
- Low Priority: Additional helper functions
Bu karşılaştırma, hangi port'un hangi use case için uygun olduğunu belirlemek için temel referans olarak kullanılabilir. /Users/mapletechnologies/go-workspace/src/github.com/meftunca/jcron/differences_go_vs_sql.md