We are developing an individual caching solution that will use the SQL Server database to store cached objects. There is no cache in the application hosting environment, such as memcached or application fabric, so we must use the SQL Server database.
While most cached objects will be simple types (int, string, date, etc.), we will also need to store more complex types such as DataSets, DataTables, general collections, and custom classes.
I have very little experience with native .NET serialization and deserialization, but I believe that we will have to serialize the objects in some form (binary, xml, JSON, etc.) in order to store it in the database and then deserialize him when we pull him out of the database. I would like to get some expert opinions on what โsome formโ should be.
We use JSON.NET to serialize data into JSON for various AJAX requests. My initial thought was to serialize cached data in JSON in order to store it in the database. However, I wanted to get a few opinions on what would be best for performance and data integrity.
source
share