The Front End application will use the firebase.com database. The application should work like a blog:
Admin adds / removes messages.
There is a "home" page that shows several articles on a page with the "Next" and "Prev" buttons and pages that show a separate article.
I also need deep binding. That is, when the user enters the URL http://mysite.com/page/2/ I need the application to display the latest articles from 10 to 20, when the user enters the URL http://mysite.com/page/20/ the application shows the latest Articles from 200 to 210. Normal pagination.
The main question is whether this can be achieved using firebase.com.
I read documents on firebase.com, I read messages here. "offset ()" and "count ()" will be in the future, use priority to find out the number of elements and not load all of them using an additional counter.
Based on this, I assume the following:
ADD POST action:
- get message counter value
- set priority for new message data equal to message counter value
- increase message counter value
DELETE POST action
- get priority value for post data
- request message data that have a priority value is higher priority for post-data to be deleted and reduced.
- decrease value for message counters
GET POSTS FROM x TO y
- postsRef.startAt (null, x) .endAt (null, y) .on (... etc.)
Things I don't like are actions for DELETE POST. Since the message index will be from 0 to infinity, and the post with the lower priority is considered to be the post that was created earlier, therefore, if I have 100,000,000 posts, and if I need to delete the 1st post, I need to load data for 99999999 of the following messages and update their priority (index).
Is there another way?
Thanks in advance, Konstantin
firebase
kostik May 18 '13 at 19:50 2013-05-18 19:50
source share