Database selection
Opened this issue · 12 comments
Any suggestion for the database to go forward with?
As per the feature discussion #1 I think the plan is to implement local on storage using IndexedDB for the MVP. After that I think the plan was to use Firebase to sync over the network.
How do you feel about that? Did you have some other ideas?
ok i thought indexdb is for the caching part, when service worker is fetching data from the server, there must be some sort of data taken from somewhere eg API or something which in the end come from some sort of database.
Yeah IndexedDB is only for local storage of course. I think the plan was to make the MVP local only, but it doesn't matter too much since we have plenty of time. As I said, my vote is for Firebase since it's a 'database as a service' so we wouldn't have to set up a database server ourselves.
Ok i will give firebase a read. So if this is the case, we cant really implement service worker on MVP since latest update from other user of the list is not save anywahere right
If you look at Issue #1 , it describes the process. Right now we are implementing Phase 1 (MVP).
Service workers are planned for Phase Two:
Make the app into a PWA (connectivity independent, progressive, responsive)
- create the app shell
- set up service worker
- cache files in local storage
Whichever phase we implement service worker in, we can use it with or without firebase. Essentially if we implement a todo list using IndexedDB for storage, and then cache all the application HTML, CSS and JS using a ServiceWorker, then we have created an entirely offline todo list app.
After that Firebase would allow us to keep the todo list synced up between devices when they are online. Of course, there is an issue of conflict resolution to be considered later.
@zk433 I think there's actually no harm moving service workers to phase 1. The basic service worker that simply caches application assets is pretty easy to make. I might have a code at this code tonight, complete with version 0 of the cache. Once we have a real UI, CSS and font assets we can bump to version 1.
Or we can just merge MVP and Phase Two into one. Since you are almost there anyway.
Can we do it together, though? Right now you are doing everything and you are very fast! 💯
Sorry @zk433, just got a bit excited. I will hold off on the service worker for now in case someone else wants to work on it!
Ok sorry for not being alligned on the understanding. This is what i assume about group todo list. It is a todo list for a group of people using it together like trello. So let say when user 1 update something, user 2 will get the update when user 2 access the app. So in this case the mvp need to have a proper server database to be usable.
So if our todo list is just for personal use the database may not be needed. But then maybe there will be no service worker waiting to update like one of the example we did in the course
Sorry again for the distraction. I just need some clarification on the architecture so i can dig the right info to consume😂
I think we decided to make a single user todo list first to keep the scope small. But it doesn't really matter what order we do things in. So if you want to start looking into sync options now that's great. I think the biggest question to answer, though, is what happens when two users modify the same todo while offline. Perhaps it could show up as conflicted and there could be a separate UI for conflict resolution.
This is the main reason why I was unsure about sync for the MVP, because this issue is pretty tricky. But even if it's not MVP worthy there's nothing stopping you building this feature in a separate feature branch to be merged later. Certainly researching and working on this would not be wasted time.