Remote entities
Overview:
The aim of the project is to create a system, based on services, which will enable to transparently use entities from a different site as local entities. I will base my system on Drupal 7, because the new APIs give me the required level of flexibility for the clean implementation. I will use the Entity API module to do easy CRUD on the entities.
Description:
The project will use the services module for communication between the different Drupal sites. Every syncable entity will have a UUID, an origin site and a last update date. On a page load or cron (depends on the configuration) the client site will ask the origin site if the entitiy is updated.
When the user tries to update an entitiy on a client, two things can happen: one thing is that the server allows direct updates. This means that the user can edit a node in place, and the client site sends the updated content to the origin site. Another option is a redirect to the origin site's edit form (requires some kind of SSO or OAuth). This can involve locking issues. I am currently planning to implement a basic locking mechanism, but as a continuation of this project, there would be great if some kind of merging can take place.
Prior to syncing, the client site has to clone the bucket (content type in a case of a node) from the origin site. On errors (eg. missing field types) the admin will be notified and the in-place editing will be disabled. Later on this cloning process may go through the features module (it has not been ported to D7 yet).
The initial push type can be configured by the user. The user can select to make available all enabled entities on the origin site (in this case the client site will replicate every instance of the entity, eg all nodes). It is also possible to make pullable only the selected entities (eg. certain posts on a news site). I can make this as an action for rules, so it can be used in various situations (eg in the views bulk operations module).
If everything goes well, I will finish these things at midtime.
In the second half of the project, I am planning to implement a p2p entity sharing system on the top of this architecture. In this case, the clients don't necessarily get the updates directly from the origin server. By implementing this, it can be also possible, that the origin can notify the clients of the content change, which can make the system more realtime.
This can be useful, if the servers are geologically separated, or if the user wants to make some kind of load balancing or high availability stuff. With Aegir and a good installation profile, this project can unlock some really interesting possibilites.
There are several benefits of this distributed architecture.
There are big sites with a lot of functionality splitted into different areas, but the content must be shared across these areas. You can do this by creating a very big Drupal with a lot of modules installed and face the problems of having too much modules installed (slowness, incompatibilites). You can also try to do some kind of multisite-based setup with table sharing, but you will have problems with the content sharing (CCK's enabled on one site, but not on the another, access problems). I belive that the best way to do this is to create small, competely distinct Drupal sites, and replicate the content across these sites. The other benefit -- as I mentioned earlier -- is the scalability and high availability.
Timeline:
May 24-31: getting familiar with D7 and some helper modules (like Entitiy API), finding contribs and ideas which can help me during the implementation phase
June 1-6: planning
June 7-Jul 9: implementation of the first phase
Jul 9-Jul 11: testing / bugfix sprint
Jul 12: submit midterm
Jul 13-Aug 13: implementation of the second phase
Aug 14-Aug 19: testing and bugfixing
Aug 20: submit the final report
About me:
I am a student who is working as a part time Drupal developer at Pronovix for almost 2 years. I was in the organisation team at Drupalcon Szeged, and I took part in the video team at Drupalcon Paris. I also gave a speech about services at Drupalcamp Prague. I regularly participate in the local Drupal user group meetings by helping others to get involved with Drupal. I am a pernament guest presenter at the Drupal course of the University of Szeged.
I have experience in a several fields, I have a good knowledge of XHTML, CSS and JavaScript, but I am the best at PHP and databases, mostly in the architectural and backend sphere.
Mentors:
- Kristof Van Tomme - local mentor
I am talking with the services developers to get a technical mentor, but if you are interested mentoring me, feel free to post a comment or send a pm.
Contact details:
E-mail: yorirou AT gmail DOT com
Skype: yorirou
Difficulity:
Medium