In case you’re not a Rails programmer, ActiveRecord has this great ‘convention over configuration’ feature that defines a many to many relationship called the has_many_and_belongs_to association. For example, if you’re mapping many users to many devices, then the join table must named with both tables names (in this cas devices_users). What I didn’t realize until…
After upgrading the RAM on your Windows XP or Windows Vista computer (laptops and desktops) you should review your performance settings. The primary concern will be your pagefile.sys size to make sure it matches or exceeds the amount of RAM you have in the computer. For those of us that are familiar with Linux more so than Windows the pagefile is also called the swap file in Windows. The pagefile or swap file is used for anything that won’t fit into RAM so technically it is an overflow for RAM so the excess has somewhere to go.
RAM: Random Access Memory
Some quick explanations on designing scalable databases (thanks to Jon Sime of the PostgreSQL mailing list and Media Matters for America)
Horizontal vs Vertical scaling
Horizontal scaling is merely a general concept which, in its simplest form, means “adding more nodes” as opposed to vertical scaling which (very roughly) means making an individual node as powerful as possible. The two are not mutually exclusive (you could add more nodes, and make each one as powerful as possible — if you’ve got the money), and the concept is not limited to databases.
Using Railroad and Graphviz
Blog update (10/22/2007): Thanks to the comment posted by Blog de Kilgore, I tried Railroad (instead of using the below method with starUML) to visualize my RoR app. Very easy to setup and use (see examples on web page).
Here’s a quick command to create a .png graphic file of your models:
railroad -a -i -M | dot -Tpng > models.png
Here are the ones I tried. Hope the comments aren’t too confusing
- Simple Rails Log Query Analyzer
ruby bin/query_log_analyzer.rb ../log/production.log
production.log.1 (small log file ~25MB)Just printed the “Totals” heading with no results
production.log (large log file ~400MB)Ran for a long time and nothing happened