Announcement Announcement Module
Collapse
No announcement yet.
Best option for server based in memory data model with lots of calculations? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Best option for server based in memory data model with lots of calculations?

    I'm looking for some advice on the best option to store a data model in memory on a server which can be accessed and updated by multiple users.

    The problem domain is a type of hierarchical project/task model where tasks have durations, start/finish dates, dependencies etc. Changing any task level value would require an update of lots of sibling tasks and parent projects.

    Individual users would be updating task level entries, and perhaps locking tasks and projects.

    Suggestions?

  • #2
    Why not calculating the changes on demand, when they are asked for?

    I'm of course biased but workflow like datamodels as you described with dependencies and also connected users, tasks, categories and responsibilities are rich, highly connected data that is a good fit for a graph database. Have a look at Neo4j and Spring Data Neo4j and create a small PoC to see if it fits your needs.

    Or reply and we can discuss it in this thread.

    Cheers

    Michael

    Comment


    • #3
      The calculations will be on demand.

      For the sake of this discussion assume that the data model is a type of project gantt chart, where subordinate tasks are linked and have various starting and finishing dependencies. One basic requirement will be the need to support different planning scenarios, where for scenario 'A' the tasks have one set of inter dependencies, and for scenario 'B' a different set. The calculation engine has to review all the tasks to determine overall project timelines, costs, critical paths etc.

      The user will have the ability to change any task level detail and/or dependency in any of the scenarios with a desire to see the top level results across all scenarios in real time.

      Comment


      • #4
        I've had a skim read of the Neo4J web site, would you be able to help me out with a quick explanation of how the following data model would be represented in Neo4J?

        A 'Project' has a collection of tasks
        Each task may have a fixed or floating start or finish date
        Each task's starting date may be dependent upon the finish date of other tasks - there could be multiple other dependent tasks

        Comment


        • #5
          Projects and tasks would be Nodes, both can
          Tasks have either start/end-time properties, or if not they will be derived from dependant tasks.

          The project could have a relationship to all tasks or just to the start (or end)-task, acutally the project could just be different projection of the start task.

          The relationships can have additional properties, e.g. when a task was added to the project etc.

          The task will have a DEPENDS_ON relationship to other tasks. All the outgoing relationships of this type will form the tasks depending on the current one, all the incoming will be the tasks that the current task depends on.

          Then your model can of course also contain the people that are responsible for tasks, any facilities, documents, resources involved (and their relationships).

          Some simple Spring Data Neo4j Code for that:

          Code:
          @NodeEntity
          public class Project {
            String name;
            @RelatedTo(type="")
            Set<Task> tasks;
          }
          
          @NodeEntity
          public class Task {
            String name;
            Date start;
            Date end;
            int duration; // in hours
            @RelatedTo(type="DEPENDS_ON", direction = Direction.INCOMING)
            Set<Task> predecessors;
            public Date getStart() {
                if (start!=null) return start;
                Task lastPredecessor=Collections.max(predecessors,new Comparator<Task>(){compare(Task t1, Task t2) { return t1.getEnd().compareTo(t2.getEnd()); });
                return lastPredecessor.getEnd();
            }
            public Date getEnd() {
                if (end!=null) return end;
                return new Date(getStart().getTime() + TimeUnit.HOURS.toMillis(duration));
            }
            @RelatedTo(type="DEPENDS_ON")
            Set<Task> successors;
          }

          Comment

          Working...
          X