4
votes

We are currently experimenting with service stack and ormlite for a new ERP application we are hoping to integrate with some of our legacy stuff. I find the approach taken by both Service-stack and it's ormlite module refreshing and a joy to use, so we'd like to foloow the same approach to simplicity and performance but a stumbling block we have come across is the auditing of data and actions. I was just wondering if anybody had dealt with this, using the service-stack "stack" and how they have approached it. We don't want to use dbtriggers as the database is being dropped and created regularly and we also have a number of actions that require and audit that wouldn't be appropriate for such low level management.

Any advice would be much appreciated.

1
What has been your experience since posting this 2 years ago. ie how to address auditing with OrmLite - Mark

1 Answers

2
votes

We have also been thinking about auditing but don't have anything concrete. Listed some of our thoughts. Feedback welcome.

  • We are leaning towards keeping our 'audit logs' in Redis. We are already using Redis as the CacheClient (so it's available) and the ServiceStack.Redis library makes it pretty simple to use outside of a simple cache. (Redis also has more to offer)
  • ServiceStack promotes a 'messaging style' so the thought is to take a 'Request' and map it to an 'Audit Message' (probably easier said than done) and store it in Redis. Possibly storing it as string JSON Value (maybe a list type would be more appropriate?). We have not worked out the format of the Key.
  • In order to 'trigger' the audit trail we could create our own base 'Service' class with appropriate method(s) for auditing.
  • We do have some concerns about Redis persistence and losing data (http://redis.io/topics/persistence)