• Stars
    star
    1,136
  • Rank 41,003 (Top 0.9 %)
  • Language
    Ruby
  • License
    Apache License 2.0
  • Created over 12 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

MySQL toolkit for managing billions of rows and hundreds of database machines

Jetpants

OVERVIEW:

Jetpants is an automation toolkit for handling monstrously large MySQL database topologies. It is geared towards common operational tasks like cloning slaves, rebalancing shards, and performing master promotions. It features a command suite for easy use by operations staff, though it’s also a full Ruby library for use in developing custom migration scripts and database automation.

Jetpants supports a range-based sharding scheme for MySQL by providing a fast way to split shards that are approaching capacity or I/O limitations. Jetpants is able to accomplish this without any locking, downtime, data inconsistency, or query failures. Dynamically resizable range-based sharding allows you to scale MySQL horizontally in a sane manner, without any need for a central lookup service or massive pre-allocation of tiny shards.

MOTIVATION:

Jetpants was created by Tumblr to help manage our database infrastructure. It handles automation tasks for our entire database topology, which as of May 2013 consists of over 215 dedicated database servers and nearly 200 billion total distinct relational rows.

One of the primary requirements for Jetpants was speed. On our hardware, Jetpants can divide a 750GB, billion-row shard in half in about six hours – or even faster if you’re diving into thirds or fourths.

For more background on the motivations behind Jetpants, please see Evan Elias’s presentation at Percona Live 2013.

COMMAND SUITE FEATURES:

The Jetpants command suite offers easy command-line interaction with complex MySQL automation tasks.

  • Clone slaves efficiently, including to multiple targets simultaneously

  • Split a range-based shard into N new shards with zero downtime and no failed queries

  • Perform master promotions and other pool topology changes

  • Defragment tables quickly in parallelized chunks

  • Interact with your database topology in a REPL environment via jetpants console mode

For more information on the command suite, please see doc/commands.rdoc (view on GitHub).

LIBRARY FEATURES:

Jetpants is also a Ruby module which you can use to build complex database migration scripts and other customized automation. It provides object modeling for databases, hosts, global/functional pools, sharded pools, and your database topology as a whole.

  • Utilize scriptable versions of all command suite functionality

  • Crawl replication topology programmatically

  • Import or export arbitrary portions of a data set

  • Copy large files quickly and efficiently, including to multiple simultaneous destinations. Flexibility in terms of single threaded copy or multi-threaded copy is provided based on the resources available (large network bandwidth, PCIe flash devices). Supporting scripts (jetpants_clone_sender and jetpants_clone_receiver) are present in bin/ directory.

  • Manipulate server settings or concurrently execute arbitrary UNIX commands / administrative MySQL queries on multiple servers

ASSUMPTIONS AND REQUIREMENTS:

Percona Toolkit of at least 2.2.15.

The base classes of Jetpants currently make a number of assumptions about your environment and database topology. Please see doc/requirements.rdoc (view on GitHub).

CONFIGURATION:

Jetpants supports a global configuration file at /etc/jetpants.yaml, as well as per-user configuration files at ~/.jetpants.yaml.

At least one of these files must exist for Jetpants to function properly, since certain options (database schema name, database credentials, etc) are mandatory and cannot be inferred.

Please see doc/configuration.rdoc (view on GitHub) for information on configuring Jetpants.

PLUGINS:

Jetpants offers an extensible plugin system. Plugins are Ruby code (such as stand-alone gems) that add to Jetpants by supplying callback methods, and/or overriding core methods.

It is highly recommended that you tie Jetpants into your site’s asset tracker / hardware management system by writing a custom plugin. This will allow Jetpants to automatically know what database pools and shards are present, and to make topological changes immediately be reflected in your site’s configuration. Several complex Jetpants features (including shard splits) actually require an asset tracker plugin in order to function, since these processes involve obtaining spare nodes and manipulating multiple pools in your database topology.

Other recommended uses of plugins include integration with your site’s monitoring system, trending system, query killers, and environment-specific overrides to various core methods.

If you are using Collins for asset management, Jetpants now ships with a plugin that offers integration. Please see doc/jetpants_collins.rdoc (view on GitHub) for usage.

For more information on how to write plugins and use the Jetpants::CallbackHandler system, please see doc/plugins.rdoc (view on GitHub)

FREQUENTLY ASKED QUESTIONS:

Please see doc/faq.rdoc (view on GitHub) for answers to common questions.

If you have a question that isn’t covered here, please feel free to email the authors at the addresses listed in jetpants.gemspec.

CREDITS:

  • Evan Elias: Creator and developer

  • Dallas Marlow: Developer

  • Bob Patterson Jr: Developer

  • Tom Christ: Developer

  • Tyler Neely: Developer

  • Kiril Angov: Developer

  • Amar Mudrankit: Developer

  • Duan Wang: Developer

  • Akshay Suryawanshi: Developer

  • Graham Christensen: Developer

Special thanks to Tim Ellis for testing and bug reports.

LICENSE:

Copyright 2013 Tumblr, Inc.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

More Repositories

1

Backboard

A motion-driven animation framework for Android.
Java
1,694
star
2

Graywater

An Android library for decomposing RecyclerView layouts to improve scroll performance.
Java
1,209
star
3

colossus

I/O and Microservice library for Scala
Scala
1,144
star
4

pytumblr

A Python Tumblr API v2 Client
Python
723
star
5

tumblr.js

JavaScript client for the Tumblr API
JavaScript
645
star
6

collins

groovy kind of love
Scala
572
star
7

Bookends

A UI widget for adding headers and footers to RecyclerView
Java
539
star
8

Remember

A preferences-backed key-value store
Java
523
star
9

policy

Tumblr policies and guidelines
453
star
10

laphs

Apple Live Photo support on the web, courtesy of Tumblr
JavaScript
447
star
11

TMTumblrSDK

Unopinionated and flexible library for easily integrating Tumblr data into your iOS or OS X application.
Objective-C
432
star
12

tumblr.php

Tumblr API v2 PHP Client
PHP
407
star
13

k8s-sidecar-injector

Kubernetes sidecar injection service
Go
343
star
14

kanvas-ios

Kanvas: a creation tool for iOS
Swift
315
star
15

jumblr

Tumblr API v2 Java Client
Java
277
star
16

gocircuit

Go
237
star
17

genesis

A tool for data center automation
Ruby
156
star
18

docker-registry-pruner

Tool to apply retention logic to docker images in a Docker Registry
Go
127
star
19

data-lasso

JavaScript
119
star
20

docs

Tumblr's public platform documentation.
107
star
21

XExtensionItem

Easier sharing of structured data between iOS applications and share extensions
Objective-C
88
star
22

PermissMe

Java
75
star
23

webpack-web-app-manifest-plugin

A webpack plugin that generates a PWA manifest and integrates with the assets JSON.
JavaScript
75
star
24

k8s-secret-projector

Kubernetes Secret generation from secure credential repos
Go
72
star
25

k8s-config-projector

Create Kubernetes ConfigMaps from configuration files
Go
65
star
26

tumblrclient.go

This is a concrete implementation of the ClientInterface with additional convenience methods defined right on the client object
Go
42
star
27

go-collins

Collins API Client in Go - https://tumblr.github.io/collins
Go
41
star
28

tumblr.go

This is a library which provides structs and functions for accessing the Tumblr API
Go
37
star
29

JXHTTP

you know, for networking
Objective-C
25
star
30

Spectacles

A tiny library for parsing JSON podspecs.
Objective-C
23
star
31

gulp-css-hashes

JavaScript
18
star
32

tsd_proxy

Clojure
15
star
33

tumblr-repl

REPL for the Tumblr API, built on tumblr.js
JavaScript
12
star
34

collins_shell

Ruby
3
star
35

consolr

Ruby
1
star
36

chorus-timekeeper

DI with timekeeping.
PHP
1
star
37

collins_notify

Ruby
1
star
38

collins_client

Ruby
1
star
39

collins_auth

Ruby
1
star
40

slackr_archiver

Ruby
1
star