I am basically working on creating a restful API which produces surveys and consumes survey responses.
I want to use Morphia library for modelling the HTTP Request document in MongoDB.
I want to log incoming HTTP request data for a survey application and later planning to analyze the data by performing various kind of "rule matching" on that request data.
HTTP requests have a quite a lot of information in headers. I want to basically store those headers in a meaningful way.
There are some standard headers with specific values, and there are some custom headers with custom values. I want to treat standard headers like Referer,Cookie,URL etc as first class citizens for query the data later.
I am not intending to store request body in this model as it will have a variable size ranging from body of KiBs to many MiBs.
So following are kind of queries i'll be performing
- Match HTTP Requests with Referer as major search engines. Match HTTP
- Match requests where URL param is some kind of regex Match HTTP Request
- Match requests where some Cookie and it's given value is present
- and list goes on..
What should a Morhpia model look like to achieve I described above ?
Morphia : http://code.google.com/p/morphia/