Heroku, Rails and Remote Microsoft SQL Server - ruby-on-rails

first i would like to say that I have done research and know that the following is "possible"--I was hoping to find folks with real-world experience with this setup to see if I "should" do it this way.
So, I have a Ruby/Rails web app that i've developed that links directly to Microsoft SQL Server 2008R2 on a private network. I'm trying to decide whether to deploy to Heroku or simply build a local Ubuntu web server. I'd prefer to use Heroku, however am concerned that connecting to a remote Microsoft SQL Server may be too much trouble. I have full access to network equipment, firewall, IP addresses, routing, etc.
Currently my app uses TinyTDS and activerecord-sqlserver-adapter to connect from my local dev machine and works like a charm. I'd love to use Heroku (ok with paying for it)--but how stable and/or supported is this feature? Could I use a free SSL cert to encrypt data travelling over the internet? And, would I need to purchase an add-on for Heroku to get a static IP for my site to properly secure traffic coming to my firewall?
I'm totally willing to put in work to make it run on Heroku...but I don't want to use unreliable or unsupported (or insecure) hacks...in this case I'd just deploy locally to Ubuntu.
Thanks!

Found the answer at this awesome link! Heroku running Cedar, connecting to an MS SQL Server accessed remotely! Please read my comments and the author's after following the link for more info. Overall I chose not to host this particular app on Heroku but still great to know that this was possible.
This article by Michiel Sikkes uses Heroku's newer buildpack feature to use TinyTDS and connect remotely to SQL Server 2008 R2. I'm still investigating how I could encrypt traffic. Hope this helps others!
http://blog.firmhouse.com/connecting-to-sql-server-from-heroku-with-freetds-here-is-how-on-cedar#

Related

What should I use to connect a rails app with remote servers?

I am using a ruby on rails app which goal is to handle lockers reservations by users and be able to unlock them using a smartphone.
The rails app is hosted on heroku (free plan), and I use several raspberry pi as remote servers that control opening of lockers.
So far, it works with HTTP requests from the app to the raspberry through a free http ngrok tunnel, but this is limited to a few requests per minute, and the connection is not secure/private at all, so it is not really what I need.
What type of solution would you recommend to ensure a more secure connection between the app and remote servers with no request number limitation ? I have a few concepts in mind, but I don't understand them well enough to know what I should look into. VPN ? SSH ? Web sockets ? Should I still use heroku ?
Thanks a lot guys!
You could achieve what you want with all technologies you listed above but I think using web sockets would simplify the setup process and it also seems to be the most robust.
Have a look at this client for your Raspberries.
To get the server to work you'll need a redis instance, which heroku offers in their free plan so you can keep it there. Your server app will need to use something like ActiveCable or faye.

Is there a way to setup SSL on heroku-godaddy using letsencrpyt entirely for free?

I've been an amateur developer for quite some time now and this is the first time I've actually needed to set up the domain and SSL for a website. I already bought a domain name from GoDaddy and I'm using my rails as my backend. But it seems that on almost all of the guides online (the ones I've come to search) is for the Heroku paid dynos (I'm on the free tier) or has their website hosted somewhere else/bought the domain somewhere else. As of now, I'm not actually sure how straightforward this should be but any guide to free SSL cert generation and free setup would be nice.
You have 2 options here:
Use Heroku domain app.herokuapp.com as this is encrypted and served through https.
If you want to use a custom domain. There is no way but to use a paid dyno. There were some tutorials on how to do this manually and a couple of projects that allowed you to do so on free dynos but they are all outdated/deprecated.
There is no need to configure anything on Heroku's side if you start off with a paid dyno.
ACM is enabled by default for all Common Runtime apps created after March 21, 2017 that run on Hobby or Professional dynos.
To upgrade, simply run heroku ps:resize web=hobby via heroku cli. Then, to enable letsencrypt automated certificate, simply run heroku certs:auto:enable. Just make sure your DNS is activly pointing to the currect address before doing so or you'll need to verify your DNS target.
Docs: https://devcenter.heroku.com/articles/automated-certificate-management
deprecated project: https://github.com/dmathieu/sabayon
outdated tutorial: https://github.com/dwyl/learn-heroku/blob/master/SSL-certificate-step-by-step-setup-instructions.md
I have used the same setup for my heroku app. By default heroku free tier gives ssl on your web app.
Like if you hit url yourwebsite.herokuapp.com, it is encrypted and provides ssl for free.
But when you will add a custom domain name to your heroku app, then its without ssl. You cannot use ssl on it unless you moved to hobby dyno(paid)
Here is what heroku says

Basics of running multiple internal ruby/rails apps on an IIS server - is something like passenger required for this situation?

I am going to be deploying about a dozen rails apps on an IIS server. These apps are behind out firewall for internal use only. They will all be low usage but critical apps.
The current setup is
IIS running on server 2012
Rails 4 is running on iis installed via the webplatforminstaller.
We will be using MS sql server
Apps uploaded from the laptop to the server do run.
There will be about 15 apps running. We can add another server if necessary.
Nothing else will be running on that server
E.g. an app might be located in c:\inetpub\wwwroot\apps\sales and another in \hr. etc.
What I've read about deploying multiple rails apps seems to be geared toward public facing sites. I don't see much about private sites using a server ip/folder setup
Question:
- Can multiple apps be run without adding a tool such as passenger?
It is possible using the IIS HttpPlatformHandler extension. Scott Hanselman did a good write up on it that explains how to use it.
Although, in that blog post it's suggested to use JRuby and Tomcat. I don't think that is necessary, however I would suggest using puma as your webserver.

AzureWorkerHost get the uri after startup for Neo4jClient

I am trying to create a ASP.Net with neo4jclient project to be hosted on the Azure and am kind of unable to grasp how to do the following:
get hold of an neo4j rest endpoint address once the worker role has started. I think I am seeing a different address each time the emulator spins up a instance of worker role. I believe that i'll need this to create an client somewhat like this
neo4jClient = new GraphClient(new Uri("http ://localhost:7474/db/data"));
so any thoughts on how to get hold of the uri after the neo4j is deployed by AzureWorkerHost.
Also how is the graph database persisted on the blob store, in the example its always deploying a new instance of pristine db in the zip and updating, which is probably not correct. I am unable to understand where to configure this.
BTW I am using the Neo4j 2.0 M06 and when it runs in emulator, I get an endpoint somewhat like this http://127.255.0.1:20000 in the emulator log but i am unable to access it from my base machine.
any clue what might be going on here?
Thanks,
Kiran
AzureWorkerHost was a proof of concept that hasn't been touched in a year.
The GitHub readme says:
Just past alpha. Some known deficiencies still. Not quite beta.
You likely don't want to use it.
The preferred way of hosting on Azure these days seems to be IaaS approach inside a VM. (There's a preconfigured one in VM Depot, but that's a little old now too.)
Or, you could use a hosted endpoint from somebody like GrapheneDB.
To answer you question generally though, Azure manages all the endpoints. The worker roles says "hey, I need an endpoint to bind to!" and Azure works that out for it.
Then, you query this from the Web role by interrogating Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.Roles.
You'll likely not want to use the AzureWorkerHost for a production scenario, as the instances in the deployed configuration will destroy your data when they are re-imaged.
Please review these slides that illustrate step-by-step deployment of a Windows Azure Virtual Machine image of Neo4j community edition.
http://de.slideshare.net/neo4j/neo4j-on-azure-step-by-step-22598695
A Neo4j 2.0 Community Virtual Machine image will be released with the official release build of Neo4j 2.0. If you plan to use more than 30GB of data storage, please be aware that the currently supported VM image in Windows Azure's image depot must be configured from console through remote SSH to Linux.
Continue with your development using http://localhost:7474/ and then setup the VM when you are ready for a staging or production build to be deployed.
Also you can use Heroku's free Neo4j database deployment but you must configure the basic authentication for your GraphClient connection in Neo4jClient.

VBA Heroku integration?

I am wondering what might be involved in connecting an Excel VBA application to the hosted database behind a Heroku Ruby on Rails application. Is this possible? My application cannot accomplish all of the functionality I need in the cloud only. The VBA application would be used as part of a system to print and encode proximity "smart" cards. Thank you for any and all tips on how best to implement this.
Number of options here depending on how you want to connect. I would consider exposing an API in your Heroku app that your VBA could consume (if possible).
Failing that;
The present Shared Database won't let you connect directly to the database so that's a no no.
The new beta shared postgres 9.1 (https://postgres.heroku.com/blog/past/2012/4/26/heroku_postgres_development_plan/) will let you connect to it from outside.
Use one of the Heroku DB addon providers such as ClearDB which is a mySQL provider which allows direct access to the database.
Bring your own database which you could host on an external server and have your Heroku app connected to it (watch out for latency) and then you can connect your printing app directly to that Db.

Resources