Starts in:
3 DAYS
2 HRS
21 MIN
57 SEC
Starts in:
3 D
2 H
21 M
57 S
Open Closed

Database Migration #8253


User avatar
0
ked_1x0 created

Hello ABP Team Support,

We are currently using MongoDB as the primary database in our ABP-based application, but we are considering migrating to SQL. Our goal is to ensure data consistency, maintain performance, and leverage SQL’s relational structure within the ABP framework. Given ABP’s architecture, we’d like your guidance on the following points to help facilitate a smooth transition:

Configuration Changes:

  • What specific configuration changes are required to switch from MongoDB to SQL, especially in terms of module dependencies and database provider settings?

Entity and Aggregate Adjustments:

  • Are there recommended steps or best practices for adapting MongoDB-specific entity structures and nested documents to fit SQL’s relational model within ABP?
  • Are there specific changes we should make to our domain-driven design aggregates or ABP's default repository structure to accommodate SQL?

Data Migration Tools and Approach:

  • Does ABP provide any built-in tools or guidance for handling data transformation and migration from MongoDB to SQL, particularly for large datasets?
  • Are there recommendations for ensuring data integrity and consistency during this transition, especially when it comes to ABP’s built-in soft deletes, auditing, and other shared features?

Repository and Dependency Injection Adjustments:

  • If we switch from IMongoRepository to IRepository (or similar SQL-based interfaces), will we need to make specific adjustments to our dependency injection configurations?
  • Any best practices for implementing these changes without significantly impacting application performance or existing functionality?

Testing and Validation Suggestions:

  • What are ABP’s recommended strategies for testing and validating the application’s CRUD operations, queries, and transactions post-migration?

Any additional guidance or resources ABP could provide would be greatly appreciated. We want to ensure the migration is as seamless as possible and that our application maintains its current functionality and performance.

Thank you for your support!


1 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi https://abp.io/docs/latest/framework/data/entity-framework-core/other-dbms

    What specific configuration changes are required to switch from MongoDB to SQL, especially in terms of module dependencies and database provider settings?

    You can create a new project to compare them.

    Entity and Aggregate Adjustments:

    Usually you don't have to worry about table generation, because ABP uses code first, and you can generate database tables through entities

    Data Migration Tools and Approach:

    there are no such tools. you must migrate all data manually. You don't have to worry about soft deletions, they are done by the framework

    Repository and Dependency Injection Adjustments:

    you can change to IRepository interface without any problem. You don't have to worry about it, EF Core usually generates good SQL.

    Testing and Validation Suggestions:

    We recommend using unit tests, if you have complete unit tests, then just run them to make sure the tests pass. if not, you can consider manual testing or writing unit tests

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06