I'm writing a small analytics app in Javascript and want to store data in a database. Since I am new to salesforce I can't figure out the best way to do this:

  • a normal DB such as heroku (postgresql)
  • database.com (couldn't find much on how to access via JS)
  • force.com ?
  • APEX ?

Thanks for pointers.

Update: For now all the javscript is inside the code of the Home Page component.

  • If you don't have much use for CRM and would like a Postgres db, Heroku might be a better match. With salesforce you get a built in database and the Force.com platform to build apps. Commented Nov 4, 2012 at 19:49
  • @techtrekker thanks, it's a requirement to track usage of salesforce.com. Because the app needs to go into the appexchange I want to store the data as "close to salesforce" as possible, so I will look at Heroku!
    – Cilvic
    Commented Nov 4, 2012 at 19:53
  • The database.com API is identical to the Force.com API.
    – metadaddy
    Commented Nov 5, 2012 at 5:14

1 Answer 1


Normally you would want to do this by sending data via a REST call to your salesforce, you can create your own REST API functions in apexrest more about that here: http://www.salesforce.com/us/developer/docs/apex_rest/api_apex_rest.pdf In these apexrest functions you would handle the incoming data, store it in the database, do calculations, ...

The problem you have there is, you can't do cross domain rest calls, a solution here is either do the call from your webserver backend (via PHP or something else) or you include your javascript file directly from your salesforce.com domain where the rest call is being send to.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .