2

I am trying to figure out which would be easier to setup and maintain, while keeping the speed average or better.

I have setup a Drupal 7 site on godaddy with their Deluxe 4GH hosting plan. What I am trying to figure out now, would it be easier to setup and maintain a resful server in drupal 7 or setup a seperate restful server. I would also like to know if I can run the seperate restful server on a subdomain. Right now I have the restful server enabled in drugal (nothing setup tho), and I now cannot get past the firewall of the company I work for.

1
  • research godaddy and switch providers. – user49 Mar 6 '12 at 12:48
3

It really depends on what part of your Drupal site your REST service will be an interface to. The Services module provide a great and easy solution to expose parts of of Drupal core and some selected contribs data and feature as REST services. IT also provide a framework to build your own services.

By-passing Drupal in a separated service directly accessing the MySQL DB is only an option if you are accessing custom tables. Accessing nodes (ie. content) directly in the MySQL database is a bad idea. The DB schema to store the nodes is dynamically managed by Drupal (the Field API). It could change whenever you add, remove or edit fields or when updating Drupal. But the Field API is not the only one to manage node data, any module can contribute data to a loaded node or add behaviours on node CRUD operations. If you go directly to the database you loose all these added behaviours. The same is true for most data handled by Drupal.

1

If you set up the server on a separate site as Drupal is concerned (subdomain pointing to a new site) then you will have to deal with accessing data from a different site which would probably be best done with Domain module. The all seems like a lot of overkill. Depending on the types of data you want to expose Services may do everything out of the box and it integrates with Drupal's permission and role system in addition to many modules exposing their data through it.

With services you can setup "endpoints" which have paths associated with them so you can do something like example.com/api/node ... etc. And you can alias build in resources so you can hide things like "node" and replace it with "content" or whatever makes sense in your situation.

Services is also able to version your RESTful API easy through Services tools (historical) so you can have api/1.0/custom, api/1.1/custom if you decide to provide custom resources. Versioning your API is a must if you want to ensure end-users are not interrupted by changes you may make. Services tools makes the process easy which you may end up having to do on your own if you build something from scratch. The services historical is being added to core services as well.

0

I think it is better build your restful api in rails or nodejs in custom table and export the table in drupal by entity api or views api.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.