0
Patrick Crowley
Rails for Legacy Apps
(How to use Rails
with existing apps)
•   New ideas
•New ideas

• No users
•New ideas

• No users
• Zero code investment
•New ideas

• No users
• Zero code investment

• Best case scenario
But, in the real world...
•   Legacy content
•Legacy content

• Existing userbase
•Legacy content

• Existing userbase
• Front end (HTML + CSS)
•Legacy content

• Existing userbase
• Front end (HTML + CSS)

• Database Schema
Q: How can I use Rails
 with a legacy app?
• Don’t! (Leave site as is)
• Don’t! (Leave site as is)
• Reboot site with Rails
• Don’t! (Leave site as is)
• Reboot site with Rails
• Or, maybe...
Use Rails as a control
panel to run your site
Case study:
Cinema Treasures
Front-end

                Smarty
Blogs
              Theater DB

        pMachine

    PHP/MySQL
How did we edit
  theaters?
phpMyAdmin
   (sadly)
• Intended for developers
• Intended for developers
• Easy to harm database
• Intended for developers
• Easy to harm database
• Doesn’t scale
Why not roll your own?
•   Not highest priority
•Not highest priority

• Busy with other things
•Not highest priority

• Busy with other things
• I never want to write
 PHP again.
Let’s do it in Rails!
Basic concept
Current site



 Database
Current site        Rails



         Database
Demo
Issues I ran into
• Non-plural table names
• Non-plural table names
• Had to remove primary
 id’s on join tables
• Non-plural table names
• Had to remove primary
 id’s on join tables

• Needed a way to delete
 cached templates on
 db u...
How long did this take?
1 week /
2 - 3 hours per day
The End
New Theaters
6,000


4,500


3,000


1,500


   0
        2000   2001   2002   2003   2004   2005
New Comments
50,000


37,500


25,000


12,500


    0
         2000    2001   2002   2003   2004   2005
Rails For Legacy Apps
Rails For Legacy Apps
Rails For Legacy Apps
Rails For Legacy Apps
Rails For Legacy Apps
Rails For Legacy Apps
Rails For Legacy Apps
Rails For Legacy Apps
Rails For Legacy Apps
Rails For Legacy Apps
Rails For Legacy Apps
Upcoming SlideShare
Loading in...5
×

Rails For Legacy Apps

1,336

Published on

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
1,336
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
21
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Rails For Legacy Apps"

  1. 1. Patrick Crowley
  2. 2. Rails for Legacy Apps
  3. 3. (How to use Rails with existing apps)
  4. 4. • New ideas
  5. 5. •New ideas • No users
  6. 6. •New ideas • No users • Zero code investment
  7. 7. •New ideas • No users • Zero code investment • Best case scenario
  8. 8. But, in the real world...
  9. 9. • Legacy content
  10. 10. •Legacy content • Existing userbase
  11. 11. •Legacy content • Existing userbase • Front end (HTML + CSS)
  12. 12. •Legacy content • Existing userbase • Front end (HTML + CSS) • Database Schema
  13. 13. Q: How can I use Rails with a legacy app?
  14. 14. • Don’t! (Leave site as is)
  15. 15. • Don’t! (Leave site as is) • Reboot site with Rails
  16. 16. • Don’t! (Leave site as is) • Reboot site with Rails • Or, maybe...
  17. 17. Use Rails as a control panel to run your site
  18. 18. Case study: Cinema Treasures
  19. 19. Front-end Smarty Blogs Theater DB pMachine PHP/MySQL
  20. 20. How did we edit theaters?
  21. 21. phpMyAdmin (sadly)
  22. 22. • Intended for developers
  23. 23. • Intended for developers • Easy to harm database
  24. 24. • Intended for developers • Easy to harm database • Doesn’t scale
  25. 25. Why not roll your own?
  26. 26. • Not highest priority
  27. 27. •Not highest priority • Busy with other things
  28. 28. •Not highest priority • Busy with other things • I never want to write PHP again.
  29. 29. Let’s do it in Rails!
  30. 30. Basic concept
  31. 31. Current site Database
  32. 32. Current site Rails Database
  33. 33. Demo
  34. 34. Issues I ran into
  35. 35. • Non-plural table names
  36. 36. • Non-plural table names • Had to remove primary id’s on join tables
  37. 37. • Non-plural table names • Had to remove primary id’s on join tables • Needed a way to delete cached templates on db update
  38. 38. How long did this take?
  39. 39. 1 week / 2 - 3 hours per day
  40. 40. The End
  41. 41. New Theaters 6,000 4,500 3,000 1,500 0 2000 2001 2002 2003 2004 2005
  42. 42. New Comments 50,000 37,500 25,000 12,500 0 2000 2001 2002 2003 2004 2005
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×