I''m writing some interfaces to Asterisk, and I''m going back and forth on whether to use the existing database structure that asterisk uses, or to use my own schema. The end data still has to be stored in the asterisk schema, so if I use my own structure, every time I make an update I would need to update the asterisk schema also. The asterisk database schema replaces the standard asterisk text files where you have named sections and then configuration lines within those sections. In the schema the category is the section name, and each config line is stored as var_name and var_val. cat_metric and var_metric represent the order of the entries in the configuration. One of my goals is to make an interface that is easy to install and configure. To that end one of the requirements is that the final configuration can be written out to either the asterisk database or to the configuration files. So if I use my own schema on top of everything the translation would go something like this whenever an update is made: Using asterisk database: my tables -> asterisk tables Using text config files: my tables -> asterisk tables -> text files I could convert directly from my tables to the text files, but that is actually more complicated. Dumping the asterisk database to the text config files is pretty easy. I''d rather always convert to the asterisk database, and have the text file config generation as an option for each file. The upside to just using the asterisk schema is that it''s just the one database layer. The downside is that a lot of the rails way of doing things goes out the window. No models per config file, no easy to use validations, etc.. Another consideration is that I''m also adding an abstraction layer on top of everything else to make it a multi user system. So for instance I will have something like a ''users'' table, and each table for a config file will have a ''user_id'' field. The final configuration is then written out using a naming scheme for the configuration sections, where section_name becomes __username__section_name__. I wrote a system like this a few months back using perl, so I know this works and there shouldnt'' be any unexpected surprises. At that time I just used the stock asterisk database schema. Any thoughts on this? Chris Sample asterisk config file: [section1] exten => blah,blah,blah include => blah VAR1 = testing asterisk database schema: CREATE TABLE astconfigs ( id serial NOT NULL, cat_metric int8 DEFAULT 0, var_metric int8 DEFAULT 0, commented int8 DEFAULT 0, category varchar(128), filename varchar(128), var_name varchar(128), var_val varchar(128) ) _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails