Philadelphia Emerging Technology For The ENTERPRISE
3
Aaron Patterson @tenderlove
4
Rails Core Team
5
enterprise gem
6
Expense Reports
7
Rube Goldberg Expense Reporting System
8
Interfaces & Adapters
9
Exploring the internals of Active Record
10
I love my cat!
11
Disrupt Space
12
Disrupt the Space of Space Disruption
13
SEO Optimization
14
Leif Erikson (Later invented Cell Phones)
15
Release Date: September 2012
16
Problems.
17
Too Many Open Questions.
18
minitest/spec
19
Action Controller::Live
20
Streaming / Polling (with timeout)
21
Pitfalls
22
Webserver
23
Long Responses
24
Client Disconnect
25
Use Polling
26
Where is the bottleneck?
27
Time Breakdown
28
How do the test tasks work?
29
You app can have custom Rake tasks lib/tasks
30
Multiple Loads
31
Challenges
32
Switching Environments
33
Your app is a singleton
34
Change the env before app load
35
loading schema.rb
36
Real Solution: Remove Singleton
37
Connection Pooling
38
Pool limit =~ Server threads
39
Threads Pool Size is Just FineTM
40
Thread Safety
41
Is XXX Library Thread Safe?
42
Everything is Thread Safe, if you know the rules.
43
DB Connections ARE NOT Thread Safe
44
No locks around socket operations
45
AR Objects ARE NOT Thread Safe
46
No locks around read / write ops
47
Underlying DS is a hash with no locks
48
Split Work by Type
49
SQL Construction
50
Statement Cache
51
Query Cache: Same Statement Same Results
52
Saves Parse Time
53
Saves Bandwidth
54
Memory Increase
55
Cache Size Limit
56
Cache all invariants
57
Mamba Time
58
Health Walk.
59
Questions?
Description:
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.