cassandra

package
v0.1.0-alpha.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2016 License: Apache-2.0 Imports: 6 Imported by: 2

README

Cassandra Resources

Consulting Notes

  • 200k column max per partition key (not the technical maximum but a rule of thumb max)
  • Beware seconary indexes - understand how they're implemented if you really want to use them
  • Beware "batch" writes, rather use a driver that is token aware (reads/writes directly to a node that owns the data) and round robins (shares the read/write load between replicas)
  • Use prepared statements
  • SSL between cassandra nodes has a large impact on performance
  • Use nodetool histograms to check on table performance
  • When you typically serve queries that read from more than 2 sstables, that's usually a problem
  • Backfilling is not possible with DTCS, must insert data roughly in time order for sstable compaction to work correctly.
  • Avoid gzip table compression, favor snappy and tune it to levels that make sense
  • Enterprise in-memory table is sold by DataStax
  • Look into cql tracing. At the driver you can specify to explain the query path and details. Many drivers you can configure cql tracing as a probability (e.g. trace 0.1% of queries)
  • Any write creates data, even if you're overwriting the same value. Old values are tombstoned and cleaned up on memtable flush or sstable compaction.

Online Resources

The SSTable File http://www.scylladb.com/kb/sstable-data-file/

Compaction strategies http://www.scylladb.com/kb/compaction/

DateTieredCompactionStrategy: Notes From the Field http://www.datastax.com/dev/blog/dtcs-notes-from-the-field

Apache Cassandra Compaction Strategies https://www.instaclustr.com/blog/2016/01/27/apache-cassandra-compaction/

Visualization on Compaction https://labs.spotify.com/2014/12/18/date-tiered-compaction/

DateTieredCompactionStrategy: Compaction for Time Series Data http://www.datastax.com/dev/blog/datetieredcompactionstrategy

Understanding the Impact of Cassandra Compact Storage http://blog.librato.com/posts/cassandra-compact-storage

Documentation

Overview

Package cassandra implements vulcan storage interfaces for persisting and reading datapoints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupTables

func SetupTables(hosts []string, keyspace string) error

SetupTables sets up the provided keyspace and creates table `uncompressed` on the provided Cassandra hosts.

Types

type DatapointReader

type DatapointReader struct {
	// contains filtered or unexported fields
}

DatapointReader represents an object that queries on the target Cassandra server and transforms the result to a Vulcan Datapoint.

func NewDatapointReader

func NewDatapointReader(config *DatapointReaderConfig) (*DatapointReader, error)

NewDatapointReader creates a new instance of DatapointReader.

func (*DatapointReader) ReadDatapoints

func (dpr *DatapointReader) ReadDatapoints(fqmn string, after, before bus.Timestamp) ([]bus.Datapoint, error)

ReadDatapoints implements storage.DatapointReader interface.

type DatapointReaderConfig

type DatapointReaderConfig struct {
	CassandraAddrs []string
	Keyspace       string
	Timeout        time.Duration
}

DatapointReaderConfig represents the configuration of a DatapointReader.

type SampleWriter

type SampleWriter struct {
	// contains filtered or unexported fields
}

SampleWriter represents an object that writes bus messages to the target Cassandra database.

func NewSampleWriter

func NewSampleWriter(config *SampleWriterConfig) (*SampleWriter, error)

NewSampleWriter creates a new instance of SampleWriter.

func (*SampleWriter) WriteSample

func (sw *SampleWriter) WriteSample(s *bus.Sample) error

WriteSample implements the storage.WriteSample interface.

type SampleWriterConfig

type SampleWriterConfig struct {
	CassandraAddrs []string
	Keyspace       string
	Timeout        time.Duration
}

SampleWriterConfig represents the configuration of a SampleWriter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL