ruby
ruby
redis
Sidekiq basic_fetch and super_fetch differences
Sidekiq basic_fetch vs super_fetch: open source Sidekiq fetches jobs with BRPOP and loses them when a process crashes, while Sidekiq Pro's super_fetch uses RPOPLPUSH with private per-process queues to recover orphaned jobs. What that means for queue reliability.
optimistic-locking
Rails optimistic locking, pessimistic locking and how to solve StaleObjectError
Rails locking strategies for concurrent updates: optimistic locking with a lock_version column that works out of the box, pessimistic locking with lock! and with_lock, and practical ways to rescue and resolve the StaleObjectError that optimistic locking raises.
Latest
Factory Pattern with auto-detecting classes in Ruby
The Factory Pattern in Ruby, then a step further: using naming conventions and regular expressions so the factory auto-detects which notification class to instantiate. Complete code for both versions, plus when strict class listing is the safer choice.
How to write Naive Bayes classification algorithm in Ruby
Naive Bayes classification in plain Ruby: how prior and posterior probabilities decide the winning class, then a working spam filter that classifies email titles. Also where the algorithm shines: sentiment analysis, recommendations, and fraud detection.