Saruman’s Palantir is an epitome of GDBMS applied in Customs Service

On Graph Database, Relation Analysis, and the Lord of the Rings

Joe Suh
Apr 30 · 5 min read

I will be sharing this unique story by comparing similarities between the AgensGraph use case with the Korea Customs Service and scenes from the Lord of the Rings trilogy.

When I first heard about how a graph database increased the catch rate of smugglers in customs service, I was inspired to write a blog post based on this exciting use case. I believe this fun story can be easily approachable and understandable for non-IT related people as well. So hang on to your mouse and keep on scrolling!

If you want to cut to the chase and find out how a graph database was used in customs service, you may refer to the following section.

Case at a Glance: Traveler Information Analysis System

Some of you may know that there are government agencies around the world that supervise smuggler activity, false report of corporate imports and exports, and illegal immigration, etc.

Among those categories of supervision, a few personnel working within the control center of Korea Customs Service (KCS) sought an effective analysis system that can replace their legacy relational database management system to overcome their difficulty in performing relation analysis of the smuggling offenders.

To read a detailed, straightforward use case of how AgensGraph significantly improved Korea Customs Service in spotting smugglers and accomplices, download the paper here.

Prior to explaining the concept and use case of the graph database through Tolkien’s universe, beware of spoilers ahead.

The Fellowship of the Smugglers

Without further ado, let us put aside the theme of good vs evil in the trilogy for the sake of this post and start with the end boss of The Lord of the Rings, Sauron. Sauron’s purpose throughout the films was to find his stolen ring being smuggled into Mordor, which in a way, sounds like a job for the customs service.

Now use your imagination to assume the fellowship as the smugglers of the ring. If you look at the fellowship formed on Rivendell, you would wonder how in the world an unrelated group of races like elf, dwarf, humans, and hobbits came together to risk their lives for a common cause.

In a real-life situation, the smugglers would generally pay or hire regular people to become their accomplices. One of many methods these people would take is to avoid the designated countries marked with high security and surveillance and take a longer flight path to reach their destination.

Remember the snowy cliff scene where the fellowship headed to Moria for a detour in order to avoid Saruman’s surveillance? It is exactly like that with these smugglers. They will take whatever means to smuggle illegal goods to their final destination as long as they are not caught.

At first, KCS lacked the technology to identify and connect the hired people to the smugglers. The lack of storage space to save millions of data and their work cycle heavily depended on the relational database for relation analysis.

But as mentioned above, KCS acquired the Traveler Information Analysis System, which is an equivalent to Saruman’s palantir.

The Two Databases

Palantir is a spherical seeing-stone Saruman kept inside the Tower of Isengard. This fictional, but magical artifact is basically an embodiment of graph database management system (GDBMS) of Middle Earth.

In the film, the palantir works as a communication device between Sauron and Saruman, but it has a more important feature than being a Middle Earth smartphone. If Eye of Sauron is like a big data platform that is able to store all data of Middle Earth, the palantir is able to gather the data from the original source and perform “network analysis” to find and visualize the pattern of whatever information Saruman seeks.

Saruman: CREATE (:Person {name: ‘Frodo’, from: ‘Shire’, age: 50})

That sums up how the GDBMS operates within the big data platform. Based on the transactional data, the Traveler Information Analysis System is able to configure essential information in a web interface format and provide profile information of travelers on board the plane. In order for its real-time analysis feature to work, a key development module for network pattern analysis tool is provided by the developer of AgensGraph, Bitnine.

The core technology behind the development module is AgensGraph, a unique graph database fork of PostgreSQL. Due to its multi-model attributes, it has high compatibility with the relational database and is able to store both the structured and unstructured data to analyze the relationship of data and visualize the outcome in forms of graphs. For example, the smugglers and accomplices are represented as vertices in a graph model network, and the relationship between them is connected with edges.

With GDBMS-applied analysis system, it is easier to see the correlation of smugglers and accomplices

Thanks to AgensGraph’s capability to effectively use data from the two databases, KCS is now capable of investigating relation analysis between smugglers and companions in a shorter time.

The Return of the KCS

In the film, Sauron may have failed his mission due to Saruman’s death (as shown in The Return of the King Extended Edition), Aragorn’s diversion, and completely unsuspected MVP, but in a real world, there will be no drama for the smugglers since KCS will be able to prevent infiltration of any illegal activities.

Unless they brought an army of ents and paralyzed the control center of KCS, there is no way their methods can outmaneuver the up-to-date technology of the GDBMS.

By applying flexible graph algorithms and analysis techniques, the personnel in KCS is able to track down even the tiniest relationships of the smugglers, thereby preventing big or small smuggling activities. Moreover, thanks to the master data model technology and its intuitively visualizing analysis system, the KCS can now perform relation analysis to track accomplices and navigate the sophisticated path of smugglers more efficiently than before.

Bitnine provides the technological basis for swift analysis and visualization of multi-sourced data with its graph database solution, AgensGraph.

If you like this post and are interested in learning more about us, follow and subscribe here, check out our GitHub, and visit our homepage. Contact or leave a comment for some feedback. Thank you!


AgensGraph has high compatibility with the relational DB because it is a graph DB integrated with PostgreSQL. Get to know the multi-model database by reading our stories!

Joe Suh

Written by

Joe Suh

Technical Writer, Assistant Marketing Manager @AgensGraph.


AgensGraph has high compatibility with the relational DB because it is a graph DB integrated with PostgreSQL. Get to know the multi-model database by reading our stories!