I'm still working through the beginning Rails tutorial, creating my VERY OWN BLOG. This tutorial has been incredibly helpful and everything I've been instructed to do has both worked on the first try and made complete sense. I've got a better understanding of HOW Rails works on a server. Here are some questions about that, however.
Say I create an application, test it on a local server and everything is fine and I'm ready to put it on a web server. Does the code need further editing, to tie it to a web server, or does it work automagically?
It's my understanding SQLite is fine for smaller web apps, but if I thought the application would have wider appeal, is this the point I'd have to edit the code to work with MySQL? Maybe I'm getting ahead of myself. (Again)
I feel like another piece of the puzzle fell into place today. I've always wondered HOW Ruby does what it does on the web, and Rails is the answer. Then I'd wondered how Rails worked and this MARVELOUS tutorial is really shedding some light on the question. This tutorial is also good at demonstrating how and when you create and edit functionality.
It's refreshing to be working on something different, too. Beginning Ruby has been a great resource and I'll definitely come back and work on some more projects, but I was really getting frustrated due to my problems installing MySQL and my foolish insistence on following the book TO THE LETTER.
Further editing to tie it to a web server?
ReplyDeleteGenerally no, but sometimes it is helpful. Application servers typical just run the code as-is and require very little fine tuning outside of things like different environments (production, development, staging). A common example is suppose your app is accessible from many domain names, but you strongly prefer one. You would now configure your app server to be a little more aware of it's hosting environment, which would require some editing.
When to switch to MySQL?
SQLite is fine for small apps, or things that only run a handful of app servers, it works perfectly well in those situations. Only when you need to handle higher write volume, or much more serious traffic does it become a serious bottle-neck. Luckily, because ActiveRecord provides a nice clean abstraction, your code should require little-to-no changes to switch from SQLite to MySQL. You'll know when your database choice is a problem, stop worrying about it until then.