What is the best way to store and search for object transactions?

We have an object oriented app with a decent size. Whenever an object in an application changes, object changes are saved back to the database. However, this has become less ideal.

Currently, transactions are stored as a transaction and a set of transactions LI.

The transaction table has fields for those who, what, when, why, foreignKey and foreignTable. The first four are self-explanatory. ForeignKey and foreignTable are used to determine which object has changed.

TransactionLI has timestamp, key, val, oldVal and transaction id. It is basically a key / value / oldValue storage system.

The problem is that these two tables are used for each object in the application, so now they are quite large tables. Using them for anything is slow. Indexes only help this way.

So, we are thinking of other ways to do something similar. Things that we have reviewed so far: - The lining of these tables is a bit of a time stamp. - Denormalization of two tables and combining them into one. - The combination of the two above. - Performing something in order of serialization of each object after changing and storing it in subversive activities. “Maybe something else, but I can't think about it now.”

The whole problem is that we would like to have some mechanism for the correct storage and retrieval of transactional data. Yes, you can force this into a relational database, but in reality it is transactional data and should be stored accordingly.

What are the rest doing?

+3
source share
4 answers

We used the following approach: -

  • All objects are serialized (using the standard XMLSeriliser), but we decorated our classes with serialization attributes so that the resulting XML is much smaller (storing elements as attributes and dropping vowels to field names, for example). This can be done even further by compressing XML, if necessary.

  • SQL. , , GUID. , ( )

  • , , .

  • , , ( ).

+1

. , , - , partioning ( ), , / ( , , ).

.

, , - , blob ( ). , Xml .

, , , Xml, xml, , , .

, , interelations blob ( xml .net ). , . , Xml, , ​​ MSSQL, .

, , ( , ), , xml:

<objectDiff>
<field name="firstName" newValue="Josh" oldValue="joshua"/>
<field name="lastName" newValue="Box" oldValue="boxer"/>
</objectDiff>

, MSSQL, XML- . .

0

, , , , . , .

, , /.

0

, true Partitioning SQL Server 2005 , SQL Server. , - , 1000 .

, SQL 2008, .

, , , , .

/ , , .

0

Source: https://habr.com/ru/post/1699214/


All Articles