There are many ways to model a db for a simple task, but you will find at least one way that is the most efficient and the fastest.
For example: I have the following tables. User, Post and UserPost.
User
===========================
userId | userName
---------------------------
1 john
===========================
Post
===========================
postId | postContent
---------------------------
1 bla bla bla
===========================
UserPost
===========================
postId | userId
---------------------------
1 1
===========================
I think this is efficient in sql databases.
But what about Parse databases? Could you tell me what is the best option and how to get data using Java Android?
Option 1:
User
===========================
userId | userName
---------------------------
1 john
===========================
Post
===========================
postId | postContent
---------------------------
1 bla bla bla
===========================
UserPost
===========================
post | user
---------------------------
Post(pointer) User(pointer)
===========================
Option 2:
User
===========================
userId | userName | post
---------------------------
1 john | relation(Post)
===========================
Post
===========================
postId | postContent | user
---------------------------
1 bla bla bla | pointer(User)
===========================
Option 3:
User
===========================
userId | userName
---------------------------
1 john
===========================
Post
===========================
postId | postContent
---------------------------
1 bla bla bla
===========================
UserPost
===========================
postId | userId
---------------------------
1 1
===========================
So, the questions are: 1- What is the best way to model a Parse Classes for this simple task. If you have better solution, please let me know. 2- How to get specific user's posts in Android and Java (assume the user has 5k posts).
thanks