So I'm creating a Rails app that will function as a directory for contact information in our organization. But it's not as simple as it sounds.
- We have a large LDAP-enabled directory which contains information for all of the users in our organization of tens of thousands.
- We have a smaller, separate LDAP-enabled directory which contains additional information for our department of several hundred, as well as some information duplicating or taking precedence over fields in the larger directory.
- We will want to hand edit some of this data to override some of the fields in our local directory, which will be represented by a SQL table in the Rails app.
- The remote directories will be periodically mirrored as SQL tables, and the 3 tables (Organization, Department, Local) will be compared to choose the correct value displayed in the app.
I know that sounds ridiculous, but nothing can be done for it. Our organization is very decentralized, and this is the most straightforward way to get what we want.
This is my second Rails app, so I'm comfortable with most of the design and plumbing, but I don't know the best way to periodically poll the data from the remote directories and import it into our local SQL tables.
Where in my app should I periodically import data into my tables from LDAP? Do I use Rails? Should I do this in straight Ruby and run it as a cron job?