Mobile Backend solutions for your ionic apps

@djett I use Heroku to run a Ruby on Rails API. The only snag I ran into with this is supporting Cross Origin Requests https://github.com/cyu/rack-cors

I use ng-token-auth paired with devise-token-auth to support oAuth with Instagram.

Let me know if you have any questions. I am going to write a blog soon on how to set htis up.

2 Likes

Hi Guys, Iā€™ve actually been working on a solution that is a mixture of Parse/Firebase for Cordova and Ionic app especially. It would be really nice to hear what some of the features you guys think are key.

I liked drakee510ā€™s suggestion of having a high free limit and having the framework display interstitial ads and support of the backend costs that way.

What do you guys think?

2 Likes

Thanks, I have been doing alot of research and I think Iā€™m going to go with Amazon and the followingā€¦

  • Nodejs backend - Elastic Beanstalk with EC2
  • Elasticache (not sure redis vs memcached yet) for caching layer
  • Either DynamoDB or just mongo on the backendā€¦ still doing more researchā€¦ still havent ruled out RDS

I will be storing a little more data than originally thought, but still only about 1000 ā€œcategoriesā€ of data. Here is the example data and facts about my data that will ultimately help me make my decision.

  category1: {
    id: 'cat1Id', 
    name: 'name'
    displayName: 'displayName',
    items: [{name: 'item1'},{name: 'item2'},... {name: 'item70'}]
  }
  • Each category will have a json structure as shown above (each category will have roughly 20-70 items
  • Category Data can not be shared between categories (in other words, each item will only have one category)
  • I need to be able to search/query the category data, for example ā€¦ retrieve all category data and items NOT named item2
  • Another service will gather all reference data All categories, all items for all categories
  • The categories and/or category items will only be updated about once a month
  • Iā€™m not storing images/videos and donā€™t need an S3 bucket

Since a single item will only belong to one category, it probably just makes sense to just shove all the category data in key/value pairs in mongo or dynamoDB.

Then I could cache the query for all reference data, since it will only change about once a monthā€¦

I donā€™t know too much about dynamodb, but does anyone with AWS experience know if DynamoDb is wayyyy more than I need? Would I be better off just using mongo in my node backend?

Iā€™m trying to learn all the AWS services at once and its a little overwhelming lol so anyone with AWS experience, especially the data or cache layer, please chime in!! Thanks!!!

If you would like to do local storage, it is easy with javascript. Reply, and I can send you a short tutorial.

Even if the initial post mention nodeJS but didnā€™t say that want to be like that, I didnā€™t see anyone mentioning any Java Framework (Spring / Grail / Play / ā€¦). Why not ? Is-it because of the push function ?

I

@xiaolong97427 I think Java/Spring is too heavy for a simple mobile backend. I want to throw up everytime I think about going back to working with Spring task executors / thread pools / Java concurrency lol! Not to mention the extra work/annotations just to map JSON data to Java domain objects and back, and ORM solutionsā€¦ just seems like overkill for something that can be accomplished so easily in nodejs.

@djett Were you able to zero on the choice of technology stack for backend. I am writing a similar hobby app for the school, which stores less than 5000 json data records, and I want this to be independent of the ionic client app. The backend app exposes REST interface for the Data and Get and Put APIā€™s for the data. Any ideas on what to useā€¦

@rjain15 Iā€™m at odds lolā€¦ so Iā€™m trying to balance the KISS (keep it simple stupid) approach while also keeping in mind that I want a backend system I can easily scale and is robust especially since I work a 9-5. But right now Iā€™m thinkingā€¦

AWS elastic beanstalk/EC2 running a nodejs backendā€¦ Redis for cache/datastore (my data rarely changes so I can live with manual snapshots when metadata is updated)

Then if traffic increases down the road, could stick nginx in front for web cache.

I havent had the time to really dive into this stuff yet though so this may change. I am also going to re-evaluate parse

Parse looks pretty awesome.

Such a pity they have no Cordova / Ionic / Phonegap support out the box.

@nnnnnorthhhhh any idea if the features can all be taken advantage of in an Ionic app?

I havenā€™t gotten to push notifications yet, however, the best way to use it in a cordova/phonegap application is by utilizing the REST api that they have, then writing your functions in Cloud Code to give you the maximum security and the maximum flexibility. I believe I have seen a Parse push notification plugin however that is floating around.

I have used parse for my app and a different website, and so far, I donā€™t ever feel like switching to anything else. I think theyā€™re working on that side of things. The issue specifically with Ionic is that the Parse JS SDK is based off of a different javascript framework (I canā€™t remember if itā€™s Meteor or Emberā€¦) and so the model side of things doesnā€™t play very well. I still prefer the REST API since itā€™s a lot easier to integrate anyway .

2 Likes

I use Redis as a caching layer and itā€™s super fast and simple to use. Just remember to JSON.stringify(data) into Redis and JSON.parse(data) when getting data from Redis.

1 Like

Firebase Firebase Firebase

Hey guys,

is it possible to use firebase and s3 together. I need to store images and firebase can get pricy. Could I use s3 to store to store the images and save the url (from s3) to firebase as a string. And then call the url as needed from firebase?

Also could be the cost associated with this, I know that I would be paying for storage. But are there any cost when an image is loaded from a url (data transfer)?

Thanks

Hey Bob,

You should be able to use presigned Urls (http://docs.aws.amazon.com/AmazonS3/latest/dev/PresignedUrlUploadObject.html) so the file will go directly from your client/app to S3. Iā€™m about to start a Firebase project with S3 in mind as well. AWS is incredibly powerful but far more work to achieve similar levels of functionality out of the box with one of these BaaS.

Also Parse will be closed as of January 2017. So it seems Firebase winsā€¦ unless someone knows of something better?

W

How about AWS Mobile Hub? Anyone has used it?