Where do schema-less datastores get their schemas?

2 views
Skip to first unread message

Gary Moore

unread,
Oct 12, 2010, 2:23:28 PM10/12/10
to athena-tix-devel
Our ticket inventory doesn't have a "schema" in he traditional sense. It does, however, have an agreed-upon set of properties that client applications will expect to be there. What's the best way to ensure that these properties have been created and are known at ATHENA startup?

1) In the Java code? We're using Jersey, and the Java ws spec has a mechanism for this Config clas that runs on startup. My first idea was to put it in there:

http://github.com/fracturedatlas/ATHENA/blob/master/athena-web-resources/src/main/java/org/fracturedatlas/athena/web/config/ParakeetConfig.java

Upside is that it fits in nicely. It takes advantage of what is already available and I could have it implemented before I go home today. Downside is that it is Java code so changes can't be made by laymen who don't have Java skills.

2) In an xml file somewhere? Seems like a logical choice. I'd like to avoid xml as much as possible, though. We'd have to define a schema, read the xml at startup, complain about problems if they occur.

3) In our install package. Right now when I test the app, I run a ruby script:

http://github.com/fracturedatlas/utilityscripts/blob/master/add_tickets_to_tix.rb

to setup and seed the db. It's enormously flexible and uses the JSON/HTTP layer that is already there.

X) We'lll also have the hurdle of defining helpers and their schemas, so something flexible enough to accomodate some unknown number of schemas would be great.

Gary

Micah L. Frost

unread,
Oct 13, 2010, 11:09:47 AM10/13/10
to athena-t...@googlegroups.com
We could expand the add_tickets ruby script and parse some YAML, which is easier for laymen to handle. Helpers could provide their own YAML files and the script could load those from a conventional directory.

http://github.com/fracturedatlas/ATHENA/blob/master/athena-web-resources/src/main/java/org/fracturedatlas/athena/web/config/ParakeetConfig.java

http://github.com/fracturedatlas/utilityscripts/blob/master/add_tickets_to_tix.rb

Gary

--
Visit: http://athena.fracturedatlas.org/tix

You received this email because you are subscribed to the "ATHENA Tix Developers" group on Google Groups.

To post, email: athena-t...@googlegroups.com
To unsubscribe, email: athena-tix-dev...@googlegroups.com
For more, visit: http://groups.google.com/group/athena-tix-devel?hl=en

Gary Moore

unread,
Oct 15, 2010, 3:10:02 PM10/15/10
to athena-t...@googlegroups.com
I really like the YAML format and would be nice to rope this in somehow. ATHENA schemas would look like Rails' fixtures.

Anyone know of a YAML parser for Java? Off to github to look...

http://github.com/fracturedatlas/ATHENA/blob/master/athena-web-resources/src/main/java/org/fracturedatlas/athena/web/config/ParakeetConfig.java

http://github.com/fracturedatlas/utilityscripts/blob/master/add_tickets_to_tix.rb

Gary

--
Visit: http://athena.fracturedatlas.org/tix

--
Visit: http://athena.fracturedatlas.org/tix

--
Gary Moore | gary....@fracturedatlas.org | @gsmoore
Fork us on Github: http://github.com/fracturedatlas/
Join us on IRC: ##athena on irc.freenode.net

Gary Moore

unread,
Oct 20, 2010, 2:57:58 PM10/20/10
to athena-t...@googlegroups.com
One good option is yamlbeans: http://code.google.com/p/yamlbeans/

Another is to just read a file with JSON in it. We read the JSON out of the file, we can already go from JSON->PropField, and just go intot he DB from there. Anyone think writing a config file in JSON feels "dirty?"

Reply all
Reply to author
Forward
0 new messages