Robert_Ha 0 Posted September 9 (edited) Hello everyone, I'm new to the Cloud topic and how to connect my Delphi 10.1 dektop application to the "Azure Cosmos DB for MongoDB" Cloud-storage (NoSQL?). The MongoDB is set up by someone else and I have to connect to it, send and retrieve data in json format. In my understanding, the cloud needs a REST-API as interface to which I connect with my Delphi-App (because of security). I don't really understand with which component or class of Delphi 10.1 I can communicate with it. Can I use the "AzureConnectionInfo" and "AzureAPI" for all tasks? Do I need to use TRESTClient/Request/Response? Is the use of FireDAC reasonable for NoSQL? I'm lost here, because the documentation of Embarcadero is really short on that. Thank you very much in advance! Robert Edited September 9 by Robert_Ha Share this post Link to post
Pierce Ng 0 Posted September 10 You'd use a MongoDB client driver for Delphi. Here's a blog post I wrote talking to Azure Cosmos DB MongoDB using mORMot, which has a native MongoDB wire protocol implementation in Pascal. My code uses Free Pascal, but mORMot works with Delphi too. https://samadhiweb.com/blog/2023.03.04.mormot.azure.html Share this post Link to post
Robert_Ha 0 Posted September 10 Thank you so much for your input. But I dont think I can use open source code for my project because it will handle a lot of sensible patient data. Nonetheless I will definitly look into it. It would be great if there were some native delphi components which could handle the task. I read a lot about the Rad Server, but I'm not quite sure if it does all that I want. Share this post Link to post
Die Holländer 49 Posted September 10 On 9/9/2024 at 12:47 PM, Robert_Ha said: In my understanding, the cloud needs a REST-API as interface to which I connect with my Delphi-App (because of security). Creating a public endpoint What I understand is that it is not safe to publish the Azure database endpoint in your Delphi application. I still investigate if creating a public endpoint in Azure solve this. See link above.. Share this post Link to post
Robert_Ha 0 Posted September 10 23 minutes ago, Die Holländer said: Creating a public endpoint >>> That it is easy possible to use the azure database directly from a Delphi application I know because >>> I wrote an VCL application just doing this and the users are very happy with it. You wrote in your response in the other post that you achieved an easy connection and DB access. Do you have an example where I can start which the access? I'm lost which component to use and how to connect with it to the Azure Cosmos DB for MangoDB. Share this post Link to post
Die Holländer 49 Posted September 10 I'm using Azure MSSQL and that will connect just like a normal Server MSSQL using the Delphi Data Explorer. (View-ToolWindows-DataExplorer) Connect to MongoDB Database (FireDAC) Share this post Link to post
Die Holländer 49 Posted September 10 (edited) Mongodb with delphi 11.2 firedac https://github.com/grijjy/DelphiMongoDB Edited September 10 by Die Holländer Share this post Link to post
Robert_Ha 0 Posted September 11 Again, thank you for the information, you are a great help. I'm currently working through the material and trying to understand everything. I apologize in advance if more questions come up. Share this post Link to post
Die Holländer 49 Posted September 11 Please, if you find out some good things to know for other developers then come back here and add some solutions and info. Share this post Link to post
Robert_Ha 0 Posted September 12 (edited) Hi again, I'm struggeling to find a way to receive the pem files for the TLS/SSL certificates: (https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Connect_to_MongoDB_Database_(FireDAC)) SSLPEMKeyFile -- is the path name to the .pem file that contains the SSL certificate and key. SSLCAFile -- is the path name to the .pem file that contains the certificate from the Certificate Authority (CA). Do I need to buy them or is there a step by step guide which describes what I have to do from the very start? There are guides in the internet but I'm not sure if they explain what I need. Robert Edited September 12 by Robert_Ha Share this post Link to post
Die Holländer 49 Posted September 12 I can't help you with this question. Don't you need the PEM (Public) file from the server people? Isn't it possible to ask for the connect string from Azure at your database person ("someone else")? Like the example: https://samadhiweb.com/tags/Azure.html I believe, sometimes I see the Delphi database (FireDac) guru here on the form Maybe you can ask him about connecting the Mongo Azure database with SSL: Dmitry Arefiev Share this post Link to post