[Question] Building my first App - general advice for starters needed

Oh wow, sometimes things can be so simple :smiley:
Never occured to me.

If notes donā€™t live alone and belong to the context of a task (perhaps) you can also consider joining notes to tasks as you join tasks to workspaces

1 Like

You know, thinking more about the MongoDB structure we talked about (about not having embedded documents), Iā€™m not so sure it makes a huge performance difference. Isnā€™t it worse to have references pointing to different collections, since you now have to make multiple successive DB hits to fetch data (rather than one atomic query)? Not to mention thereā€™s no transactions in Mongo, so you have to implement your own home-grown rollback system in case an update fails.

Update #4

Thanks to your advice. Helped a lot.
Since the concept of joining collections is completely new to me I went with Sanjoā€™s approach.

So now the data model looks like this:

Moving from two collections (notes & tasks) to only one (entries) ment rewriting quite a few things.
This made me realize how important it is to have a solid data model before you even start coding.

Changes

  1. Got rid of the notes & tasks collections
  2. Added the entries collection
  3. Added chronological order of tasks and notes
  4. Successfully corrected the feature to only show the input-field when a workstream is selected. (Thanks to Sanjo for the tip)

App-Status

Hereā€™s the current Version:
http://workstreams_v4.meteor.com/
(Tested in Chrome only)

Whatā€™s next?

  1. User Accounts
    Only played with the standard ā€œaccountsā€ packages so far.
    Building a customized login will be new to me. Probably taking a closer look at the ā€œuseraccountsā€ packages for that.
  2. Cleaning things up (css-stuff) + removing the insecure & autopublish packages.
    Heewā€¦ this should be fun.

Big thanks

Overall many thanks to all the advice from you guys.
I know itā€™s a small & simple app, but Iā€™m quite happy to see it coming together now :smile:

1 Like

I think task and note should be seen as subclasses of entry. I wonder why you needed to rewrite so much. The data model didnā€™t really change much.

I guess in hindsight youā€™re right. It just still felt uncomfortable to me to touch code that I already got running. :smiley:

Iā€™m working on the next update and things are coming along fine.

Question

To this I couldnā€™t find a solution:
When I have a lot of entries attached to a stream, there is a delay when I want to display/render them.

Itā€™s probably easier to understand, when you experience it yourself:

http://workstreams_v5.meteor.com/

Username: admin
Password: admin1234

Iā€™ve set up 4 streams with 10, 25, 50 and 100+ entries attached to them.

  • As you can see up to 50 entries render reasonably fast.
  • But when you click on the stream with 100+ entries, there is a delay of some seconds.

Is there a way around that?

Also I dont really understand why this should be happening.
All the entries are already there on the client, stored in minimongo, right? So why the delay?

Also:
There seems to be a tiny delay for any action. (e.g. checking of tasks)
Itā€™s not much, but a little bit slower than when I work locally.
Is that normal?
My understanding was, that changes (e.g. updates or inserts) should happen instantly on the client and then sync with the server in the background. (Optimistic UI?)

Happy for any kind of help in this. :slight_smile: