Saturday, March 30, 2013

Re: Doubt regarding JSON/SQL in Django

Al 30/03/13 14:37, En/na Parin Porecha ha escrit:
> Also, would it be beneficial performance wise ?

It depends on how you implement it:

* on a "traditional" client/server application I think that
loading/parsing/processing/encoding/saving the json file on each request
will be very expensive compared to database access.

* if all the processing logic is in the client side and django acts as
an storage service it may be ok.

> One more doubt -
> is it better to convert query results ( obtained from sql tables ) to
> JSON, and send it as an http response to the client and use it to show
> data, or to simply send the query result to the client and show it via
> task.name, task.start_date etc. ?

IIUC you can't return the query (as a python object) to the client. You
must convert the data on it to some format (json, xml, ...) that the
client understands. That will depend on the libraries that you use in
the client side.



Regards

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment