Base solution for your next web application
Open Closed

Entity History and Mongodb #5180


User avatar
0
BobIngham created

I am sure I have seen a post here or on the github site about implementing a Mongodb driver for entity history functionality. I have searched but can not find anything. My Azure database is growing too fast with the insertions into the three entity history tables. I would like to cut into the code and push all entity history entries into Mongodb. Does anyone have any pointers on how to do this?


7 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @BobIngham,

    AspNet Zero doesn't support MongoDb. So maybe it was something else you remember. I remember a topic about MongoDb but it was about running AspNet Zero with MongoDb.

  • User Avatar
    0
    aaron created
    Support Team

    I am sure I have seen a post here or on the github site about implementing a Mongodb driver for entity history functionality.

    Nope.

    I would like to cut into the code and push all entity history entries into Mongodb. Does anyone have any pointers on how to do this?

    You can implement and replace IEntityHistoryStore.

  • User Avatar
    0
    BobIngham created

    Hi Aaron, Someone mentioned table bloat after running Entity History for a while on Azure. It would be nice to cut into the code somewhere and serialise the EntityChangeSet along with the related EntityChanges and EntitypropertyChanges and then simply throw them into a document database. After all, the data are immutable and, as such, are perfect for this functionality. Of course it would also mean cutting into code to deserialise but I don't think that would be problem. I will come back to this later, where should I start? Cheers, Bob

  • User Avatar
    0
    aaron created
    Support Team

    <cite>aaron: </cite> You can implement and replace IEntityHistoryStore.

  • User Avatar
    0
    BobIngham created

    That's a bit like telling me to replace the wimwam on the universal transmogrifier. Can you point me to the github code where the save command is?

  • User Avatar
    0
    aaron created
    Support Team

    You don't need to know Module Zero's implementation, but here it is: EntityHistoryStore.cs#L22-L25

    You can also read the documentation on Replacing Built-In Services.

  • User Avatar
    0
    BobIngham created

    Aaron, Forever in your debt. I will take a look at this later, at least now I can see it can be done. Now it's a matter of finding out how to do it! Thanks for your help again, it really is much appreciated. Cheers, Bob