Pros/cons of adapter on client-side/server-side

Hi,

Sorry for the late reply. I agree with everything Dustin has said and if were building an API that I knew would have multiple consumers I would probably use a client side adapter myself. If you know your api will only have one consumer (Ember) then some of Dustin’s points are not applicable.

The one major conceptual reason to use a client side adapter is that DRF does not support sideloading. Depending on your data structure, sideloading can be a very powerful tool to optimize your api requests. Having used sideloading and embedded records in Ember-Data now, I would actually recommend you use embedded records as they work a lot more consistently, however in some data structures sideloading can massively increase the efficiency of your API.

Most of the other reasons I use a client side adapter are all specific to the characteristics of DRF and Ember Data. While Ember Data aims to be extensible, there are still a lot of assumptions that are baked into the code that cause it to break down when you adapt it in certain ways. I think there are a lot less of these now than 3 months ago when I was still using a client side adapter but they still exist. Django Rest Framework is much more stable than Ember Data and I think in a lot of ways it is much more straight forward and easy to extend. And finally, I massively prefer writing python code to writing javascript.

Cheers, Gordon

2 Likes