Advanced Rails - Building Industrial-Strength Web Apps in Record Time
Large/Binary Objects | 105 Sending Data with X-Sendfile Often you will need to send a file to the client for download after doin ...
106 | Chapter 4: Database From Rails, you can set the response headers by modifying theresponse.headers hash: response.headers[' ...
Large/Binary Objects | 107 Serving Static Files One advantage of filesystem storage is that as long as the file data doesn’t nee ...
108 | Chapter 4: Database class UserAvatar < ActiveRecord::Base belongs_to :user has_attachment :content_type => :image, : ...
Advanced Database Features | 109 requests to complete. When the file transfer completes, Mongrel processes that Rails request al ...
110 | Chapter 4: Database In this sense, “application” can mean one program or multiple programs within an application boundary ...
Advanced Database Features | 111 As with any other area of data modeling, there are gray areas. An example would be “an employee ...
112 | Chapter 4: Database If the table had been namedclients, you would not even need theset_table_namecall. The relationships a ...
Advanced Database Features | 113 For situations such as this, Dr Nic Williams has made composite keys work with ActiveRecord. Th ...
114 | Chapter 4: Database As a final touch, we can set things up so that we don’t have to worry about the keys at all in code. R ...
Advanced Database Features | 115 When using Postgres large objects, you should use a trigger to delete the large object when th ...
116 | Chapter 4: Database current_listingsandnon_current_listings, which inherit from the main table. This way, we can saySELECT ...
Connecting to Multiple Databases | 117 legacy: adapter: mysql database: my_db username: user password: pass host: legacy_host ne ...
118 | Chapter 4: Database You can go one step further and DRY this code up by using class inheritance to define which database a ...
Caching | 119 # use the read-only connection @user = ReadSlave::User.find(params[:id]) # write to the master (can't use @user.up ...
120 | Chapter 4: Database def expire_me expire_cache(id) end end Of course, the proper solution for you will depend on the speci ...
Load Balancing and High Availability | 121 MySQL Replication MySQL has built-in support for master-slave replication. The master ...
122 | Chapter 4: Database Since the Cluster software is simply a storage engine, the cluster is accessed through a standard MySQ ...
Load Balancing and High Availability | 123 Use a software high-availability solution such as Wackamole (http://www. backhand.or ...
124 | Chapter 4: Database PGCluster’s replication style is synchronous; updates are propagated to all servers before the update ...
«
2
3
4
5
6
7
8
9
10
11
»
Free download pdf