Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Exploring the Internals of Active Record

ChariotSolutions via YouTube

Overview

Explore the internals of Active Record in this 58-minute conference talk from Aaron Patterson at Philly ETE 2013. Dive deep into Rails core concepts, enterprise gem development, and the intricacies of Active Record. Learn about interfaces, adapters, and the challenges of building efficient database connections. Discover insights on thread safety, connection pooling, and optimizing SQL performance through statement caching. Gain valuable knowledge on improving your Rails applications' performance and understanding the inner workings of Active Record.

Syllabus

Intro
Philadelphia Emerging Technology For The ENTERPRISE
Aaron Patterson @tenderlove
Rails Core Team
enterprise gem
Expense Reports
Rube Goldberg Expense Reporting System
Interfaces & Adapters
Exploring the internals of Active Record
I love my cat!
Disrupt Space
Disrupt the Space of Space Disruption
SEO Optimization
Leif Erikson (Later invented Cell Phones)
Release Date: September 2012
Problems.
Too Many Open Questions.
minitest/spec
Action Controller::Live
Streaming / Polling (with timeout)
Pitfalls
Webserver
Long Responses
Client Disconnect
Use Polling
Where is the bottleneck?
Time Breakdown
How do the test tasks work?
You app can have custom Rake tasks lib/tasks
Multiple Loads
Challenges
Switching Environments
Your app is a singleton
Change the env before app load
loading schema.rb
Real Solution: Remove Singleton
Connection Pooling
Pool limit =~ Server threads
Threads Pool Size is Just FineTM
Thread Safety
Is XXX Library Thread Safe?
Everything is Thread Safe, if you know the rules.
DB Connections ARE NOT Thread Safe
No locks around socket operations
AR Objects ARE NOT Thread Safe
No locks around read / write ops
Underlying DS is a hash with no locks
Split Work by Type
SQL Construction
Statement Cache
Query Cache: Same Statement Same Results
Saves Parse Time
Saves Bandwidth
Memory Increase
Cache Size Limit
Cache all invariants
Mamba Time
Health Walk.
Questions?

Taught by

ChariotSolutions

Reviews

Start your review of Exploring the Internals of Active Record

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.