Untagging the Dashboard

Tagging has become a ubiquitous part of modern web applications ever since it was popularized by Flickr and Delicious in the early 2000s. The ability to add a tag to arbitrary content allows a user to organize, filter, manage, and measure however they see fit. This flexibility of application makes tagging a very valuable feature to invest in.

tag: rawr
tag: rawr

Tagging has been a function of the Hootsuite dashboard for some time. In its current incarnation, users have the ability to add tags to messages in their streams, and to add tags to their outbound messages. This allows them to generate analytics reports on things such as the number of retweets of their messages with a given tag, or how often they receive messages with the tag ‘Pokemon Go’. In addition, organizations have the ability to tag arbitrary uploaded content, such as files or images, so that a team member can more easily find resources for composing messages.

There are, however, some glaring shortcomings with the current implementation. For one, there is no central location for managing these tags: to view all existing tags or to create new tags, a user must go through the workflow of applying a tag to a message. There is no easy way to filter tags based on different criteria, no way to edit a pre-existing tag, and no way to restore an accidentally deleted tag. In addition, tags must be individually applied to every message by hand, which can be a massive time-drain on marketing departments.

There are also technical problems with the current system. Just as the frontend has no central place to view all message and content tags, the backend has no logical linking between different kinds of tags. Message tags and content tags are stored separately, with message tags being in a dashboard Mongo collection, and content tags being in a MySQL table belonging to a different service, both re-implementing much of the same base logic. Tagging also adds more bloat to the already oversized dashboard codebase, and brings with it potential performance constraints by making it share its bandwidth with the heavily used dashboard servers.

Tag Service

Enter Tag Service, which the Hootsuite’s Tools team began work in Q3 of 2016. Rather than trying to refactor the existing dashboard tagging functionality, it was decided to migrate tags into a new external scala microservice. By creating a single central location for all basic tag logic, we provide a strong (but simple) foundational service that other teams can then consume from. Being able to scale the service in isolation from the dashboard provides much-needed flexibility to respond to the expected rise in tagging traffic.

image00
Simplified overview of tag service integration

The core of Tag Service, as mentioned, is quite simple. It provides service endpoints that allow a consumer to create, retrieve, update, archive, and restore tags. It also provides endpoints for viewing the history of edits to a tag. There is a permission layer which allows tags to be partitioned in an organization based on group membership, so that an admin does not have to sort through the organization’s entire tag library, and also to protect the usage of certain tags for certain groups. On top of the scala service is the frontend interface in the dashboard, Tag Manager, which is the initial consumer of the service, and provides Hootsuite users a centralized location for all basic tag management operations.

This core service makes very few assumptions about its consumers, and is therefore extremely flexible in its application. For example, this same service can now be used for adding tags both to messages and to uploadable content, and nothing would prevent it from being extended into tagging other kinds of things in the future.

An early consumer of the new Tag Service is the Inbound-Automation service. It will provide the ability to automatically apply tags to incoming messages. For example, it might auto-apply a ‘Bug’ tag to any incoming message with the words ‘bug’ or ‘glitch’ in it. Other consumers of the tag service might provide the ability to retroactively apply tags to past messages (inbound or outbound).

The Tag Service has been released, but its integration with new services as they arise will be an ongoing project. Extracting its functionality from the monolith, providing a stable scala foundation, and keeping it simple are all decisions that promise to make the future of tagging at Hootsuite extremely adaptable to changing business needs.

About the Author

image01Michael was a Co-op Software Developer on the Tools team at Hootsuite. He is also an active jazz musician, runner, and enjoyer of craft beer. Find him on LinkedIn.