Catalogue / feedbin-2013-full-metal-hosting

Feedbin runs its database, web and worker tiers on physical servers at SoftLayer and refreshes feeds from cheap VPSes elsewhere

Feedbin, 2013. RSS reader hosting architecture.

Organisation
Feedbin
Evidence
Reported from production
System
RSS reader hosting architecture
Setup
One database

Near: The database has a similarly configured hot standby | Near: Web Servers x 3

As of
2013-06
Source
Full Metal Hosting

Feedbin blog, published 2013-06-28

Architecture

Feedbin's primary servers are physical machines at SoftLayer, in a data center in Washington D.C.: a Postgres database server with a hot standby, three Rails web servers and two Sidekiq background workers, with cloud servers there for two nginx load balancers and memcached. All feed refreshing runs in another data center, at DigitalOcean, on a Redis instance and ten Sidekiq instances.

Section: The Bare Metal | Section: The Cloud | Section: The Data Center

Components

ComponentRoleWhere
Database serverPostgres 9.2.4 on a physical machine with 64GB of RAM and four 800GB SSDs in RAID 10, plus separate disks for the write-ahead log. A similarly configured hot standby follows it, write-ahead log files are shipped to S3 constantly, and a base backup is taken nightly. The author thanks the team at Command Prompt for setting it up.Near: Postgres 9.2.4 on Ubuntu 12.04.2 LTS | Near: The database has a similarly configured hot standby | Near: the team at Command Prompt for setting
Web serversThree physical machines running Nginx in front of Unicorn and Rails 4.0.Near: Nginx in front of Unicorn running Rails
Background workersTwo physical machines running Sidekiq Pro. They import the new entries that the feed refreshers find.Near: Background Workers x 2 | Near: imported by a background worker running at SoftLayer
Load balancersTwo cloud servers running nginx that terminate SSL and balance load. Both are in use at once, through Active-Active DNS failover at Route 53, which hosts the DNS.Near: There are two load balancers running nginx
MemcachedA 4 GB memcached instance on a cloud server at SoftLayer.Near: There is also a 4 GB memcached
Feed refresh queueA 16GB DigitalOcean instance running Redis 2.6.14, to which the refresh job is scheduled and which holds the ids of entries already seen.Near: The refresh job gets scheduled to a 16GB
Feed refresh workersTen 2GB, 2 core DigitalOcean instances running Sidekiq Pro. Each job fetches a feed with HTTP caching headers, parses it, checks each entry's id against Redis, and queues new entries for import at SoftLayer.Section: The Cloud

Figures, as the source states them

FigureAs statedNoteWhere
Usable SSD space on the database server1.6 TBAbout; capacity, not data storedNear: for about 1.6TB of usable space
Memory of the database server64 GBNear: RAM: 64GB
Feed refresh worker instances at DigitalOcean10 instancesEach 2GB with 2 coresNear: There are 10 2GB 2 core instances
Entry ids in the example of Redis key distribution20,000,000 idsThe example the author gives; about 1,000,000 Redis keys hold themNear: For 20,000,000 ids only about 1,000,000 redis
Redis keys created for 20,000,000 entry ids in the author's example1,000,000 keysAbout; for 20,000,000 idsNear: For 20,000,000 ids only about 1,000,000 redis

Records

Decision#d1

Put the database, web and worker tiers on physical machines because the workload is bound by I/O

feedbin-2013-full-metal-hosting#d1 at corpus version 26a1b3a7e3dd
Chosen

The primary servers are physical machines at SoftLayer: the Postgres server with SSDs in RAID 10 and its hot standby, three web servers and two background workers. Cloud servers are kept for the load balancers and memcached.

Section: The Bare Metal | Section: The Cloud

What forced it

Feedbin is heavily I/O bound, and the author says cloud servers were not adequate for much of its functionality.

Near: Feedbin is heavily I/O bound

Decision#d2

Choose a Washington D.C. data center for latency to both United States and European customers

feedbin-2013-full-metal-hosting#d2 at corpus version 26a1b3a7e3dd
Chosen

The SoftLayer data center that holds Feedbin's primary servers is in Washington D.C. Feed refreshing runs in another data center.

Section: The Data Center | Near: All feed refreshing is done in another

Reasoning

Of the options, it seemed to have the best latency between the US and Europe. Most customers are in the US, with Europe close behind, the U.K. and Germany in particular.

Section: The Data Center

Decision#d3

Run a Postgres hot standby and ship write-ahead logs to S3 with a nightly base backup

feedbin-2013-full-metal-hosting#d3 at corpus version 26a1b3a7e3dd
Chosen

The database has a similarly configured hot standby, kept with PITRtools. Write-ahead log files are shipped to S3 constantly and a base backup is taken every night with wal-e.

Near: The database has a similarly configured hot standby

Decision#d4

Refresh feeds in a separate data center on cheap virtual servers that are quick to turn on and off

feedbin-2013-full-metal-hosting#d4 at corpus version 26a1b3a7e3dd
Chosen

All feed refreshing runs at DigitalOcean. The refresh job is scheduled to a Redis instance, and ten Sidekiq Pro instances take jobs from it. A job fetches the feed using HTTP caching headers, parses it, and checks each entry's id against Redis. A new entry is converted to JSON and put back into Redis as a Sidekiq job, which a background worker at SoftLayer imports.

Section: The Cloud

Reasoning

The author says DigitalOcean's virtual servers are both low cost and high performance and quick to turn on or off, and that the refresh job is simple but has to run as fast and as much in parallel as possible.

Near: They provide low cost AND high performance | Near: needs to run as quickly and as parallel

Decision#d5

Detect entries already seen with sha1 ids bucketed into Redis hashes by their first five characters

feedbin-2013-full-metal-hosting#d5 at corpus version 26a1b3a7e3dd
Chosen

Each entry gets a unique id, a sha1 of a few of its attributes. After import the id is stored as a field of a Redis hash whose key ends in the first 5 characters of the id. The author's example is that 20,000,000 ids need only about 1,000,000 Redis keys.

Near: A unique id for an entry is | Near: For 20,000,000 ids only about 1,000,000 redis

Rejected

Storing the ids as a Redis set. In the author's trial it took more than twice the memory.

Near: storing the keys as a redis set

Reasoning

Bucketing spreads the ids evenly enough over the hashes to benefit from the memory efficiency of Redis hashes. The author tried a few other data structures and found this the most efficient.

Near: take advantage of redis hash memory efficiency

Review

Extracted by
Claude (feed 25)
Human review
Not started. Status recorded on 2026-12-02.