Database design suggestion required

44 views
Skip to first unread message

Gane R

unread,
Nov 2, 2014, 10:01:41 AM11/2/14
to rubyonra...@googlegroups.com
Hi all,

I have an requirement of parsing an xml to db.

XML file has a schema and it is subjected to change over a period of time. I want to know how to map this xml to Database table.

Is this something like XSD to Dynamic class to ActiveRecord. I am new to this. How can I do this please suggest the me the methodology to follow or the gems can I use.

Thanks
Gane

Vladimir Gordeev

unread,
Nov 3, 2014, 2:00:49 AM11/3/14
to rubyonra...@googlegroups.com
It is expected to be indexable? What parts of it?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8b05d279-e7fd-4faa-bac7-9c709da535ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Frederick Cheung

unread,
Nov 3, 2014, 11:21:39 AM11/3/14
to rubyonra...@googlegroups.com
If the attributes will change over time then you'll either have to write migrations for this as it happens or use some form of serialization for the variable data ( hstore or json in postgres, rails serialization etc.). Also worth considering whether a relational model is the best fit for your data.

Fred

john...@gmail.com

unread,
Nov 5, 2014, 4:57:24 PM11/5/14
to rubyonra...@googlegroups.com

I don't know precisely how you can do it - but ruby has a built in XML parser for databases.
Though changing schema over time is a bit annoying (and bad practices as well in my opinion) You can't set up your database to deal with a changing schema.
Reply all
Reply to author
Forward
0 new messages