Using Postgres with Parse Backend

Facebook killed parse last year, but thankfully they Open-Source the parse backend. Initially, the Parse Backend only supported MongoDB database, but later support for  Postgres has been added by the contributor from the community.

So using Postgres with Parse Backend is really quite simple, you just have to install the latest version of Parse Backend, and in the databaseURI specify the Postgres connection string.

Here is an example:

var ParseServer = require('parse-server').ParseServer;

var api = new ParseServer({
  databaseURI: 'postgres://postgres:pass@localhost:5432/parsedev' // Connection string for your Postgres database
  cloud: '/home/myApp/cloud/main.js', // Absolute path to your Cloud Code
  appId: 'myAppId',
  masterKey: 'myMasterKey', // Keep this key secret!
  fileKey: 'optionalFileKey',
  serverURL: 'http://localhost:1337/parse' // Don't forget to change to https if needed
});

 

As you can see in the example above we have specified the connection string to connect to the Postgres database.

If you are not familiar with the structure of the connection string, then here is the breakdown.

"postgres://<Postgres Username>:<Postgres Password>@<DB Host>:<Port>/<Database Name>"

If you have any question, please leave the comment below.

 


Posted

in

by

Tags:

Comments

One response to “Using Postgres with Parse Backend”

  1. Ray Johnson Avatar
    Ray Johnson

    Just wanted to share my experience with selecting a mobile backend for my app. I used to run my applications (I have several in the app store(s)) on Parse and was pretty happy with the backend until Facebook decided to shut down the service. After that I have evaluated all listed options and was not happy with any of them for various reasons. Firebase was not a good fit because the of their approach with JSON document being a database – I did a stress test with million nodes in the tree and the service was not performing well. AWS and Appery are quite complex and become expensive very quickly while Azure and CloudMine are quite limited in the capabilities. Kinvey is both limited and super expensive once you start doing something more serious in the app. In the end I chose Backendless (https://backendless.com) for my backend. The service has native SDKs for all major mobile and web platforms. The usability and developer experience is by far the best I have seen. The service has an extremely flexible server-side code model where I can deploy Java and JS server-side code to override default handling of the API and to create my own API services. My apps leverage social (Facebook, Twitter, Google) login, geolocation, file upload/download, push notifications (iOS, Android) and of course data persistence, which has really awesome support for complex relations. Check it out if you are looking for a flexible and very reasonably priced backend.

Leave a Reply

Your email address will not be published. Required fields are marked *