Starts in:
2 DAYS
4 HRS
23 MIN
28 SEC
Starts in:
2 D
4 H
23 M
28 S
Open Closed

Update ABP Cli for Microservice Template to support MongoDB #2862


User avatar
0
hakan.uskaner created
  • ABP Framework version: v5.2
  • UI type: Blazor-Server
  • DB provider: MongoDB

I use the microservice-pro template v5.2 which uses as DB EntityFramework. Is there a reason why its not possible to choose the DB provider like in other templates with abp cli (-db mongodb)? In our production enviroment we gonna use azure cosmodb for all databases, so instead of mixing different db providers it should be possible to switch/create directly for all mongodb. with abp cli. Or is there a good reason not to do soo ? Also an example based complete on mongodb with the microservice template would be great.

I did try you document: https://docs.abp.io/en/commercial/latest/guides/microservice-mongodb

But it doesn't seem to match to the current v5.2. It would be great if you could update that as soon as possible. Currently i have errors with ProductServiceDatabaseMigrationChecker etc.


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

    Hi,

    You can check this project: https://github.com/abpframework/eShopOnAbp

    It is a microservice that uses EF Core and MongoDB.

  • User Avatar
    0
    hakan.uskaner created

    Hi,

    i know eshopOnAbp.. the question is if there is a reason, why the abp cli doesn't support the - db mongodb parameter with the microservice template ?

  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    Hi,

    i know eshopOnAbp.. the question is if there is a reason, why the abp cli doesn't support the - db mongodb parameter with the microservice template ?

    Hi @hakan.uskaner,

    We thought about that and decided to create a sample (in eShopOnAbp) about how to do it instead of adding it. Mainly because as an initial template, It would be an extra bunch of files confusing developers when they won't be using most likely.

    However, generating templates with different db-providers is a bit more complicated process and we have it on backlog however we have not decided scheduled milestone for implementation.

  • User Avatar
    0
    hakan.uskaner created

    It would be great if you would implement that hopefully in near future.

    I can work with the current microservice-template and infos from eshoponabp, but its still a valid business case. In production enviroments you could use multiple db providers, but you dont need to. For our purpose we did not find any issues or performance problems in using one db provider like cosmosdb. We did start with entity Framework, did some testing and switched to mongodb after that. Also you could use for all an other provider like postgres sql.. So from my point of view it would be great if you could add that parameter for the microservice template. I know this will take time..

    Meanwhile you could update your document for switching the microservice-template to mongodb ab v5.2.

  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    Thanks for your feedback.

    Meanwhile you could update your document for switching the microservice-template to mongodb ab v5.2.

    We are also planning to provide some code-base for new microservices by developers to use mongodb.

  • User Avatar
    0
    hakan.uskaner created

    Hi @gterdem, any plans when this will be available or at least on your roadmap ?

  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    I can not give time for the suite or the cli support to something like abp new OrderService -t microservice-service-pro --db mongo yet. However, we are preparing some commented code-base for MongoDB integration to db migration and seeding for v5.3. The microservice provider changes had to be done manually at the moment.

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