# Migrating Mountains of Mongo Data

DevFeed: [Migrating Mountains of Mongo Data](<https://devfeed.tech/articles/migrating-mountains-of-mongo-data-30546.md>)

Original publisher: [Read original article](<https://medium.com/build-addepar/migrating-mountains-of-mongo-data-63e530539952?source=rss----596e43e5e150---4>)

Author: Elan Kugelmass

Published: 2017-10-24T13:11:15Z

Content type: article

Language: en

Sources: [Addepar](<https://devfeed.tech/sources/addepar.md>)

Topics: [Database](<https://devfeed.tech/topics/database.md>), [Data pipelines](<https://devfeed.tech/topics/data-pipelines.md>), [data-engineering](<https://devfeed.tech/topics/data-engineering.md>), [etl](<https://devfeed.tech/topics/etl.md>), [AWS Database Migration Service](<https://devfeed.tech/topics/aws-database-migration-service.md>), [schema-evolution](<https://devfeed.tech/topics/schema-evolution.md>), [database-consistency](<https://devfeed.tech/topics/database-consistency.md>), [Transactions](<https://devfeed.tech/topics/transactions.md>)

Tags: [accounting](<https://devfeed.tech/tags/accounting.md>), [analytics](<https://devfeed.tech/tags/analytics.md>), [application](<https://devfeed.tech/tags/application.md>), [clients](<https://devfeed.tech/tags/clients.md>), [complex](<https://devfeed.tech/tags/complex.md>), [data-pipelines](<https://devfeed.tech/tags/data-pipelines.md>), [data-types](<https://devfeed.tech/tags/data-types.md>), [database](<https://devfeed.tech/tags/database.md>), [dataset](<https://devfeed.tech/tags/dataset.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [dependency-management](<https://devfeed.tech/tags/dependency-management.md>), [financial](<https://devfeed.tech/tags/financial.md>), [guarantees](<https://devfeed.tech/tags/guarantees.md>), [maintenance](<https://devfeed.tech/tags/maintenance.md>), [migration](<https://devfeed.tech/tags/migration.md>), [mongo](<https://devfeed.tech/tags/mongo.md>), [mongodb](<https://devfeed.tech/tags/mongodb.md>), [performance](<https://devfeed.tech/tags/performance.md>), [pipeline](<https://devfeed.tech/tags/pipeline.md>), [schemas](<https://devfeed.tech/tags/schemas.md>), [semantics](<https://devfeed.tech/tags/semantics.md>)

## AI overview

Addepar migrated its data ingestion database from Mongo 2.4 with deprecated TokuMX 2.0 to Mongo 3.4 to address write contention, operation timeouts, and limited diagnostics as data volumes grew. The team checked application access layers with expanded unit tests, used concurrent-client integration tests, and ran both databases in parallel through a Java dynamic proxy, comparing document results and operation latency. Mongo 3.4 was faster on average with less latency variation, despite occasional transient failures. Because TokuMX's disk format was incompatible and the pipeline was not client-facing, Addepar chose an offline weekend migration, rehearsed it in a production-like cluster, and tuned BSON export/import settings. Disabling journaling and index restoration and creating the replica set after restoring data cut completion time in half. A detailed runbook and coordination between engineering and DevOps helped complete the migration before the next business day.

## Source excerpt

At Addepar, we're building the world's most versatile financial analytics engine. To feed the calculations that give our clients an unprecedented view into their portfolios, we need data -- from as many sources, vendors, and intermediaries as possible. Our market and portfolio data pipelines ingest benchmarks, security terms, accounting, and performance data from hundreds of integration partners. Behind this data pipeline is a database. And like every database, ours requires maintenance and care. Maintaining an obsolete database instance is challenging due to lack of support, inferior performance, and a dwindling developer community. As our dataset grew and we faced increased stability and performance requirements, the engineering group at Addepar decided it was time to upgrade our venerable Mongo 2.4 (TokuMX 2.0) database to the latest and greatest Mongo 3.4. Every organization has at least one database saga, and we're excited to share one of ours. Dependency management extends to databases Upgrading a database is a tricky business. Like other dependencies that support a product, databases have a tendency to fall out of date. Upgrades are deferred until that imagined future where everything is stable, clients have exhausted their feature request lists, and there's not much to do in the office other than play foosball and exchange memes. It's an understandable decision! Databases are complicated, leaky abstractions that inevitably form an implicit extension of our application logic. Their data types, atomicity guarantees, and transactionality semantics define the constraints we place on data and drive how we store application state. And because these guarantees (or lack thereof) tend to change (in ways that are sometimes undocumented!) between database versions, moving to the latest release is a risky proposition. Motivated by our need for an extremely reliable datastore that could handle complex and evolving schemas, we chose Mongo as the sole database for Addepar's