Your SlideShare is downloading. ×

Thinking Small

2,576

Published on

A defense of building small, focused, and interconnected apps instead of monolithic apps.

A defense of building small, focused, and interconnected apps instead of monolithic apps.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,576
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Thinking SmallBig things, small packages, yadda yaddaBen Scofield / @bscofieldRubyNation / 2 April 2011
  • 2. Specialization
  • 3. Resource Usage
  • 4. Big vs. Small
  • 5. Hey, That’s me!
  • 6. THIS VPS rockS!
  • 7. MONOLITHADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 8. MONOLITH ADMIN SEARCH PAYMENTS API PUBLIC DATA REPORTS HELP CACHINGTWITTER
  • 9. MONOLITHADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 10. Like, WHOA
  • 11. ADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 12. Hmmmm.
  • 13. M1ADMIN APIREPORTS
  • 14. M1ADMIN APIREPORTS Ow, Quit It!
  • 15. Ow, Quit It! M1 M2ADMIN SEARCH API PUBLICREPORTS HELP Ow, Quit It!
  • 16. Ow, Quit It! M1 M2 M3ADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING Ow, Quit It! Ow, Quit It!
  • 17. Shared Hosting, AIYEEEE!
  • 18. ADMIN
  • 19. ADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 20. Lame! Anyother reasonS?
  • 21. Bye now!
  • 22. Smaller Is Better
  • 23. (bear with me)
  • 24. Classes
  • 25. Small classes are easier to:designbuildtestdebugreplacereuseunderstand
  • 26. SOLID
  • 27. SOLIDSingle Responsibility Principle
  • 28. SOLID Interface Segregation Principle
  • 29. Demeter Principle
  • 30. MVC
  • 31. Applications
  • 32. Small apps are easier to:designbuildtestdebugscalereplacereusepurchase
  • 33. Design
  • 34. BDUF
  • 35. MONOLITHADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 36. LDUF
  • 37. ADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 38. MONOLITHADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 39. ADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 40. Mockable
  • 41. Build
  • 42. Build == Start
  • 43. MONOLITHADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 44. ADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 45. Ship It!
  • 46. Baby Steps
  • 47. Easy to Start,Easy to Finish,Motivating
  • 48. red red green refactor
  • 49. red green refactor
  • 50. ASIDE:
  • 51. $ rake test.........F............$ rake test......................
  • 52. Test
  • 53. MONOLITHADMIN SEARCH PAYMENTS API PUBLIC DATA APIREPORTS HELP CACHING
  • 54. red green refactor
  • 55. Debug
  • 56. MONOLITHADMIN SEARCH PAYMENTS API PUBLIC DATA APIREPORTS HELP CACHING
  • 57. MONOLITHADMIN SEARCH PAYMENTS API PUBLIC DATA APIREPORTS HELP CACHING
  • 58. Scale
  • 59. MONOLITHADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 60. MONOLITH M1ADMIN SEARCH PAYMENTS DATA API PUBLICREPORTS HELP CACHING
  • 61. MONOLITH M1ADMIN SEARCH PAYMENTS DATA API PUBLIC Ow, Quit It!REPORTS HELP CACHING
  • 62. ADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 63. ADMIN SEARCH PAYMENTS DATA DATA DATA DATA API PUBLIC DATA DATAREPORTS HELP CACHING
  • 64. BL AT AN T PL UG$ heroku addons:upgrade shared-database:20gb
  • 65. or, you know, sharding and stuff
  • 66. Replace
  • 67. Hey, my search sucks.
  • 68. MONOLITHADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 69. ADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 70. ADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 71. Should I write this in ?
  • 72. Reuse
  • 73. MONOLITHADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 74. ADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 75. ADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 76. Purchase
  • 77. MONOLITHADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 78. ADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 79. Thanks for bearing with me:
  • 80. But I’m already doing that!
  • 81. How distinct are your functions?
  • 82. Tests never lie
  • 83. Code changes never lie
  • 84. How do we do it?
  • 85. You’re already doing it!
  • 86. Caching
  • 87. Payments
  • 88. Search
  • 89. Databases
  • 90. The Past
  • 91. MONOLITHADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 92. MONOLITHADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 93. MONOLITHADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 94. MONOLITHADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 95. ADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 96. Integration Tests
  • 97. Isolate
  • 98. Hey, my search sucks.
  • 99. MONOLITHADMIN SEARCH PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 100. SEARCH
  • 101. # in the applicationArticle.where([title LIKE ?, q])Article.where([tag_list LIKE ? OR title LIKE ?, q, q])# ...
  • 102. # in the applicationArticle.search(q)Article.search(query, :include => [:tags])# article.rbclass Article < ActiveRecord::Base def self.search(query, options = {}) if options.empty? where([title LIKE ?, query]) else # ... end endend
  • 103. Integration Tests: pass
  • 104. Replace
  • 105. # Gemfilegem texticle# article.rbclass Article < ActiveRecord::Base index title do title end index full do title tag_list end def self.search(query, options = {}) if options.empty? search_title(query) else # ... end endend
  • 106. Integration Tests: pass
  • 107. SEARCH MONOLITHADMIN PAYMENTS API PUBLIC DATAREPORTS HELP CACHING
  • 108. Repeat!
  • 109. THE FUTURE
  • 110. Integration Tests
  • 111. Plan for Modularity
  • 112. Look for Opportunities
  • 113. UG PL T AN ATBL
  • 114. API-Driven Design
  • 115. API-Driven Design
  • 116. HTTP and REST
  • 117. Discoverability
  • 118. API
  • 119. ADMIN updates schemaPUT / POST / DELETE what is editable? DATA
  • 120. SEARCH metadata / data what should we index? DATA
  • 121. queryPUBLIC SEARCH results metadata / data what should we index? DATA
  • 122. queryPUBLIC SEARCH results metadata / data what should we index? DATA
  • 123. Mountable Apps
  • 124. Think Small
  • 125. Smaller Is Worse?
  • 126. M1ADMIN APIREPORTS
  • 127. M1ADMIN APIREPORTS Ow! ... Hey, that wasn’t so bad
  • 128. M1ADMIN APIREPORTS Ow! ... Hey, that wasn’t so bad
  • 129. Latency
  • 130. Reliability
  • 131. Ben Scofield / @bscofieldhttp://spkr8.com/t/7028http://benscofield.com
  • 132. THANKS! Ben Scofield / @bscofield http://spkr8.com/t/7028 http://benscofield.com

×