Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Jose Balaguer
Jose Balaguer
17,473 Points

Does a MEAN web application work well with native apps?

I'm in the full-stack JS track to develop a web app. It seems great to use NoSQL DB like MongoDB but I'm trying to figure out how it will work later if I develop native iOS and Android apps. I was wondering if the no-schema DB makes the stored data hard or even imposible to be accessed from the native apps. Thanks in advance.

3 Answers

Seth Kroger
Seth Kroger
56,413 Points

For getting to and from the server, that's accomplished relatively easily as there are a number of ways to translate back-and-froth from JSON to object. The tricky part is when you want to store/cache the data locally. You'd have to decide on using the native DB options, converting objects to the native DB format (and whether/which ORM to use to do it) or look for a NoSQL database engine of mobile and convert objects to that format.

Jose Balaguer
Jose Balaguer
17,473 Points

Thanks for your comment.

The cache part looks a nightmare to me :) I still have many to learn.

In the scenario "webApp + nativeApps", do you have alternative suggestions on language+DB (SQL or NoSQL)? I'm also learning Ruby on the side.

Seth Kroger
Seth Kroger
56,413 Points

Honestly, if your data is stored entirely on the server and doesn't need to be persisted locally on the phone/tablet/whatever you can stop reading my answer after the first sentence. For a lot of apps that's all that's needed. (see org.json and Gson for Android) The thing to remember is your data stopped being a NoSQL database object the moment it was converted to JSON and sent out by the server. This is as true for an Angular app as it is for a native app. How, and if you write it back out to local storage is up to you.

Jose Balaguer
Jose Balaguer
17,473 Points

Ok Seth, I'm begining to see where are you going. I really apreciate your comments. Thnx

Andrew Chalkley
Andrew Chalkley
Treehouse Guest Teacher

We're currently building a course called, REST API with Express which includes how to make a JSON api with Mongo db and Express :) Keep an eye out :)