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.
Related
I have an existing web application that's developed with Ruby on Rails and PostgreSQL. I need to create a mobile application (and possibly a separate web application) using the data from that web application, so I'm looking to create an API server. Is it possible to do this without altering the source code from the original Rails/Postgres web application?
Any ideas on the best way to do this? Or can someone point me in the right direction on what to research?
To connect a new application hosted on Heroku to a PostgreSQL database hosted on Heroku just push your new application to Heroku as normal.
Then, under Settings on your new application dashboard, go into Config Variables and add a new config for DATABASE_URL. Put the value of the url for your existing database.
Your new application will need to be under the same account as your existing application. Heroku doesn't allow you to connect across accounts.
You probably want to take a look at this question for additional details.
Sounds like essentially you want to have two applications connecting to the same database offering the same methods, but respond in different formats (html vs, for example, json). One way of doing that relatively easily might be pushing another api only Rails app to heroku that connects to the same Postgres database (which was mentioned in the comments), but you would have to figure out how to handle authentication differently for your API end points. This depends on whether you are exposing these end points to the public or to something like a mobile front-end. You may want to switch to token-based authentication if you were formerly using sessions on the web-app. Once you implement secure authenticatoin for your api routes, all you have to do is make sure your methods, instead of rendering erb or haml templates, are returning raw data consumable by your intended client.
I am running a site right now with a quite big MySQL database.
Now, I want to create an app. I will need to use obviously a database de to the fact my data are already there.
Thus,
1) Should I keep using the MySQL server and my iOS app will connect to this MySQL serve for getting data?
2) is there any problem if I use the MySQL server ? Security issues maybe?
3) if I have to change the MySQL server, what database infrastructure I need to build and work with?
I am totally newbie on iOS apps. And now I planning to face any issues my iOS app will have.
Since you are running a site with MySQL I think a lot of your questions have been answered. You already have seen how your MySQL database performs in a production environment. Unless you believe that your iOS user base is going to be much larger or perform very different functions you currently have valid performance benchmarks.
In terms of how it relates to the iOS app, you can build an API, or make calls to https pages on your website that will return the information required for your app. For information on how to do this, check out this AFNetworking tutorial.
In the end, there might be some reasons that your current database isn't the right choice for your app. But since the app won't be interacting directly with the database, you can change it out later and you will only have to integrate the database with the interface and not change the iOS app at all.
I am relatively new to iOS development and part of the application I'm developing requires a database of users which holds information about each user. Is there a tutorial out there that can show me how to create a database and link it with my iOS app? If not any sort of explanation would work.
First, if you want a DB to connect to, you'd need 2 things: A DB server and a Webserver to open it through webservices. Since you are new, I'd suggest you set up a LAMP server (Linux, Apache, MySQL, PHP) or a WAMP server (Windows, Apache, MySQL, PHP).
For WAMP and LAMP, I suggest you install each module separately but there are packages with contains the all the modules.
http://tenfouragency.com/setting-up-a-wamp-local-server-on-windows-7/
First, you'd need to create the DB in MySQL: https://dev.mysql.com/doc/refman/5.1/en/database-use.html
Second, you'd need to open it through webservices in Php: https://web.stanford.edu/dept/its/communications/webservices/wiki/index.php/How_to_connect_to_a_MySQL_database_with_PHP
Third, you would need call your webservices through the app: http://blog.strikeiron.com/bid/63338/Integrate-a-REST-API-into-an-iPhone-App-in-less-than-15-minutes
This is a fairly big endeavour for someone that's just starting out so I'd advise you just do these things one step at a time. This is also a very basic overview so I suggest you use the terms and concepts I use (such as webservices) to further your own research into these topics.
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#
I'm building a Rails 3 application that I plan on provided as a subscription-based SaaS (Software as a Service) product. Basically, I want users to be able to hit my "Sign up" page, create a new account, and immediately start using the software.
A good example of what I'm trying to accomplish is: http://www.getharvest.com/
Here's what I need to happen when someone signs up:
A MySQL database for them is generated on the db server
A sub-domain is created (e.g., companyx.awesomeapp.com)
The Rails app should know the appropriate database to connect to based on the sub-domain
Are there any good guides out there for setting this stuff up? Even better, are there services that you can purchase to automate this type of thing? Ideally, I'd like to just worry about writing my Rails app and then be able to plop it atop some awesome Rails SaaS infrastructure.
(Also, I need a way to bill them monthly, but I think that's a separate question/problem.)
Heroku would let you get up and running quickly. You can manage the infrastructure using the heroku gem. Here is the documentation to the client which should allow you to manage heroku applications remotely. Using heroku would allow you to scale applications on an individual level and let you focus on the code of the application instead of the hardware.