SlideShare a Scribd company logo
@SrcMinistry @MariuszGil
Time series databases
Data processing
4Developers: Time series databases
We are developers
Code
Write it
Test it
Release it
Where does our
responsibility end?
Devs vs SysAdmins
No man’s land
4Developers: Time series databases
Context…
The story
One app
10+ servers

Millions of users
Infra monitoring
Pro blems
What’s going on?
You can't manage what
you can't measure
W. Edwards Deming
Gather
2016-04-11 02:00:00 45
2016-04-11 03:00:00 42
2016-04-11 04:00:00 30
2016-04-11 05:00:00 46
2016-04-11 06:00:00 70
2016-04-11 07:00:00 120
Store
Present
4Developers: Time series databases
React
Low resolution
No context
Metrics
Metrics, values that
change over time
Matches everything
What should be
measured?
Everything what is
important for you
Tech
CPU / PV / reqs / resp_time
Business
KPIs / PV / UU
Why it should be
measured?
Insights
Time series
databases
Software system that’s
optimized for handling arrays
of numbers indexed by time
Wikipedia definition
Many solutions…
4Developers: Time series databases
4Developers: Time series databases
4Developers: Time series databases
4Developers: Time series databases
4Developers: Time series databases
Hello world
CREATE DATABASE test
SHOW DATABASES
name: databases
---------------
name
_internal
test
USE test
Using database test
INSERT clicks,type=cpc,source=ad-partner-1,paid=yes,widget=promo-box value=0.43
INSERT clicks,type=cpc,source=ad-partner-2,paid=yes,widget=promo-box value=0.50
INSERT clicks,type=cpc,source=ad-partner-1,paid=yes,widget=top value=0.62
INSERT clicks,type=cpm,source=ad-partner-1,paid=yes,widget=top value=0.80
SELECT * FROM clicks
name: clicks
------------
time paid source type value widget
1459850636770890539 yes ad-partner-1 cpc 0.43 promo-box
1459850643866389522 yes ad-partner-2 cpc 0.50 promo-box
1459850656407067481 yes ad-partner-1 cpc 0.62 top
1459850668781668282 yes ad-partner-1 cpm 0.80 top
SELECT COUNT(value), MEAN(value), MEDIAN(value) FROM clicks
WHERE time > NOW() - 2m GROUP BY time(5s)
name: clicks
------------
time count mean median
1459851275000000000 0
1459851280000000000 0
1459851285000000000 3 0.330 0.33
1459851290000000000 0
1459851295000000000 2 0.420 0.420
1459851300000000000 2 0.365 0.365
1459851305000000000 3 0.446 0.43
1459851310000000000 0
1459851315000000000 0
SELECT COUNT(value), MEAN(value), MEDIAN(value) FROM clicks
WHERE time > NOW() - 2m GROUP BY time(5s) FILL(0)
name: clicks
------------
time count mean median
1459851275000000000 0 0 0
1459851280000000000 0 0 0
1459851285000000000 3 0.330 0.33
1459851290000000000 0 0 0
1459851295000000000 2 0.420 0.420
1459851300000000000 2 0.365 0.365
1459851305000000000 3 0.446 0.43
1459851310000000000 0 0 0
1459851315000000000 0 0 0
Functions
Aggregrations
COUNT
DISTINCT
INTEGRAL
MEAN
MEDIAN
SPREAD
SUM
Selectors
BOTTOM
FIRST
LAST
MAX
PERCENTILE
TOP
Transformations
CEILING
DERIVATIVE
DIFFERENCE
FLOOR
HISTOGRAM
MOVING_AVERAGE
STDDEV
4Developers: Time series databases
Real world
Writing data
App
HTTP API
Graphite protocol
Collectd protocol
JSON+UDP
curl -i -XPOST 'http://localhost:8086/write?db=test' --data-binary
'cpu_load_short,host=server01,region=us-west value=0.64 1434055562000000000’
HTTP/1.1 204 No Content
Request-Id: 02e7757f-fb1e-11e5-809d-000000000000
X-Influxdb-Version: 0.11.0
Date: Tue, 05 Apr 2016 11:03:22 GMT
curl -G 'http://localhost:8086/query'
--data-urlencode "db=test"
--data-urlencode "q=SELECT value FROM cpu_load_short WHERE region='us-west'"
{"results":[{"series":[{"name":"cpu_load_short","columns":["time","value"],"values":
[["2015-06-11T20:46:02Z",0.64]]}]}]}
// create an array of points

$points = array(

new Point(

'test_metric', // name of the measurement

0.64, // the measurement value

['host' => 'server01', 'region' => 'us-west'], // optional tags

['cpucount' => 10], // optional additional fields

1435255849 // Time precision has to be set to seconds!

),

new Point(

'test_metric', // name of the measurement

0.84, // the measurement value

['host' => 'server01', 'region' => 'us-west'], // optional tags

['cpucount' => 10], // optional additional fields

1435255849 // Time precision has to be set to seconds!

)

);



// we are writing unix timestamps, which have a second precision

$result = $database->writePoints($points, Database::PRECISION_SECONDS);
Data model
$statsd = new LeagueStatsDClient();



$statsd->increment('web.pageview');

$statsd->decrement('storage.remaining');

$statsd->increment(array(

'first.metric',

'second.metric'

), 2);

$statsd->increment('web.clicks', 1, 0.5);
Counters
$statsd = new LeagueStatsDClient();



$statsd->gauge('api.logged_in_users', 123456);
Gauges
$statsd = new LeagueStatsDClient();



$statsd->timing('api.response_time', 23.1);
Timers
$statsd = new LeagueStatsDClient();



$userID = 23;



$statsd->set('api.unique_logins', $userID);
Sets
Data volume
4Developers: Time series databases
CREATE CONTINUOUS QUERY <cq_name>
ON <database_name>
[RESAMPLE [EVERY <interval>] [FOR <interval>]]
BEGIN
SELECT <function>(<stuff>)[,<function>(<stuff>)]
INTO <different_measurement>
FROM <current_measurement>
[WHERE <stuff>]
GROUP BY time(<interval>)[,<stuff>]
END
4Developers: Time series databases
Rsyslog
Rsyslog
Rsyslog
Possibilities!
App heart beat
Anomaly detection
4Developers: Time series databases
Monitoring with
existing stack
4Developers: Time series databases
Alternatives
Gather. Store.
Present. React.
No rocket science
Only rocket fuel
@SrcMinistry
Thanks!
@MariuszGil

More Related Content

PPTX
"Democratizing Big Data", Ami Gal, CEO & Co-Founder of SQream Technologies
PDF
Introduction to SQream and the IoT environment
PPT
Big Data: The Final Frontier
PDF
Application Metrics (with Prometheus examples)
PDF
Modern real-time streaming architectures
PPTX
Rent The Runway: Transitioning to Operations Driven Webservices
PDF
Getting started with amazon kinesis
PPTX
State of the Art Robot Predictive Maintenance with Real-time Sensor Data
"Democratizing Big Data", Ami Gal, CEO & Co-Founder of SQream Technologies
Introduction to SQream and the IoT environment
Big Data: The Final Frontier
Application Metrics (with Prometheus examples)
Modern real-time streaming architectures
Rent The Runway: Transitioning to Operations Driven Webservices
Getting started with amazon kinesis
State of the Art Robot Predictive Maintenance with Real-time Sensor Data

What's hot (7)

PPT
Hw09 Protein Alignment
PDF
Yahoo Enabling Exploratory Analytics of Data in Shared-service Hadoop Clusters
PPTX
High availability, real-time and scalable architectures
PDF
Processing 19 billion messages in real time and NOT dying in the process
PDF
Big Data Day LA 2016/ Big Data Track - Twitter Heron @ Scale - Karthik Ramasa...
ODP
Non-Relational Databases: This hurts. I like it.
PPTX
Ronan Corkery, kdb+ developer at Kx Systems: “Kdb+: How Wall Street Tech can ...
Hw09 Protein Alignment
Yahoo Enabling Exploratory Analytics of Data in Shared-service Hadoop Clusters
High availability, real-time and scalable architectures
Processing 19 billion messages in real time and NOT dying in the process
Big Data Day LA 2016/ Big Data Track - Twitter Heron @ Scale - Karthik Ramasa...
Non-Relational Databases: This hurts. I like it.
Ronan Corkery, kdb+ developer at Kx Systems: “Kdb+: How Wall Street Tech can ...
Ad

Viewers also liked (6)

PDF
Bartosz kowalik Shapeless Matrix
PDF
Bujok hazelcast 4developers
PDF
4Developers: Kacper Gunia- Embrace Events and let CRUD die
PDF
4Developers: Andrzej Wisłowski Użycie stosu Elastic (elasticsearch, logstash,...
PDF
4Developers: Piotr Limanowski- Multi{platform,paradigm} Programming
PDF
Polyglot Persistence
Bartosz kowalik Shapeless Matrix
Bujok hazelcast 4developers
4Developers: Kacper Gunia- Embrace Events and let CRUD die
4Developers: Andrzej Wisłowski Użycie stosu Elastic (elasticsearch, logstash,...
4Developers: Piotr Limanowski- Multi{platform,paradigm} Programming
Polyglot Persistence
Ad

Similar to 4Developers: Time series databases (20)

PDF
Influx db talk-20150415
PDF
Time Series Data with InfluxDB
PPTX
Why You Should NOT Be Using an RDBS for Time-stamped Data
PPTX
Why You Should NOT Be Using an RDBMS for Time-stamped Data
PDF
Influxdb and time series data
PDF
Paul Dix [InfluxData] The Journey of InfluxDB | InfluxDays 2022
PPTX
Need for Time series Database
PDF
InfluxDB 101 - Concepts and Architecture | Michael DeSa | InfluxData
PDF
Devoxx france 2015 influx db
PDF
Devoxx france 2015 influxdb
PDF
InfluxData Platform Future and Vision
PDF
OSA Con 2022 - Specifics of data analysis in Time Series Databases - Roman Kh...
PDF
Infrastructure Monitoring with Postgres
PDF
Metrics driven development 10.09.2014
PPTX
HBaseCon 2013: How (and Why) Phoenix Puts the SQL Back into NoSQL
PDF
Beautiful Monitoring With Grafana and InfluxDB
PDF
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
PDF
Measure your app internals with InfluxDB and Symfony2
PDF
Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...
PDF
Application Monitoring using Open Source: VictoriaMetrics - ClickHouse
Influx db talk-20150415
Time Series Data with InfluxDB
Why You Should NOT Be Using an RDBS for Time-stamped Data
Why You Should NOT Be Using an RDBMS for Time-stamped Data
Influxdb and time series data
Paul Dix [InfluxData] The Journey of InfluxDB | InfluxDays 2022
Need for Time series Database
InfluxDB 101 - Concepts and Architecture | Michael DeSa | InfluxData
Devoxx france 2015 influx db
Devoxx france 2015 influxdb
InfluxData Platform Future and Vision
OSA Con 2022 - Specifics of data analysis in Time Series Databases - Roman Kh...
Infrastructure Monitoring with Postgres
Metrics driven development 10.09.2014
HBaseCon 2013: How (and Why) Phoenix Puts the SQL Back into NoSQL
Beautiful Monitoring With Grafana and InfluxDB
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
Measure your app internals with InfluxDB and Symfony2
Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...
Application Monitoring using Open Source: VictoriaMetrics - ClickHouse

Recently uploaded (20)

PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Machine learning based COVID-19 study performance prediction
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Cloud computing and distributed systems.
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
Big Data Technologies - Introduction.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
A comparative analysis of optical character recognition models for extracting...
DOCX
The AUB Centre for AI in Media Proposal.docx
Network Security Unit 5.pdf for BCA BBA.
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Diabetes mellitus diagnosis method based random forest with bat algorithm
Programs and apps: productivity, graphics, security and other tools
Machine learning based COVID-19 study performance prediction
Agricultural_Statistics_at_a_Glance_2022_0.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Digital-Transformation-Roadmap-for-Companies.pptx
Cloud computing and distributed systems.
Assigned Numbers - 2025 - Bluetooth® Document
Big Data Technologies - Introduction.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
20250228 LYD VKU AI Blended-Learning.pptx
A comparative analysis of optical character recognition models for extracting...
The AUB Centre for AI in Media Proposal.docx

4Developers: Time series databases