Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8695771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:07:03+00:00 2026-06-13T01:07:03+00:00

I am developing an application whose front-end is built using jquery mobile. This application

  • 0

I am developing an application whose front-end is built using jquery mobile. This application requires database access to fetch various information. It will also need to update the database.

To sync my application front-end, I am thinking of using node.js as a middle tier. The choice of node.js was made because we want it to scale properly. This middle tier will serve the front-end with all the required data that it needs. It will also receive data from the front-end and update the back-end database.

The problem is the data that will have pretty complex structure and relations. Converting the data model to and from plain JSON by hand can become a real pain. So I was thinking of using some other module/framework also. I tried with Jaydata so that I can form data models and then expose them using OpenData protocol, but the documentation of it seems to be lacking. I also though about using Sequelize but I think it doesn’t have pretty good support for database at this point (triggers, procedures and all).

So what can I use at this point to fulfill my requirements? Is there any node module/framework which fulfills my requirements or do I have to use raw code to fetch data from the back-end, convert it to proper models and serve them?

I am using Postgresql as my back-end database. For the time being my front-end is made using jquery mobile but I may choose to use different technology (PHP/ASP.NET) to build it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T01:07:05+00:00Added an answer on June 13, 2026 at 1:07 am

    UPDATE: there are a lot of improvement with JayData Server for the NodeJS platform, for example navigation properties are supported with MongoDB now. Also using the system is super easy now, read more on how to set up your own MongoDB back middle tier server.

    You could indeed use JayData for that, provided that it’s limitations are within your acceptance range:

    • On the server side JayData runs as a NodeJS package and supports sqLite and mongoDB. With 1.3 coming in January mysql and MSSqlServer support will be added. JayData actually exposes the server side database as an OData V2 compliant endpoint with V3 support coming in January.

    • SqLite has navigation properties but mongoDB has performance. For production size implementation only mongoDB is the viable way. The limitation is that currently JayData does not support automatic relations (navigation properties) with mongoDB. I can confirm that navigation properties will be supported with the mongoDB provider in 1.3

    • What you are able to achieve here is to have a complex server side model that has reference fields for implementing 1..n and 1..1 relations but you will not be able to query based on navigation properties nor will you be able to use the “Include” operator to server-shape deep trees.

    I am preparing a small example on how to expose a model on a NodeJS/mongoDB platform with JayData and ammend it here.

    UPDATE: alternatively you could implemented your own Data API with JavaScript API Services (that’s a lower level API in JayData) that exposes API surfaces as an OData endpoint with Service Functions. Check out this: http://jaystack.com/blog/create-your-first-online-api-with-javascript-api-services . (Please note that the article refers to the JayStorm service multiple times but the techniques described apply to a local configuration too.

    Here are the steps to fire up your own JayData backed NodeJS middle tier layer with either JavaScript Data Services or with JavaScript API Services. Code you publish with JayData will be published with the OData protocol and using JayData on the client would turn the result into typed result trees.

    Please note that the OData protocol layer is a Connect/Express middleware so you must be using either of them to use JayData as server.

    Preparations on a clean linux system, most steps might not be needed for you

    bash$
        sudo apt-get install mongodb
        sudo add-apt-repository ppa:chris-lea/node.js 
        sudo apt-get install nodejs nodejs-dev
        sudo apt-get install  npm build-essential make autoconf libtool flex bison git libxml2-dev
        mkdir test; cd test
        npm install mongodb express http connect q node-uuid bcrypt xmldom qs
        npm install jaydata
    

    1) Create and boot up an API Service class without mongoDB backend.

    /*** begin server.js ***/
    var c = require('express');
    require('jaydata');
    window.DOMParser=require('xmldom').DOMParser;
    require('q');
    
    $data.ServiceBase.extend("myapi", {
        helloWorld: function() {
           ///<returns type="string" />
           return "Hello JavaScript Server World";
        }
    });
    myapi.annotateFromVSDoc();    
    var app = c();
    
    app.use(c.query());
    app.use(c.bodyParser());
    app.use("/test", $data.JayService.OData.Utils.simpleBodyReader());
    app.use("/test", $data.JayService.createAdapter(myapi, function (req, res) {
        return new myapi();
    }));
    app.listen(8080);
    
    /*** end server.js ***/
    

    Call helloWorld with:

    bash$: curl http://localhost:8080/test/helloWorld
    

    The blog post mentioned above shows more from this point

    2) Create a mongoDB backed JavaScript Data Service

    /* begin server.js */
    var c = require('express');
    require('jaydata');
    window.DOMParser=require('xmldom').DOMParser;
    require('q');
    var app = c();
    app.use(c.query());
    app.use(c.bodyParser());
    app.use(c.cookieParser());
    app.use(c.methodOverride());
    
    $data.Class.define("test.Product", $data.Entity, null, {
        Id: { type: "id", key: true, computed: true, nullable: false },
        Name: { type: "string" },
        Price: { type: "integer" }
    }, null);
    
    $data.Class.defineEx("test.Context", [$data.EntityContext,$data.ServiceBase], null, {
        Products: { type: $data.EntitySet, elementType: test.Product }
    });
    test.Context.annotateFromVSDoc();
    
    app.use("/test", $data.JayService.OData.Utils.simpleBodyReader());
    app.use("/test", $data.JayService.createAdapter(test.Context, function (req, res) {
        return new test.Context({name: "mongoDB", databaseName:"test", address: "localhost", port: 27017 });
    }));
    app.use(c.errorHandler());
    app.listen(8080);
    /* end server.js */
    

    Since the “test” database is exposed with the OData protocol you can do CRUD operations from any AJAX tool, but I recommend datajs or JayData.

    Also note that with the Data Service classes you can define server side event handlers that can alter the data to be inserted or cancel the operation (much like triggers in the SQL world). You can also pass in authorization logic to the JayData server context to enforce user based rules and access control.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing an application for Windows Mobile Devices using Visual Studio .NET 2008 whose
I'm developing application using backbone.js & jquery. I have following code in model: runReport:
Well i am developing an application whose interface requires an animated slide show and
I'm developing an application using Apache Click, aimed for mobile browsers -- so I
I am developing a web based application whose primary objective is to fetch data
What is difference in developing applications using .Net Framework, Asp.net and developing application in
While developing an application using gwt in ecliplse crashed. Now the server is running
I'm currently developing a web application whose primary user function is uploading and downloading
I am developing an application, whose data management is realized through Core Data, and
I am developing one chart application on .net framework by using Silverlight and Visifire,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.