Home » Android » android – What happens if the Parse cloud data service fails?

android – What happens if the Parse cloud data service fails?

Posted by: admin June 15, 2020 Leave a comment

Questions:

I’m considering using the Parse cloud data service for my iOS/Android mobile app.

From what I can see from the documentation, my app would be highly coupled to the Parse SDK, which in turn uses the Parse REST API (I assume).

What measures can be taken to redirect the app to another service if Parse is down or if I no longer want to use Parse?

Ideally I would like to be tell the Parse SDK to use my own domain and redirect it to the Parse servers (how?). If Parse fails, I can change my DNS to somewhere else and attempt to replicate the Parse REST API (how?). Is this possible now? Is there a better way of preparing for this scenario?

How to&Answers:

parse.com seems to be down right now and I was just searching randomly online and found this post. Given I can’t work on my project now due to the outage, I will put in my 2 cents for this topic.

First of all, I am definitely not happy if my underlying service provider goes down, no matter that’s parse.com, AWS, rackspace or something else. However, that’s exactly the trade off we signed up for and in return we enjoyed the ease of development and shorten our development cycle from 1 year to something like a couple of months.

It’s dangerous for early stage startups to spend too much time and energy focusing on issues that are not the most important at the given point of time. Personally, I will not worry about parse.com being down as long as I cannot afford the time and resources to build and maintain my own database cluster. Obviously, it’s under the assumption that parse.com will still be up for most of the time, something like 99.9% 🙂

Answer:

The Parse support and sales team got in touch with me about this. Unfortunately they opted not to have a public discussion so I will paraphrase what they told me.

  • It is not currently possible to change the server url of the SDK. They’re not sure if this is a feature they want or not. (It should be noted that the server url is exposed in the JavaScript SDK and can be easily changed; search for api.parse.com.)
  • Using Cloud Code, you can build your own server API on top of Parse. The Parse SDK has a PFCloud that can be used to talk with Cloud Code but I couldn’t find any usage examples in the documentation yet. This is similar to what toadzki’s answer, but should be much simpler to implement.
  • They also offer custom server installations of Parse.

Answer:

To take the opposite view…

How big is your app and company? If you’re a lone ranger or a small outfit working on a smallish to medium app, the answer most likely is “Don’t bother”. Yes, in theory you could set up a system so that your app (or some infrastructure somewhere) redirects to a different cloud service, but the time and effort taken to do this, and do it well, is significant. Consider that even if you think you’ve implemented such a system, you’re then going to have to test that it works. Not really a simple task.

Mirroring the Parse API and then forwarding sounds simple, but the devil is in the detail. Especially for something like this.

Also, adding your own forwarding server is going to add a point of failure that will almost certainly be the weakest link in the chain. In short, don’t bother!

Answer:

As an alternative solution to toadzky solution you could make an interface to all parse methods on the device so you easily could switch Parse sdk out with your own custom implementation. In short make wrappers for all parse calls.

That said parse is very reliable and a lot of the functionality also works in offline mode. Also you’ll get error responses which you can handle in whatever way you see fit.

Answer:

If you want to route requests through your own server, do it. Have your server run the Parse SDK, not the device. Make your requests through your own custom API and repackage the request and forward it to Parse. This way, if you decide to change cloud providers, your app can still work without an update.