Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rails in an era of big tech

JGTR
April 26, 2023
13

Rails in an era of big tech

Or how Rails promotes organizational diversity and anti-monopoly resilience

JGTR

April 26, 2023
Tweet

Transcript

  1. Rails in an era of big tech Or how Rails

    promotes organizational diversity and anti-monopoly resilience B Y J O R D Á N G . T R E V I Ñ O 1
  2. Overview of our journey a. b. c. 1. a. b.

    c. 2. 3. Big tech architecture sabotages companies Requires too much resourcing Resourcing/need mismatch leads to failures Client case study ​ Dangers of big tech monopolies for society What's new about massive digital platforms? History and future of antitrust Rails promotes small/mid co success => more diverse orgs ​ Take aways 2
  3. About me: Jordán Treviño • • • • • Founder

    of Telos Labs and software developer. Telos is a (US/Mexican) Rails-focused software agency with US clients spanning venture-backed startups, public tech companies, non-profits and governmental organizations. At Telos we've trained 30+ Rails developers and continue to notice strong adoption among Mexican venture-backed cos Previously: Strategy consultant launching cancer therapies, leading large IT projects and operational work for massive companies. Enthusiast of democracy and organizational diversity. 3
  4. I care about diversity 1. 2. 3. Diverse organizational structures…

    Defend against autocratic power Provide choice for people, employees other firms​ Preserve essential human values, traits, attributes (beyond profit-maximizing) Market power opposes diversity of this kind 4
  5. 1 Systems view of tech approaches 2 A case study

    3 Big tech Dangers Agenda 4 Take aways 5
  6. S T R A T E G Y ​ S

    T A C K C O M P O S I T I O N ​ P A T T E R N S ​ F E A T U R E S We face a range of decisions when writing web software 6
  7. Observations • • React is the most often used SPA

    framework, followed by Vue and Angular. ​ About 20% to 33% of projects use Hotwire/Stimulus. ~40% of Rails projects use a SPA front-end Source: https://rails-hosting.com/2022/#what-javascript-libraries-are-you-using-alongside-rails 10
  8. From a systems view • • Business constrains budget and

    resourcing (fuel) External market constrains our product needs (force of gravity) User requirements complexity Time to delivery You can control the engine (how much fuel it needs for its thrust) R E A C H I N G E S C A P E V E L O C I T Y 11
  9. Lack of resources compared to need, can sabotage our success

    < / > … Y O U C A N I N F L U E N C E N E E D T H R O U G H T H E T E C H C H O I C E S Y O U M A K E ! 12
  10. High Low Low High B I G T E C

    H P A T T E R N S R A I L S - F I R S T P A T T E R N S Resourcing Need for product development velocity 13
  11. High resource need Low resource need Low product change /

    Low scale​ High product change / high scale B I G T E C H P A T T E R N S R A I L S - F I R S T P A T T E R N S Constraint 15
  12. High resource need Low resource need Low product change /

    Low scale​ High product change / high scale B I G T E C H P A T T E R N S R A I L S - F I R S T P A T T E R N S Constraint 17
  13. Do you consider resourcing and future product change when making

    tech decisions? H O W D O Y O U K N O W Y O U A R E N ' T I N T H E D E A T H Z O N E ? < / > 18
  14. 1 Systems view of tech approaches 2 A case study

    3 Big tech Dangers Agenda 4 Take aways 19
  15. • • • Initial product on Rails with a SPA

    front-end. After 6 years, their tech team had grown disappointed with their stack and seemed to have run into issues they could not solve. They decided to move to a services architecture. Rejecting Rails 20
  16. The web stack: distributed ball of mud 1. 2. 300k

    loc in SPA, lots of duplicative data transformation logic Services had significant interdependency 21
  17. It didn't work out A few years later, velocity ground

    to a halt and all delivery became risky and unpredictable. 22
  18. Accelerate development velocity C L I E N T N

    E E D "We can't estimate our projects and can't meet our deadlines. Also, we need to launch a new important part of the platform in 6 months. Can you do it?" 23
  19. What to do? First — understand the problem D E

    E P D I V E E N G A G E W I T H T E A M A N D L E A D E R S 24
  20. H O W T O H A N D L

    E T H E D A T A L A Y E R ? 2 • • Business as usual Change to a newer framework H O W T O H A N D L E T H E C O M P L E X S P A ? 1 Two key questions to change business as usual • • • Business as usual Overhaul node services New Rails service 25
  21. High resources Low resources Low product change High product change

    B I G T E C H P A T T E R N S R A I L S - F I R S T P A T T E R N S Constraint 26
  22. R E S T O R E T H E

    M O N O L I T H 02 S H I F T T O S E R V E R - R E N D E R E D F R O N T E N D 01 Two recommendations 27
  23. 1. How to show new content rendered from a monolith

    while authenticating the user?​ < / > 28
  24. Transition to Server-Side Rendered multi-page app 1. 2. 3. 4.

    Pros of MPA Simpler execution flow Easier to be full-stack Eliminate front-end state concerns Can DRY-up data transformation logic to back-end But can a MPA perform? Yes. TurboLinks. Source: Sam Stephenson. RailsConf 2016. Turbolinks 5 - I can't believe it's not native! 29
  25. In preparing for this presentation, I realized Sam Stephenson had

    already said all there was to say on Turbolinks vs. SPA. Thank you, Sam.​ < / > 30
  26. 31

  27. 32

  28. Iframing the new front-end into the SPA N O T

    E L E G A N T , B U T … • • Outer shell was the Single Page App with a url that would load some empty HTML New iframe would point to the Rails monolith which rendered HTML using TurboLinks + StimulusJS 33
  29. 2. How to create the new functionality in record time

    from a new monolith when this depended on connecting to 12+ services? < / > 34
  30. How should the monolith access data in a microservices environment?

    Source: https://martinfowler.com/articles/microservices.html 1. 2. Options Connect to the API layer and query data and reconstruct in new monolith Somehow bypass the API layer? 35
  31. 36

  32. C O N N E C T T O M

    U L T I P L E D B S , B Y P A S S I N G T H E A P I S ​ D E S I G N T H E D O M A I N T O R E A S O N M O R E E F F E C T I V E L Y A B O U T T H E S P A C E Restoring the Rails monolith 37
  33. Multiple DBs: connect as an abstract class • • "It's

    important to connect to your database in a single model and then inherit from that model for the tables rather than connect multiple individual models to the same database. Database clients have a limit to the number of open connections there can be and if you do this it will multiply the number of connections you have since Rails uses the model class name for the connection specification name." Source: https://guides.rubyonrails.org/active_record_multip le_databases.html 39
  34. Rails makes a comeback • • Return of the monolith

    Server-side rendered front-end (Turbolinks + Stimulus) The new pattern unlocked the wave of productivity. Multiple Rails teams in parallel. IPO. 40
  35. Full-stack development DRY data transformation Few front-end state concerns Strong

    domain Major operational benefits to integrated patterns 41
  36. 1 Systems view of tech approaches 2 A case study

    3 Big Tech Dangers Agenda 4 Takeaways 42
  37. 0 50 100 150 200 250 Google 1999 - 2023

    Meta 2009 - 2023 Shopify 2006 - 2023 Most software companies 240 125 2.4 0 Lifetime company profits, $ US billion B I G T E C H Big tech: Not all tech companies are alike V E R Y L A R G E C O S S M A L L T E C H C O S 100k+ employees < 10k employees <!k employees 43
  38. • • • • • • • • • Billions

    of users Hundreds of thousands to millions of employees Hundreds of billions of cash on hand Financial resources no longer a constraint. Instead: Hiring Regulations (incl. antitrust) Internal communication / mgmt challenges Economic conditions / world limits Internal integration just isn't feasible BigTech loves fragmentation 44
  39. ReactJS Angular Many tools created to engineer Big Tech S

    P A F R A M E W O R K S M I C R O S E R V I C E D A T A E X C H A N G E GraphQL Kubernetes D E V O P S HHVM 45
  40. BigTech tech patterns are not responsible for their success Microservices

    first used as a word​ First release of Angular​ Annual revenue of Google, US billion $ 46
  41. Observations • • Majority of Rails devs work with fewer

    than 50 other developers ​ Even large Rails companies are far from 100k - millions of employees Majority of Rails devs work for small tech Source: https://rails-hosting.com/2022/#how-big-is-the-development-team 47
  42. • • Typical market power New to massive digital platforms

    Power over perception Behavior modification → Political control, Economic domination Dangers: Technofeudalism, cybernetic authoritarianism New kind of monopoly B I G T E C H I S N ' T T H E U S U A L K I N D O F B I G Sources: Shoshana Zubhoff: Age of Surveillance Capitalism, Yanis Varoufakis on Technofeudalism. 48
  43. Addresses specific practices such as mergers, acquisitions, and exclusive dealing

    contracts. C L A Y T O N A C T 1914 • Prohibits unfair methods of competition and deceptive acts or practices. F E D E R A L T R A D E C O M M I S S I O N A C T 1914 • It aims to prevent and punish monopolies and cartels, prohibiting agreements in restraint of trade and monopolization. S H E R M A N A C T 1890 Anti-competitive practices have been illegal for 100+ years 50
  44. Antitrust enforcement radically reduced in last 40 years 1. 2.

    3. 4. Reasons: Concerted effort to weaken anti-trust regime Economists and legal scholars​ The rise of neoliberal economic policies in the 1980s and 1990s​ The influence of corporate lobbying and campaign contributions Digital power is less understandable / novel and escapes regulation 51
  45. • • While the talk in news centers around national

    security, Meta has supported efforts to outright ban TIkTok ​ Meta's reasons are clear: TikTok is too good a competitor TikTok's is a threat (to Meta) 52
  46. 1 The importance of Escape Velocity 2 A case study

    3 Big Tech Dangers Agenda 4 Takeaways 55
  47. • • • • Death zone expands during a tech

    recession The dominant strategy is always to keep resourcing as efficient and tech optionality large Rails first doesn't mean not using services or SPAs when necessary Don't intentionally adopt Big Tech patterns unless you are sure financial resourcing is no longer an issue So Big tech patterns may not be right for you 56
  48. To find org/tech fit, you need to understand your org

    • • Some cos may be able to sustain big tech patterns, either due to huge resourcing, advanced skills of tech team and prior experience, etc. For most, Rails a key driver of tech diversity and plurality, as it enables smaller companies 57
  49. • • • • Hotwired/Turbo is understated, but it outperforms

    SPAs for most use cases (when factoring resource efficiency) ​ Monolith by default is the right choice when product requirements are uncertain ​ Medium/Large tech cos like Shopify, Github and others as well as DHH/Basecamp continue to enhance the framework ​ Let's take up Eileen's call to make a contribution to Rails Rails is cool because it helps companies succeed 58
  50. Thank you for making Rails awesome • • • Get

    in touch with me: Email: [email protected] Twitter: @_jgtr Github: @jgtr Slides here: 59