Search code examples
node.jsredismodels

Guidance on how to structure models on a node.js server?


What are some good ways to structure models and store on a node.js server?

How should I listen or manipulate these models? Are their libs for helping with this type of stuff?

I'm just looking for some general guidance and good approaches.


Solution

  • // Model.js
    var Model = {
       ...
    };
    
    module.exports = Model;
    

    Just organize it like you normally would.

    Generally models contain domain specific code and are a wrapper around some kind of data store.

    A data store should just be a wrapper around a table / database based on your noSQL store of choice.