Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
376 commits
Select commit Hold shift + click to select a range
365991d
Fixed typos in custom-metrics/README.md
May 22, 2024
dcf2a3a
Added Python version check.
May 22, 2024
993a873
Merge pull request #118 from awslabs/113-create-script-to-publish-cus…
tmcallaghan May 22, 2024
744dcd9
added support for $switch
tmcallaghan May 23, 2024
cd2d3ee
fixing broken close()
tmcallaghan May 29, 2024
180a624
Merge pull request #112 from awslabs/metric-collection-tool
tmcallaghan Jun 3, 2024
91521db
added support for $regexFind and $regexMatch
tmcallaghan Jun 5, 2024
3cfbcf1
Create README.md
cod-all Jun 10, 2024
da5ec1c
Update README.md
cod-all Jun 10, 2024
8fe9944
MongoDB 6.0 and 7.0 additions
tmcallaghan Aug 2, 2024
379ddf3
fixed non incrementing exception counter
tmcallaghan Aug 8, 2024
6a4397a
improving string conversion of json data
tmcallaghan Aug 8, 2024
74e3b37
Update README.md - Adding support information.
tmcallaghan Aug 19, 2024
83b636a
added support for dictionaries, zstandard, and zlib
tmcallaghan Aug 23, 2024
edf04a8
Merge pull request #124 from awslabs/compression-review-v2
tmcallaghan Aug 23, 2024
071ea99
adding zstandard
tmcallaghan Aug 26, 2024
82c6c4b
exclude collections with 0 documents, skip dictionary if < 100 documents
tmcallaghan Aug 26, 2024
3aa41f5
logic error, if should have been elif
tmcallaghan Aug 27, 2024
a712937
Fixed the issue of ever exapnding global cluster name
gottumuk Sep 3, 2024
e856320
Merge pull request #129 from awslabs/128-multiple-failovers-will-incr…
tmcallaghan Sep 3, 2024
5167803
Adding MongoDB 6.3 operators
tmcallaghan Oct 1, 2024
228e2f5
Adding new aggregation state from 7.1
tmcallaghan Oct 2, 2024
804dc77
Update README.md
tmcallaghan Oct 3, 2024
9c946fc
adding support for non-objectid _id types
tmcallaghan Oct 8, 2024
561c9f2
Update README.md
tmcallaghan Oct 8, 2024
5527a48
adding gc watchdog tool
tmcallaghan Oct 8, 2024
1168242
adding IAM note
tmcallaghan Oct 8, 2024
e7747bd
initial commit
Oct 8, 2024
1358b17
Update README.md
tmcallaghan Oct 9, 2024
39e84e4
Update README.md
sourav11b Oct 9, 2024
27f73e1
PR changes
Oct 16, 2024
4e7f42f
renaming file
Oct 17, 2024
f2df43b
Rename update_apply_compression.py.py to update_apply_compression.py
sourav11b Oct 17, 2024
41c3c89
Update update_apply_compression.py
sourav11b Oct 18, 2024
d8d8cc4
Update README.md
sourav11b Oct 18, 2024
848894d
Update README.md
sourav11b Oct 18, 2024
1c5cf90
updated script
tmcallaghan Oct 21, 2024
1d73ca6
Update update_apply_compression.py
sourav11b Oct 23, 2024
33c2598
adding bash scripts to exclude
tmcallaghan Oct 24, 2024
e78311a
fixing seconds behind calculation bug
tmcallaghan Oct 24, 2024
cf83993
reduce queue messaging
tmcallaghan Oct 24, 2024
d95b440
fixing missing initialization
tmcallaghan Oct 24, 2024
7e33465
updating with support for $let
tmcallaghan Oct 25, 2024
8992996
exclude EC storage prices
tmcallaghan Oct 28, 2024
d92acfb
correcting update check
tmcallaghan Oct 29, 2024
fbb9230
updating pricing parser for non us-east-1 regions
tmcallaghan Oct 29, 2024
b6132ac
removing debug print statement
tmcallaghan Oct 29, 2024
a53aeff
removing commas from csv to allow for easier parsing
tmcallaghan Oct 29, 2024
96912a8
disable buffering
tmcallaghan Oct 29, 2024
fe2fa17
fixing standard cost estimate pricing
tmcallaghan Oct 29, 2024
2f5d428
adding debug print
tmcallaghan Oct 29, 2024
622018f
Merge pull request #130 from awslabs/compression_updater
tmcallaghan Oct 31, 2024
0446c7a
creating debug version for testing
tmcallaghan Nov 4, 2024
bf1ab6b
Merge branch 'master' of github.com:awslabs/amazon-documentdb-tools
tmcallaghan Nov 4, 2024
295e018
adding storage network throughput, fixing network throughput min/max
tmcallaghan Nov 5, 2024
d4d43bf
adding experimental filtering version
tmcallaghan Nov 8, 2024
820a177
client side filtering
tmcallaghan Nov 11, 2024
39da2f8
added output for number of loaders loading
tmcallaghan Nov 11, 2024
86192be
adding requests to requirements.txt file
tmcallaghan Nov 18, 2024
447824c
adding --region to example
tmcallaghan Nov 18, 2024
1e88b7c
fixing excluded directory issues
tmcallaghan Nov 22, 2024
06a8297
Fix typo in data-differ README.md example usage section
kimsehwan96 Nov 28, 2024
81dc3a4
updating EC supported operators, added percentage check utility
tmcallaghan Dec 2, 2024
4918d13
updating EC supported operators, added percentage check utility
tmcallaghan Dec 2, 2024
eeeddb0
Merge pull request #132 from kimsehwan96/fix-typo-in-data-differ-readme
tmcallaghan Dec 2, 2024
20e0686
adding 5.0 feature
tmcallaghan Dec 2, 2024
71a9940
Change camel cased arguments into kebab case in data-differ.py
kimsehwan96 Dec 3, 2024
9869a22
Update README.md in data-differ to reflect modification in data-diffe…
kimsehwan96 Dec 3, 2024
567d6e5
Update README.md in data-differ to fix wrogly deleted
kimsehwan96 Dec 3, 2024
4317236
Merge pull request #134 from kimsehwan96/fix-some-camel-case-args-int…
tmcallaghan Dec 3, 2024
f44bb8e
Fix missed case changes in data-differ.py
kimsehwan96 Dec 4, 2024
bc8e285
Change --check-target action like boolean flag and change some print …
kimsehwan96 Dec 4, 2024
58b188f
Merge pull request #135 from kimsehwan96/fix-missed-snake-case-in-dat…
tmcallaghan Dec 4, 2024
a5081df
Merge branch 'master' into update-logic-for-check-target-argument-lik…
kimsehwan96 Dec 4, 2024
9d0ec5f
Merge pull request #136 from kimsehwan96/update-logic-for-check-targe…
tmcallaghan Dec 4, 2024
770ebd5
Documentation fixes
tmcallaghan Dec 4, 2024
ad99339
Add documentation for --excluded-directories
tmcallaghan Dec 4, 2024
6be9336
initial checkin
tmcallaghan Dec 30, 2024
b0bacee
Update create-docdb-dashboard.py
tmcallaghan Dec 30, 2024
33b0d63
Update create-docdb-dashboard.py
tmcallaghan Dec 30, 2024
36e2f78
Update create-docdb-dashboard.py
tmcallaghan Dec 30, 2024
14de3cd
Update create-docdb-dashboard.py
tmcallaghan Dec 30, 2024
9280e44
Update create-docdb-dashboard.py
tmcallaghan Dec 30, 2024
9e269f7
Update create-docdb-dashboard.py
tmcallaghan Dec 30, 2024
4576eb5
changes
tmcallaghan Dec 30, 2024
6b48ed6
Update create-docdb-dashboard.py
tmcallaghan Dec 30, 2024
ccb558b
lots of config file changes
tmcallaghan Dec 30, 2024
b3451d3
remove unused function
tmcallaghan Dec 30, 2024
ece2a76
Merge pull request #137 from awslabs/redo-dashboard-meta
tmcallaghan Dec 30, 2024
4b52fc4
adding appname
tmcallaghan Jan 14, 2025
1b33f23
adding number of workers actually loading data
tmcallaghan Jan 14, 2025
bffa80e
adding appname
tmcallaghan Jan 14, 2025
ed7ac06
added NVMe metrics
tmcallaghan Jan 22, 2025
02e8f74
updating README
tmcallaghan Jan 22, 2025
21a597a
Update README.md
cod-all Jan 28, 2025
7752f68
adding support for non-default endpoint URLs
tmcallaghan Jan 29, 2025
42bb056
Merge branch 'master' of github.com:awslabs/amazon-documentdb-tools
tmcallaghan Jan 29, 2025
ae1a343
adding missing command line argument
tmcallaghan Jan 29, 2025
1e5b4c4
Add access control requirements to readme.
tmcallaghan Feb 4, 2025
6f8a3c2
adding utility to output server certificate expiration
tmcallaghan Feb 18, 2025
345228c
adding readme
tmcallaghan Feb 18, 2025
75faf7e
cleanup IAM needs
tmcallaghan Feb 18, 2025
6526003
adding requirements.txt
tmcallaghan Feb 18, 2025
8fdcf1a
added note to https://github.com/awslabs/amazon-documentdb-tools/tree…
dbonser Mar 4, 2025
e784bd6
added note to https://github.com/awslabs/amazon-documentdb-tools/tree…
dbonser Mar 4, 2025
9d60404
Merge pull request #139 from awslabs/gc-automation-readme
tmcallaghan Mar 9, 2025
b583760
Adding utility for finding large documents
cod-all Mar 25, 2025
9d0d2eb
Updated index length values
cod-all Mar 25, 2025
939da5a
updating index name lengths, closing #131
tmcallaghan Mar 31, 2025
312b82f
removing global cluster automation tool - deprecated
tmcallaghan Mar 31, 2025
10ee3a4
Revert "Updated index length values"
cod-all Mar 31, 2025
4414b02
Merge pull request #140 from cod-all/master
tmcallaghan Mar 31, 2025
8747a2b
adding checks for unsupported and mixed data types for _id, closing #142
tmcallaghan Apr 1, 2025
77444d4
Merge branch 'master' of github.com:awslabs/amazon-documentdb-tools
tmcallaghan Apr 1, 2025
4c921ad
adding mongodb-changestream-review, closing #141
tmcallaghan Apr 3, 2025
d1034f0
adding capture of unused space statistics
tmcallaghan Apr 8, 2025
ab366f9
adding script to create CSV ready compatibility data
tmcallaghan Apr 10, 2025
48bad01
setting all charts as 0 based on the y-axis
tmcallaghan Apr 11, 2025
21c1ee7
adding 10 missing operators/stages
tmcallaghan Apr 16, 2025
99be188
adding CloudWatch metrics
tmcallaghan May 2, 2025
bea5cab
added docdbExportUsersAndRoles.py to export user & custom role inform…
dbonser May 7, 2025
280f488
Modified docdbExportUsers.py to export user & custom role information…
dbonser May 8, 2025
227f837
added metrics for migration
gottumuk May 12, 2025
0864de7
updated to monitor migration metrics
gottumuk May 12, 2025
16ebf0d
Merge pull request #145 from awslabs/dbonser-export-users-branch
tmcallaghan May 13, 2025
0e37b12
Update README.md
tmcallaghan May 19, 2025
7452c28
Update README.md
tmcallaghan May 19, 2025
e818e15
addressed the feedback of the PR
gottumuk May 21, 2025
e1a5079
fixed the dashboard not getting created due to changes
gottumuk May 26, 2025
68f52ec
added a missing if condition for additional clusters
gottumuk May 27, 2025
64b1d5b
changed MigratorFLRemainingSeconds graph to timeseries
gottumuk May 27, 2025
769e6ba
Merge pull request #144 from awslabs/dashboarder-cdc-full-load
tmcallaghan May 27, 2025
bffeffe
updated mongodb-oplog-review.py to optinally save the oplog output to…
gottumuk May 27, 2025
3e50095
updated Readme for better readability
gottumuk May 27, 2025
fb28486
Merge pull request #149 from awslabs/76-mongodb-oplog-review-tool-out…
tmcallaghan May 28, 2025
1aabe9e
fixed data-differ to handle _id of dict type and fixed all the test s…
gottumuk May 29, 2025
4882543
Merge pull request #150 from awslabs/116-data-differ-does-not-support…
tmcallaghan May 30, 2025
9c229a2
Initial commit.
dbonser Jun 9, 2025
860f421
Fixed couchbase-to-amazon-documentdb.yaml
dbonser Jun 9, 2025
5bde1b3
Fixed incorrect URLs in EC2 instance UserData.
dbonser Jun 9, 2025
760d3a7
Metric Analyzer tool
cod-all Jun 9, 2025
b9f6166
Update README.md
cod-all Jun 9, 2025
0eabf1a
Minor changes to README.md.
dbonser Jun 9, 2025
84b019e
Merge pull request #154 from awslabs/couchbase-migration
tmcallaghan Jun 10, 2025
2c94032
Fixed code blocks in README.md and updated links to script files.
dbonser Jun 10, 2025
8788322
Merge pull request #153 from cod-all/master
tmcallaghan Jun 10, 2025
ec5929b
Fixed incorrect URL in EC2 instance UserData section.
dbonser Jun 10, 2025
dea936a
Merge pull request #155 from awslabs/couchbase-migration
tmcallaghan Jun 11, 2025
ba190ca
fixed issue with setup.sh URL.
dbonser Jun 16, 2025
d65b63d
Merge pull request #157 from awslabs/couchbase-migration
tmcallaghan Jun 16, 2025
c085bf2
fixing bug when t4 instance type pricing is not available
tmcallaghan Jun 16, 2025
0aed5c9
Fixed README.md issues and parameterized hardcoded values for Documen…
dbonser Jun 27, 2025
d5e7490
Merge pull request #158 from awslabs/couchbase-migration
tmcallaghan Jun 27, 2025
accd88c
fixing recent bug with multi-cluster deployment names
tmcallaghan Jul 7, 2025
6363fcb
add support for zstd level 3, with and without dictionary
tmcallaghan Jul 9, 2025
97edee0
adding readahead functionality
tmcallaghan Jul 18, 2025
eb4f5a0
sleep when too far ahead
tmcallaghan Jul 18, 2025
b239295
more readahead
tmcallaghan Jul 18, 2025
a53be61
readahead
tmcallaghan Jul 18, 2025
6dad64d
adding min and max
tmcallaghan Jul 18, 2025
1728f6e
Initial commit
Jul 31, 2025
0295393
Initial commit
Jul 31, 2025
81f371c
Merge pull request #160 from awslabs/dms_buddy
tmcallaghan Aug 4, 2025
2949d66
fixing bug with key counting, closing issue #84
tmcallaghan Aug 4, 2025
4f29975
capture serverless pricing, fixing issue #161
tmcallaghan Aug 5, 2025
4089a0b
updating for deprecation
tmcallaghan Aug 5, 2025
2e95550
adding warning message if no supported operators found
tmcallaghan Aug 6, 2025
7ba0818
adding support for $near in all DocumentDB versions
tmcallaghan Aug 14, 2025
d1fc5ef
keeping it simple
tmcallaghan Aug 19, 2025
da869b1
Update README.md
tmcallaghan Aug 19, 2025
0737b82
adding serverless metrics
tmcallaghan Aug 20, 2025
908acfd
corrected instructions for Atlas
Aug 27, 2025
79f54b7
Merge pull request #163 from awslabs/enhancement-1
tmcallaghan Aug 27, 2025
cb97e42
Update metric-analyzer.py
cod-all Aug 27, 2025
5137e5a
Merge branch 'awslabs:master' into master
cod-all Aug 27, 2025
415b909
Merge pull request #164 from cod-all/master
tmcallaghan Aug 27, 2025
1fcd287
new version 3 - adds support for compatibility testing using serverSt…
tmcallaghan Sep 10, 2025
0ccc34a
Update README.md
tmcallaghan Sep 10, 2025
274e1be
adding support for additional operators
tmcallaghan Sep 10, 2025
052f829
changes due to extended support pricing
tmcallaghan Sep 10, 2025
072e0ea
removing debug output
tmcallaghan Sep 11, 2025
d4efb7a
fix: "missing operator" message
marxus Sep 16, 2025
5f2c010
Merge pull request #166 from marxus/patch-1
tmcallaghan Sep 16, 2025
82ecb17
fixing typo, adding two additional filtered ops
tmcallaghan Sep 16, 2025
0601b94
added feature to estimate ins/upd/del based on counters and server up…
tmcallaghan Sep 16, 2025
0f5f6c6
add exception handling for MongoDB output
tmcallaghan Sep 16, 2025
987b630
removing deprecation warning
tmcallaghan Sep 17, 2025
c3e329b
capture if DocumentDB compression is enabled and the threshold
tmcallaghan Sep 17, 2025
8d1f2b6
updating to eliminate utc warning, changing interval to sensible default
tmcallaghan Sep 18, 2025
a7c18a6
add feature to find large changestream events
tmcallaghan Sep 19, 2025
45b5642
adding support for text indexes
tmcallaghan Oct 2, 2025
c4a792f
adding index compare tool
tmcallaghan Oct 2, 2025
1333571
adding fix for dotProduct similarity with vector indexes
tmcallaghan Oct 3, 2025
d08bf72
adding days uptime for --uri feature
tmcallaghan Oct 14, 2025
41c17c4
Update README.md
tmcallaghan Oct 14, 2025
af89fe2
adding exclusions and additional unsupported operators
tmcallaghan Oct 15, 2025
89a7006
initial version of Couchbase discovery utility
dbonser Oct 17, 2025
d7d6e08
Merge pull request #168 from awslabs/couchbase-discovery-tool
tmcallaghan Oct 17, 2025
b85b04c
Renamed to Discovery Tool for Couchbase
dbonser Oct 24, 2025
dd7bf5e
Merge pull request #169 from awslabs/discovery-tool-for-couchbase
tmcallaghan Oct 27, 2025
7d32ec3
added r8g instance types
dbonser Oct 27, 2025
7f164ae
added r8g instance types
dbonser Oct 27, 2025
0bebd57
added r8g instance types
dbonser Oct 27, 2025
a1ffe66
added r8g instance types
dbonser Oct 27, 2025
c07f7b8
added r8g instance types
dbonser Oct 27, 2025
f010325
added r8g instance types
dbonser Oct 27, 2025
0316555
added r8g instance types
dbonser Oct 28, 2025
6bff75d
added r8g instance types
dbonser Oct 28, 2025
04291c1
Merge pull request #170 from awslabs/couchbase-migration
tmcallaghan Oct 28, 2025
ab5e8e6
fixed missing connector.class attribute in migration-utility-connecto…
dbonser Oct 28, 2025
f6d3ed5
Merge pull request #171 from awslabs/dbonser
tmcallaghan Oct 28, 2025
17b3579
changing default for dictionary size
tmcallaghan Oct 28, 2025
b2ed649
Initial commit
Nov 3, 2025
5296248
Add unsupported filename pattern * for index
Nov 6, 2025
05e7e59
unsupported index field name $**
satebam Nov 6, 2025
003e1a2
Remove regex for unsupported field names and add wildcard list
satebam Nov 6, 2025
460eefa
fixed the logic in mvu tool script
Nov 10, 2025
549111a
Increase COLLECTION_NAME_MAX_LENGTH to 255
satebam Nov 11, 2025
619e1d6
adding support for DocumentDB 8.0
tmcallaghan Nov 17, 2025
a30a783
Merge pull request #174 from awslabs/mvu-tool-fix
tmcallaghan Nov 20, 2025
8d5747e
adding NVMe metrics
tmcallaghan Nov 21, 2025
45dad26
Fix collStat operation and add check for wiredTiger
hanyshafik Nov 24, 2025
05a288e
Merge pull request #176 from hanyshafik/master
tmcallaghan Nov 24, 2025
a030c0b
Merge pull request #175 from satebam/fix_namingLimits
tmcallaghan Nov 25, 2025
56bbd5e
Merge pull request #172 from rishij39/docdb-top-ops
tmcallaghan Nov 25, 2025
4ae904f
Update it to ensure compatibility with MongoDB Atlas.
hanyshafik Dec 1, 2025
f479669
Update it to ensure compatibility with MongoDB Atlas
hanyshafik Dec 9, 2025
97a28a8
Merge pull request #177 from hanyshafik/master
tmcallaghan Dec 9, 2025
0777a90
Fix bug in collection name verification logic
hanyshafik Dec 9, 2025
2beaa4c
Merge pull request #178 from hanyshafik/master
tmcallaghan Dec 10, 2025
e1d338b
Catch exception on $external database role check in DocumentDB
tmcallaghan Dec 18, 2025
887762b
adding burstable instance metrics, added auto-detect for NVMe and ser…
tmcallaghan Dec 19, 2025
29224c5
minor dashboard cleanup
tmcallaghan Dec 23, 2025
932283f
Potential fix for code scanning alert no. 1: Clear-text logging of se…
tmcallaghan Dec 30, 2025
9e6873f
Merge pull request #179 from awslabs/alert-autofix-1
tmcallaghan Dec 30, 2025
1db8f6b
added GB/hr metric to output
tmcallaghan Jan 14, 2026
0dd2b2a
use existing connection, do not create a new one
tmcallaghan Jan 27, 2026
2052ae0
reducing appname to once per script execution
tmcallaghan Jan 29, 2026
914cfc2
removing out of place close
tmcallaghan Feb 10, 2026
1bad847
Add new sizing tool for Amazon DocumentDB cost estimator
Feb 10, 2026
ef2ec67
Renamed Sizing Calculator to Cost Estimator throughout tool
Feb 10, 2026
24b8bae
Updated per PR requested changes
Feb 11, 2026
307ae24
Merge pull request #180 from Bit-Quill/sizing-tool-with-compression
tmcallaghan Feb 12, 2026
b59bdfa
adding estimates for insert/update/delete/query
tmcallaghan Feb 20, 2026
d7bc36f
fixing for deprecation warning
tmcallaghan Feb 27, 2026
b535303
updating to work with Elastic Clusters
tmcallaghan Mar 5, 2026
bbb7349
default to run for both supported compressors
tmcallaghan Mar 6, 2026
2edaf32
add compressor to output filename
tmcallaghan Mar 6, 2026
e0fcc0f
removing extra files
tmcallaghan Mar 6, 2026
1113922
updating README
tmcallaghan Mar 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 6 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
# Amazon DocumentDB Tools

This repo contains the following tools.

## Amazon DocumentDB Index Tool

The `DocumentDB Index Tool` makes it easier to migrate only indexes (not data) between a source MongoDB deployment and an Amazon DocumentDB cluster. The Index Tool can also help you find potential compatibility issues between your source databases and Amazon DocumentDB. You can use the Index Tool to dump indexes and database metadata, or you can use the tool against an existing dump created with the mongodump tool.

For more information about this tool, checkout the [Amazon DocumentDB Index Tool README](./index-tool/README.md) file.
This repository contains several tools to help users with Amazon DocumentDB including migration, monitoring, and performance. A few of the most popular tools are listed below but there are additional tools in the [migration](./migration), [monitoring](./monitoring), [operations](./operations), and [performance](./performance) folders.

## Amazon DocumentDB Compatibility Tool

The `DocumentDB Compatibility Tool` examines log files from MongoDB or source code from MongoDB applications to determine if there are any queries which use operators that are not supported in Amazon DocumentDB. This tool produces a simple report of unsupported operators and file names with line numbers for further investigation.
The [DocumentDB Compatibility Tool](./compat-tool) examines log files from MongoDB or source code from MongoDB applications to determine if there are any queries which use operators that are not supported in Amazon DocumentDB.

For more information about this tool, checkout the [Amazon DocumentDB Compatibility Tool README](./compat-tool/README.md) file.

## Cosmos DB Migration Utility

The `Cosmos DB Migration Utility` is an application created to help live migrate the Azure Cosmos DB for MongoDB API databases to Amazon DocumentDB with very little downtime. It keeps the target Amazon DocumentDB cluster in sync with the source Microsoft Azure Cosmos DB until the client applications are cut over to the DocumentDB cluster.

For more information about the Cosmos DB Migrator tool, checkout the [Cosmos DB Migration Utility README](./cosmos-db-migration-utility/README.md) file.
## Amazon DocumentDB Index Tool

## Amazon DocumentDB Global Clusters Automation Tool
The [DocumentDB Index Tool](./index-tool) makes it easy to migrate only indexes (not data) between a source MongoDB deployment and an Amazon DocumentDB cluster.

The `global-clusters-automation` is a tool created to automate the global cluster failover process for Disaster Recovery (DR) and Business Continuity Planning (BCP) use cases. It uses AWS lambda functions to trigger failover process and convert a standalone regional cluster to a global cluster.Amazon Route53 private hosted zone is used to manage cluster endpoints changes for applications.
## Support

For more information about the Global Clusters Automation Tool, checkout the [Global Clusters Automation Tool](./global-clusters-automation/README.md) file.
The contents of this repository are maintained by Amazon DocumentDB Specialist SAs and are not officially supported by AWS. Please file a [Github Issue](https://github.com/awslabs/amazon-documentdb-tools/issues) if you experience any problems.

## License

Expand Down
205 changes: 166 additions & 39 deletions compat-tool/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,58 @@
# Amazon DocumentDB Compatibility Tool
The tool examines MongoDB log files or source code from MongoDB applications to determine if there are any queries which use operators that are not supported in Amazon DocumentDB. This tool produces a simple report of unsupported operators and file names with line numbers for further investigation.
The tool examines **MongoDB serverStatus() counters**, **MongoDB log files**, or **application source code** from MongoDB applications to determine if there are any operators in use that are not supported in Amazon DocumentDB. It produces a simple report of both supported and unsupported operator usage.

## Recommended compatibility testing for MongoDB 5.0 and newer
* run the tool once using directConnection=true to the primary instance in your cluster
* ```python3 compat.py --uri "mongodb://<username>:<password>@<primary-hostname>:<port>/admin?directConnection=true"```
* if using secondary instances for read-scale run the tool again on one secondary (again using &directConnection)
* ```python3 compat.py --uri "mongodb://<username>:<password>@<secondary-hostname>:<port>/admin?directConnection=true"```

## Prerequisites for MongoDB Log File Analysis

### Enable query logging in MongoDB
#### For local, on-premise, or self-managed installations:
By default, MongoDB logs the slow queries, over the 100ms threshold, to the configured log file.

1. Check current profiling status and note the `slowms` value:
```
> db.getProfilingStatus()
{
"was": 0,
"slowms": 100,
"sampleRate": 1
}
```

2. Enable logging of all queries by setting `slowms` to `-1`:
```
> db.setProfilingLevel(0, -1)
```
3. **After completing the compatibility analysis**, reset to the original profiling level (using the `slowms` value from step 1):
```
> db.setProfilingLevel(0, 100)
```

#### For MongoDB Atlas:
MongoDB Atlas dynamically adjusts slow query threshold based on the execution time of operations across the cluster. The Atlas-managed slow operation threshold is enabled by default and must be disabled using the Atlas CLI, Atlas Administration API, or Atlas UI.

1. Disable the Atlas-Managed Slow Operation Threshold by going to Project Settings for the cluster project and toggling Managed Slow Operations to Off. Please refer to the documentation here: https://www.mongodb.com/docs/atlas/performance-advisor/
2. Connect to your cluster using MongoDB shell or compass and enable full logging:
```
db.setProfilingLevel(0, -1)
```
3. [Download the logs](https://www.mongodb.com/docs/atlas/mongodb-logs/) from the Atlas console
4. **After completing the compatibility analysis**, enable the Atlas-Managed Slow Operation Threshold

If Atlas-managed slow operation threshold is not enabled, follow the same steps as local or on-premise installations above.

#### NOTE:
Query profiling can cause additional overhead, it is recommended to use a dev/test environment to capture the queries.
See the MongoDB [documentation](https://www.mongodb.com/docs/manual/reference/method/db.setProfilingLevel/) for additional information.

## Requirements
Python 3.6 or later
- Python 3.6 or later
- pymongo (if testing compatibility using the --uri option)


## Installation
Clone the repository and go to the tool folder:
Expand All @@ -12,17 +62,40 @@ cd amazon-documentdb-tools/compat-tool/
```

## Usage/Examples
This tool supports examining compatibility with either the 3.6, 4.0 or 5.0 versions of Amazon DocumentDB. The script has the following arguments:
This tool supports examining compatibility with either the 3.6, 4.0, 5.0, or Elastic Clusters 5.0 versions of Amazon DocumentDB. The script has the following arguments:
```
--version {3.6,4.0,5.0} -> Check for DocumentDB version compatibility (default is 5.0)
--directory SCANDIR -> Directory containing files to scan for compatibility
--file SCANFILE -> Specific file to scan for compatibility
--excluded-extensions EXCLUDEDEXTENSIONS -> Filename extensions to exclude from scanning, comma separated
--included-extensions INCLUDEDEXTENSIONS -> Filename extensions to include in scanning, comma separated
--show-supported -> Include supported operators in the report
--uri MONGO_URI -> Use db.serverStatus() output to scan for compatibility (requires MongoDB 5.0+)
--version {3.6,4.0,5.0,EC5.0} -> Check for DocumentDB version compatibility (default is 5.0)
--directory SCANDIR -> Directory containing files to scan for compatibility
--file SCANFILE -> Specific file to scan for compatibility
--excluded-extensions EXCLUDEDEXTENSIONS -> Filename extensions to exclude from scanning, comma separated
--excluded-directories EXCLUDEDDIRECTORIES -> Fully qualified path to directory to exclude, comma separated
--included-extensions INCLUDEDEXTENSIONS -> Filename extensions to include in scanning, comma separated
```

#### Example 1:
Check for compatibility using a MongoDB 5.0+ instance:
```
python compat.py --uri "mongodb://<username>:<password>@<hostname>:<port>/admin?directConnection=true"

connecting to the server at <hostname>:27017
database server major version is 5
checking compatibility using db.serverStatus()

The following 2 unsupported operators were found:
$bucket | executed 1 time(s)
$facet | executed 1 time(s)

The following 6 supported operators were found:
$eq | executed 12 time(s)
$group | executed 3 time(s)
$gt | executed 6 time(s)
$match | executed 1 time(s)
$switch | executed 1 time(s)
$unwind | executed 1 time(s)
```

#### Example 2:
Check for compatibility with Amazon DocumentDB version 5.0, files from the folder called test, excluding the ones with extension `.txt`:
```
python3 compat.py --version 5.0 --directory test --excluded-extensions txt
Expand Down Expand Up @@ -61,11 +134,11 @@ List of skipped files - excluded extensions
test/testlog2.txt
```

#### Example 2:
#### Example 3:
Check a specific file and show the supported operators found:

```
python3 compat.py --file test/testlog.txt --show-supported
python3 compat.py --file test/testlog.txt

processing file test/testlog.txt
Processed 1 files, skipped 0 files
Expand Down Expand Up @@ -95,39 +168,93 @@ The following 9 supported operators were found
- $sum | found 1 time(s)
```

#### NOTES:
* All files scanned by this utility are opened read-only and scanned in memory. For large files, make sure you have enough available RAM or split the files accordingly.
* With the exception of operators used, there is no logging of the file contents.
* Using the `--directory` argument will scan all the files, including subdirectories which will be scanned resursively.

### Enable query logging in MongoDB
#### For local or on-premise installations:
By default, MongoDB logs the slow queries, over the 100ms threshold, to the configured log file.
To view the current profiling status, use the `getProfilingStatus()` in MongoDB shell:
### Example 4:
Check for compatibility with Amazon DocumentDB, files from the folder called test, excluding the ones with extension `.txt` and excluding directories `exclude1` and `exclude2`:

```
> db.getProfilingStatus()
{
"was": 0,
"slowms": 100,
"sampleRate": 1
}
```
python3 compat.py --version 5.0 --directory test --excluded-extensions txt --excluded-directories /path/to/directory/exclude1,/path/do/directory/exclude2

To enable logging of all queries, set the `slowms` parameter to `-1`:
processing file test/mongod.log.2020-11-10T19-33-14
processing file test/mongodb.log
processing file test/sample-5-0-features.py
processing file test/sample-python-1.py
processing file test/sample-python-2.py

```
> db.setProfilingLevel(0, -1)
```
Processed 5 files, skipped 3 files

To set the slow logging threshold to the prvious level:
```
> db.setProfilingLevel(0, 100)
The following 5 unsupported operators were found:
$facet | found 2 time(s)
$sortByCount | found 2 time(s)
$bucket | found 1 time(s)
$bucketAuto | found 1 time(s)
$expr | found 1 time(s)

Unsupported operators by filename and line number:
$facet | lines = found 2 time(s)
test/mongodb.log | lines = [80, 82]
$sortByCount | lines = found 2 time(s)
test/mongod.log.2020-11-10T19-33-14 | lines = [83]
test/sample-python-2.py | lines = [29]
$bucket | lines = found 1 time(s)
test/mongodb.log | lines = [80]
$bucketAuto | lines = found 1 time(s)
test/mongodb.log | lines = [82]
$expr | lines = found 1 time(s)
test/mongod.log.2020-11-10T19-33-14 | lines = [107]

The following 34 supported operators were found:
- $match | found 34 time(s)
- $gt | found 15 time(s)
- $project | found 15 time(s)
- $lte | found 14 time(s)
- $group | found 13 time(s)
- $gte | found 13 time(s)
- $sum | found 11 time(s)
- $in | found 10 time(s)
- $count | found 7 time(s)
- $ne | found 7 time(s)
- $lookup | found 6 time(s)
- $unwind | found 4 time(s)
- $eq | found 3 time(s)
- $sort | found 3 time(s)
- $nin | found 2 time(s)
- $nor | found 2 time(s)
- $set | found 2 time(s)
- $skip | found 2 time(s)
- $addToSet | found 1 time(s)
- $and | found 1 time(s)
- $arrayElemAt | found 1 time(s)
- $avg | found 1 time(s)
- $dateAdd | found 1 time(s)
- $dateSubtract | found 1 time(s)
- $elemMatch | found 1 time(s)
- $first | found 1 time(s)
- $inc | found 1 time(s)
- $last | found 1 time(s)
- $limit | found 1 time(s)
- $lt | found 1 time(s)
- $max | found 1 time(s)
- $min | found 1 time(s)
- $not | found 1 time(s)
- $or | found 1 time(s)

List of skipped files - excluded extensions
test/not_a_log_file.txt
test/testlog.txt
test/testlog2.txt

List of skipped directories - excluded directories
test/exclude1
test/exclude2

```
#### NOTES:
* All files scanned by this utility are opened read-only and scanned in memory. For large files, make sure you have enough available RAM or split the files accordingly.
* With the exception of operators used, there is no logging of the file contents.
* Using the `--directory` argument will scan all the files, including subdirectories which will be scanned resursively.

#### For MongoDB Atlas:
Check the MongoDB Atlas documentation for how to [enable profiling](https://www.mongodb.com/docs/atlas/tutorial/profile-database/#access-the-query-profiler) and [download the logs](https://www.mongodb.com/docs/atlas/mongodb-logs/).
## Contributing
Contributions are always welcome! See the [contributing page](https://github.com/awslabs/amazon-documentdb-tools/blob/master/CONTRIBUTING.md) for ways to get involved.

#### NOTE:
Query profiling can cause additional overhead, it is recommended to use a dev/test environment to capture the queries.
See the MongoDB [documentation](https://www.mongodb.com/docs/manual/reference/method/db.setProfilingLevel/) for additional information.
## License
Apache 2.0
16 changes: 16 additions & 0 deletions compat-tool/add-new-version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/python3

import compat

def main():
existingVersion = "5.0"
newVersion = "8.0"

keywords = compat.load_keywords()

for thisKeyword in keywords.keys():
keywords[thisKeyword][newVersion] = keywords[thisKeyword][existingVersion]
print(" \"{}\":{},".format(thisKeyword,keywords[thisKeyword]))

if __name__ == '__main__':
main()
57 changes: 57 additions & 0 deletions compat-tool/check-percentages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/usr/bin/python3

import compat

def main():
versions = ['3.6','4.0','5.0','8.0','EC5.0']
keywords = compat.load_keywords()

totOps = 0
numOps = {}
numOpsSupported = {}

for thisKeyword in keywords.keys():
# get counts by mongodb version
totOps += 1
thisMongodbVersion = keywords[thisKeyword]["mongodbversion"]
if thisMongodbVersion in numOps:
numOps[thisMongodbVersion] += 1
else:
numOps[thisMongodbVersion] = 1

# get supported count by documentdb version
for docDbVersion in versions:
if keywords[thisKeyword][docDbVersion] == "Yes":
if docDbVersion in numOpsSupported:
numOpsSupported[docDbVersion] += 1
else:
numOpsSupported[docDbVersion] = 1

print("")
print("MongoDB Operations By Version, total = {}".format(totOps))
for thisVersion in sorted(numOps.keys()):
print(" {} in version {}".format(numOps[thisVersion],thisVersion))

print("")
print("DocumentDB Supported Operations By Version")
for thisVersion in sorted(numOpsSupported.keys()):
print(" {} supported by DocumentDB version {} ({:.1f}%)".format(numOpsSupported[thisVersion],thisVersion,numOpsSupported[thisVersion]/totOps*100))
print("")

print("")
print("DocumentDB EC Compat Check")
for thisKeyword in sorted(keywords.keys()):
if keywords[thisKeyword]["5.0"] == "Yes" and keywords[thisKeyword]["EC5.0"] == "No":
print(" {}".format(thisKeyword))
print("")

#print("")
#print("DocumentDB 5.0 Check")
#for thisKeyword in sorted(keywords.keys()):
# if keywords[thisKeyword]["5.0"] == "No":
# print(" {} from MongoDB {}".format(thisKeyword,keywords[thisKeyword]["mongodbversion"]))
#print("")


if __name__ == '__main__':
main()
Loading