Home What are the advantages of Core Data over Firebase realtime database when offline mode is activated?
Reply: 1

What are the advantages of Core Data over Firebase realtime database when offline mode is activated?

BB119
1#
BB119 Published in 2018-02-14 08:08:56Z

My question might seem a bit naive, but as a beginner iOS developer, I'm starting to think that Core Data is replaceable by firebase realtime database (or firestore in the future). I used both of them in two seperate projects and after activating the offline feature in firebase, I got the same results (that is, the data was saved to the device without the need for an internet connection). I think I read something in the firebase documentation about it not being able to filter and sort at the same time which would probably mean that Core Data can be more convenient for complex queries. It would be great to have some senior developers' views on this subject. Thanks in advance.

Jay
2#
Jay Reply to 2018-02-14 17:54:43Z

The question is a bit off-topic for SO (IMO) and is (kind of) asking for opinions but it may be worth a high-level answer. I use both platforms daily.

Core Data and Firebase are two unrelated platforms used to (manage and) store data; it's hard to directly compare them without understanding your use case.

CD is a framework used to model objects in your app. It's the 'front end' of data storage, where the 'back end' could be SQL, flat files, plists etc. It's more of a single user concept which stores data locally on the device (it has cloud functionality but that's a different topic).

Firebase on the other hand is a live, event driven, cloud based, multi user capable NoSQL storage. While it offers off-line persistence, that's really for situations where you need to be interacting with data when the device is temporarily disconnected from the internet.

It is not correct that:

firebase documentation about it not being able to filter and sort at the same time

But, your Firebase structure is dependent on what you want to get out of it - if it's structured correctly, it can be filtered and sorted at the same time in a variety of very powerful (and faaast) ways.

Core Data is really an incredible technology and building relationships between objects is very straight forward and has SQL-like queries for retrieving data.

If you are looking for a database that leverages local storage - go with Core Data or another database that's really strong locally such as Realm, MySql and a number of others.

If you want to have Cloud based, multi-user, event driven storage, Firebase is a very strong contender (Realm is another option as well)

I would suggest building a very simple To-Do type app and use Firebase for storage in one and then build another using Core data. Should only be a couple of hours of work but it will really give you some great basic experience with both - you can make a more informed decision from there.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.294788 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO