jrq wrote:
> I've inherited an EAV database and there's really no option to remodel
> it.  

Why not?  Are others depending on the existing schema?

> Data is stored as key_name, key_value pairs
> Trying to return a meaningful, unified recordset is far too complex to
> be efficient.
> I've decided to make use of the MySQL GROUP_CONCAT, and CONCAT_WS
> functions to return a fast query result, with the consolidated fields
> as one string.
> The final data is to be displayed and downloaded (CSV), but not all
> fields will be available for each "row", which makes serialization
> awkward.  I can't decide where the "heavy lifting" should go to parse
> and process this data for screen and download.
> 
> Does anyone have a good strategy for this?

If you can't remodel the DB, decline the project. :)

If you can't decline the project, export the data into a reasonable 
schema (a non-SQL database like MongoDB may be a good option here).  A 
Google search also turned up the acts_as_eav_model plugin, but I know 
nothing about it.

Another alternative: build a RESTful service (perhaps without Rails) on 
top of the EAV database, then connect Rails to it through 
ActiveResource.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to