Apache Sqoop
A command line tool for bulk transfer of data between relational databases and Hadoop storage.
Apache Sqoop is a tool for moving bulk data between relational databases and Hadoop. A single command reads a table and writes it into Hadoop storage, or reads from Hadoop and writes back into a database table. The project has been retired and moved to the Apache Attic, which is stated on its official site.
Project status first
Anyone reading about Apache Sqoop should know its current position before anything else. The official site states that the project has been retired and moved to the Apache Attic.
The Attic is where Apache projects go when they are no longer actively developed. Existing code remains available and the documentation stays online, but there are no new releases and no ongoing maintenance.
That does not make the tool uninteresting. Sqoop appears throughout older Hadoop platforms, and understanding it is often necessary when working with an established estate or planning to move off one.
What Sqoop was built to do
Sqoop moves bulk data between relational databases and Hadoop storage. The name reflects that: SQL and Hadoop.
The problem it solved was specific. A Hadoop cluster is good at processing very large amounts of data, but the data usually starts life in a relational database. Getting it across meant writing a distributed program to read the table in parallel and write it to cluster storage, and writing that program for each table was repetitive work.
Sqoop turned it into a command.
How a transfer worked
An import took a table and wrote it into Hadoop storage. An export took data from Hadoop and wrote it back into a database table.
The part worth understanding is how a transfer was parallelised. Sqoop divided the table into ranges using a chosen column, then ran several tasks, each reading one range. Instead of a single connection pulling millions of rows in sequence, several read at once.
That made the choice of column consequential. A column with evenly distributed values gave tasks roughly equal shares. An uneven one meant one task did most of the work while the others finished quickly.
Incremental imports
Reimporting an entire table every night is wasteful once the table is large.
Sqoop supported incremental imports, bringing in only rows that were new or changed since the previous run. This was done either by tracking an increasing key value or by using a modification timestamp column, with the last value from the previous run supplied to the next.
Where it fitted
Sqoop was a transfer tool, not a transformation tool. It moved data between two places. Anything that needed doing to the data was expected to happen afterwards, in a processing framework running on the cluster.
That narrow scope is part of why it was straightforward to use and also why it has been superseded by tools that handle a wider range of sources and destinations.
Who encountered it
Sqoop was used by data engineers and platform teams running Hadoop, typically as part of a scheduled loading process. Today it is most often encountered by teams inheriting an existing platform.
Limitations
Beyond the retired status, its scope was always narrow. It connected relational databases to Hadoop, and it dealt with tables and files rather than with the applications, APIs and streams that make up a large share of integration work today.
For anything new, the current alternatives in the Hadoop ecosystem or a general purpose integration tool are the appropriate place to look.
Reference
The official project site remains available and includes the user guide, covering the import and export commands, connection options, split behaviour and incremental modes, along with the notice describing the project's retirement.
Key features of Apache Sqoop
Capabilities described in the official documentation.
Import and export commands
One command imports a database table into Hadoop storage and another exports data from Hadoop back into a table.
Transfers split across tasks
A transfer is divided by a chosen column so several tasks read different ranges of the table at the same time.
Incremental imports
An import can bring in only rows added or changed since the previous run rather than reading the whole table again.
Connections through JDBC
Databases are reached through their JDBC drivers, with additional connectors available for particular systems.
Advantages of Apache Sqoop
Factual advantages that follow from the features above.
Bulk movement without writing a job
A table transfer is expressed as a command rather than as a distributed program written for the purpose.
Parallelism is built into the transfer
Splitting the table across tasks means a large transfer uses the cluster rather than running through one connection.
Movement in both directions
The same tool covers loading a database into Hadoop and writing processed results back out to a database.
Connections use standard drivers
Databases are reached through their JDBC drivers, so a source does not need dedicated support to be read.
Common use cases for Apache Sqoop
Situations the official documentation describes this tool as being used for.
Loading tables into a Hadoop cluster
Operational database tables are imported into cluster storage so processing jobs can run against them.
Returning results to a database
Output produced by cluster processing is exported back into a relational table for applications to read.
Repeated incremental loads
A scheduled command imports only rows added since the last run, using a column that identifies new records.
Reading a database with no cluster connector
A JDBC connection extracts from a database the cluster has no dedicated integration for.
Official website
Everything on this page is based on the official documentation for Apache Sqoop. You can read the source here.
Apache Sqoop official documentation