Hi Eric,

Thanks for the response

You mention that adding DRF can actually make you lose some potential 
benefits from caching? Might i ask how that is so? I actually thought it 
was supposed to be the opposite (shows you what I know tho hah)

I guess DRF can be added to the project at any time tho, so there's no need 
to build the project with DRF built-in from beginning. So if I do need it 
down the road, it won't be difficult to add it in. 


On Friday, 26 October 2018 04:28:23 UTC-4, Eric Pascual wrote:
>
> Hi,
>
>
> Using DRF can help when there is a need for decoupling the presentation 
> layer from the logic one, for instance if the logic is planned to be used 
> in other scenarios that the interactive Web app. 
>
>
> One can argue that structuring the logic as a Python package can do 
> it, but this will not work if the deployment involves splitting front-end 
> and logic back-end in distinct nodes (f.i. in a Docker multi-container 
> based deployment). 
>
>
> Introducing DRF adds for sure a level of complexity and you'll loose some 
> potential caching benefits, but it lets the path opened if ever the above 
> mentioned evolution of the application appears in the future. You will not 
> have to refactor anything then.
>
>
> The bottom line is that there is no absolute answer to the question. It 
> depends on what can be the plans for the application evolutions in the 
> future.
>
>
> Regards
>
>
> Eric
> ------------------------------
> *From:* django...@googlegroups.com <javascript:> <
> django...@googlegroups.com <javascript:>> on behalf of Andréas Kühne <
> andrea...@hypercode.se <javascript:>>
> *Sent:* Friday, October 26, 2018 9:29:40 AM
> *To:* django...@googlegroups.com <javascript:>
> *Subject:* Re: Should I use Django-Rest-Framework for performance 
> reasons, despite not needing an externally-consumable API? 
>  
> Hi, 
>
> I really don't get why you would want to do that? If you are doing only a 
> "standard" website - you don't want or NEED the extra complexity of running 
> DRF. It's not that DRF is hard to setup - but for example if you want to 
> present a list of items - in "standard" django, you create the list and add 
> it to the context data. In DRF - you need to create the list, serialize it 
> into json (or xml if you want to go that route), on the frontend you then 
> need to deserialize the list and present it.
>
> You add a lot of complexity and need to write a lot of frontend code.
>
> Working with "standard" django - you can cache a lot of things in 
> different places. You can for example cache an entire response with 
> template, or just cache the database calls and present them in a template. 
> This is not hard to cache or to setup. 
>
> I think I would need to know more about your use case to understand it 
> better :-)
>
> Regards, 
>
> Andréas
>
>
> Den fre 26 okt. 2018 kl 03:44 skrev Tyler Lynch <tyler...@gmail.com 
> <javascript:>>:
>
> I have no need for an externally consumable API, but I am interested in 
> using Django-Rest-Framework simply for performance reasons.  
>
> I'm led to believe that by decoupling my front and back end and then 
> simply consuming the DRF api within views, that I can setup a better 
> caching system? Does this make sense? Using DRF from an architectural 
> standpoint (with the goal of optimizing caching & performance) despite not 
> needing an externally used API? Or am I totally off base and confused? Any 
> advice would be much appreciated.
>
> -- 
> 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...@googlegroups.com <javascript:>.
> To post to this group, send email to djang...@googlegroups.com 
> <javascript:>.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/8b55ff9a-e915-4546-bf3c-1b20a25e4826%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/8b55ff9a-e915-4546-bf3c-1b20a25e4826%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
> -- 
> 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...@googlegroups.com <javascript:>.
> To post to this group, send email to djang...@googlegroups.com 
> <javascript:>.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CAK4qSCeFqeGT8EbZFbWOGpHKY36D4bwvayLBxGm0YsBBFX6jnw%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/django-users/CAK4qSCeFqeGT8EbZFbWOGpHKY36D4bwvayLBxGm0YsBBFX6jnw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e35331db-df90-487e-af6e-4fb77071ec17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to