1 Syncing considerations
Robin van Boven edited this page 2017-02-27 13:12:50 +01:00

Choosing the correct directory for your Friendica server or as syncing targets may be confusing, so here are some theoretical and practical considerations involved.

As a Friendica server admin

Your server will be submitting profiles to the directory in your configuration, whenever users that have opted in for the directory make changes to their profile, or new users sign up.

The directory you want to choose for this purpose is one that:

  1. Is fast and has good uptime, to provide good user experience.
  2. Is connected well with other directories, so your user's profile gets propagated to all other directories.
  3. You trust the admin not to apply censorship.

How do you do that? Two of those can be tested. Speed and uptime have a good number of tools out there, so I won't go into them.

Does a directory propagate?

This is best tested by configuring the directory, creating a new user and opting in for the directory. You should see the following:

  • In a few seconds, the directory will request the profile data from https://yourserver.com/noscrape/username.
  • In a few minutes (default cronjob is 5 minutes), other directories should be requesting the same profile data.

You can monitor your server's access logs for this, as well as searching for the profile on other directories to see if they show up. It may take multiple syncing steps (the 5 minute one) before all directories are aware of the profile. Give it about 30 minutes to do so. If your profile still isn't showing up on more than the one directory you've configured, consider choosing a different directory server as it does not propagate well.

About censoring

At the time of writing, directory admins have the option to mark a profile as censored, which prevents it from showing up in search results. In the current code this is ignored by the syncing system and other directories should receive this profile regardless. But nothing stops them from changing this behavior.

In other words, it's a trust you place in the directory admin not to apply censoring in a way you or your users would disagree with. This isn't testable, so I would handle any concerns as they come up.

Should an issue arise, you can simply configure a different directory or start up your own.

As a Directory server admin

How useful your directory is will depend completely on whether you can get 100% of the profiles that opted in for the directory. Syncing is the way to achieve this. Because (in theory) all directories have the same goal of getting as many profiles as possible. You won't need a large amount of syncing targets. Pulling from a single directory that has all profiles should get you good results too.

So why would you add more and how many?

Make sure profiles don't get stranded on your directory.

When a Friendica server decides to submit to your directory and there is no directory that PULLS this profile from you. It will get stuck at your server and no other directories will be aware of this profile.

This is what PUSH targets are for. You want at least one push target that is considered well known or even the de facto directory. This will raise the odds the profile gets propagated to all directories. Setting more push targets will improve the odds even further. However...

Pushing a lot is rude, prefer pulling.

Pushing to every directory you know is a bad idea, because it will incur a lot of overhead and duplicate information. It will cost performance from every server involved. Directories will think that a profile updates more often than it actually does and needlessly revisit the profile. And the Friendica servers will get the extra load of several directories visiting frequently.

Pulling from multiple directories is the better way to approach things. When pulling turns up a profile your directory wasn't aware of yet, it does now. If the speed with which changes propagate is poor for this profile, the maintenance cronjob will take care of it. While some profiles might slow down because of this, it will have a much smaller impact on performance overall.

Optimizing things.

To speed up the network of directories, you want to reduce the number of pulling cycles it takes for a profile to fully propagate. The number of "hops" you could say. The easiest way to do this is to agree on an authoritative directory.

All directory admins agree to push to the authorative directory. And all admins pull from the authorative directory. This means it takes 1 PUSH and 1 PULL for a profile to reach all directories.

But of course, authorative servers, agreements, etc. are an eyesore to decentralized systems. So consider agreements like this your "fast route" created to optimize things. And add additional push/pull targets for the sake of redundancy and protecting against the authorative server going rogue.