Methods, systems, and devices supporting data storage are described. A database system may implement lazy optimistic concurrency control (LOCC). LOCC may support an efficient use of database connections for a data archiving process. The data archiving process may involve a first worker thread at an application server copying data records from a primary database and writing the data records to a secondary database. A second worker thread may operate concurrent to the first worker thread to monitor the primary database for changes (e.g., using a shared database connection), as the primary database may not lock the copied data records during the archiving process. Data records that are altered in the primary database during the archiving process may be logged for error handling by an administrator. The data records that are copied from the primary database and not altered during the archiving process may be deleted from the primary database.
展开▼