Can nHibernate be used to access google cloud SQL server? - google-cloud-platform

We are porting our legacy application in nHibernate to Google cloud .
Can nHibernate be used to access Google coud SQL server in resilient manner?
There are separate NuGet package to access Google cloud Spanner from nHibernate. But I am not finding anything to access Google Cloud Sql server using nHibernate.

This is all about configuration. You need :
to specify the google clound connexion string in the NHibernate configuration.
the SqlServer driver nuget package
Everithing should works fine.

Related

How to integrate SQL Server logs with stack-driver console for a instance created in Cloud SQL?

I want to integrate google cloud stack-driver with SQL-Server (Express or Standard) created through Cloud SQL, so that the queries executed from a SQL client like management studio or sqlcmd or SQLPro will be displayed on the stack-driver console as logs. Is there any plugin which i need to install for this to be achived? Can this be achived natively without any third party tool?
Can anyone please give an idea?

Call Azure DB SQL stored procedure using web service, api, .. from mobile app

I am trying to build a mobile application that needs data from an Azure SQL DB. Best practice looks like building a web service in between.
However I am getting lost in the number of solutions.
Which specific Azure component do I need to use to have a future-proof solid solution?
How to handle security between this component and the Azure SQL DB?
How to handle security between the mobile application and the Azure Component?
The best way forward is to use an ASP.NET Web API with ADO Entity Frameworks and publish the API to an Azure website. Use REST services to call the Web Api from your mobile app.
So basically:
1) Fire up VS and build a Web Api that will handle your database using ADO Entity Framework and the controller for your API. Check this: http://www.tutorialsteacher.com/webapi/web-api-tutorials
2) Publish the Web Api to an Azure website/app through VS. Make sure you have Azure services installed on your VS.
3) Call the Web Api from your mobile app using REST services to work with the SQL database. You will need an HttpClient class to do this, you can get it from NuGet.
For security of your Web API, check this: https://www.asp.net/web-api/overview/security

.net web service deployment from iis to azure

I am quite new on web services and asp.net too. I created .net web service and deployed it on IIS. My web service takes some data from android and does some manipulation and store it in text files. Because I am working with localhost so there is no issue with storing data in text files. But now I am publishing this web service to azure portal now I am confused where my data will be stored? should I changed the path ? or what I have to do?
Local file system on azure cloud service may change so your data may be lost. Better to have the blob storage for storing file. https://www.simple-talk.com/cloud/cloud-data/an-introduction-to-windows-azure-blob-storage-/

django on google app engine with relational database

So is there any other way to use mysql database with django app on app engine? I found nice solution but it is not free - Google SQL Cloud seem to work great. But how about, moving django app to appengine and connecting to other hosting with mysql db? Or do you have any other solutions?
So to sum up - is there any way to work GAE with outside database?
Actually I have found the answer:
The Python Development Server in the Google App Engine SDK can use a locally-installed MySQL server instance to closely mirror the Google Cloud SQL environment during development.
More info here-> https://developers.google.com/appengine/docs/python/cloud-sql/developers-guide

Grails App with Multi Tenant Single DB plugin URL implementation in Cloudfoundry

I am currently creating a web app using Grails implementing Multi Tenant Single DB plugin. The plugin allows me to have multiple tenants on a single db using a tenantID to differentiate between tenants. The plugin detects witch tenant will deal the current request that is made on my app by resolving using different domains/subdomains for each tenant.
For example:
Tenant 1 = companyA.myapp.com
Tenant 2 = companyB.myapp.com
On my local machine running Grails development mode I was able to implement the different hosts by changing my /etc/hosts and each tenant would have their own subdomain.
I am currently interested in using cloud foundry as my cloud platform but when I deploy my app to cloud foundry it is already using my app name as the subdomain for cloud foundry.
For example:
- myapp.cloudfoundry.com
Is it possible to change or control the domain name resolver in
cloud foundry?
Does anybody know how to handle multi-tenant subdomains as explained above in cloud foundry? Probably provide the steps in implementing this using cloud foundry?
What is the best approach to implement this using cloud foundry?
My App is using Grails 2.0.4 and Multi Tenant Single DB plugin 0.8.2.
Thanks
Unfortunately the current beta version CloudFoundry does not allow modification of the cloudfoundry subdomain. The plan is to have the GA towards the end of this year with a private preview of the version of the site available sooner in the fall. At that time you could be able to customize the subdomain.
Therefore you might need to change a little in your TenantResolver to only check the subdomain that varies.
To implement your requirement, did you try installing the grails cf plugin? If not you can start from here.
If you are using cli, installing the plugin just needs command in your project workspace:
grails install-plugin cloud-foundry
When your app is ready for deployment, push it to cloudfoundry:
grails cf-push
Note that you will have to have your cf credentials configured in the grails config file.
After that you can map multiple URLs you want using:
grails cf-map user1.yourapp.cloudfoundry.com
If you have already known about vmc which is the client command line interface for cf, you can see the urls mapped with your app by
vmc apps
If not you can refer to the installation guide to start if you would like to do that.
If you are using STS/eclipse, things will be even easier. First you need to have grails-support extension as well as the cloud foundry integration installed. For detailed docs of the cf integration please refer here.
After your app is deployed, right click the project and choose "Grails Tools" -> "Open Grails Command Prompt". This will enable you to have same grails cf plugin commands as the CLI does.
Hope this can help your move forward in the cloudfoundry world. Let me know if you have more questions.
Thanks,
William