SlideShare a Scribd company logo
Aerospike 3
Configuration:
Basic Configuration
Part 2
Young Paik
Director of Sales Engineering
young@aerospike.com
Aerospike aer . o . spike [air-oh- spahyk]
noun, 1. tip of a rocket that enhances speed and stability
Aerospike
Configuration
Data Storage
Curriculum
This training module is an overview of the
Aerospike Database and covers the basic
configuration of a single Aerospike Database
Cluster.

This course has been split into 3 areas:
1. Overview*
2. Database Service Configuration*
3. Database Storage Configuration
* These parts were covered in the first part of the webinar series.
© 2014 Aerospike. All rights reserved. Confidential

Pg. 3
Agenda
Data Hierarchy
 How Aerospike reads/writes/updates data
 Defragmentation
 Data Hygiene
 Configuring Storage


© 2014 Aerospike. All rights reserved. Confidential

Pg. 4
Data Hierarchy
Cluster
Node 1

Node 3

Node 2

Namespace
Set

Record

Record

Bin

© 2014 Aerospike. All rights reserved. Confidential

Bin

Bin

Pg. 5
Database Hierarchy
Term

Definition

Notes

Cluster

An Aerospike cluster services a single
database service.

While a company may deploy multiple clusters,
applications will only connect to a single cluster.

Node

A single instance of an Aerospike
database.

For production deployments, a host should only
have a single node. For development, you may
place more than one node on a host.

Namespace

An area of storage related to the media.
Can be either RAM or SSD based.

Similar to a “database” or “tablespaces” in
relational databases.

Set

An unstructured grouping of data that
have some commonality.

Similar to “tables” in a relational database, but do
not require a schema.

Record

A key and all data related to that key.

Similar to a “row” in a relational database.

Bin

One part of data related to a key.

Bins in Aerospike are typed, but the same bin in
different records can have different types. Bins are
not required. Single bin optimizations are allowed.

© 2014 Aerospike. All rights reserved. Confidential

Pg. 6
Cluster
• Will be distributed on different nodes.
• Management of cluster is automated, so
no manual rebalancing or reconfiguration
is necessary.
• Will contain one or more namespaces.
Adding/removing namespaces requires a
cluster-wide restart.

© 2014 Aerospike. All rights reserved. Confidential

Pg. 7
Nodes
• Each node is assumed to be identical.
• Data (and their associated traffic) will be
evenly balanced across the nodes.
• Big differences between nodes imply a
problem.
• Node capacity should take into account
node failure patterns.

© 2014 Aerospike. All rights reserved. Confidential

Pg. 8
Namespaces
• Are associated with the storage media:
– Hybrid (ram for index and SSD for data)
– RAM + disk for persistence only
– RAM only

• Each can be configured with their own:
–
–
–
–

replication factor (change requires a cluster-wide restart)
RAM and disk configuration
settings for high-watermark
default TTL (if you have data that must never be automatically
deleted, you must set this to “0”)

© 2014 Aerospike. All rights reserved. Confidential

Pg. 9
Sets
• Similar to “tables” in relational
databases.
• Sets are optional.
• Schema does not have to be pre-defined.
• In order to request a record, you must
know its set.
• Scans can be done across a set

© 2014 Aerospike. All rights reserved. Confidential

Pg. 10
Records
• Similar to a row in a relational database.
• All data for a record will be stored on the
same node.
• Any change to a record will result in a
complete write of the entire record.
• Sometimes referred to as “objects”

© 2014 Aerospike. All rights reserved. Confidential

Pg. 11
Bins
• Values Are typed. Current types are:
– Simple (integer, string, blob [language specific])
– Complex (list, map)

• A single bin may be updated by the client.
– Increment
– Replacement
– User Defined Function (UDF)

© 2014 Aerospike. All rights reserved. Confidential

Pg. 12
Data Hierarchy
Cluster
Node 1

Node 3

Node 2

Namespace
Set

Record

Record

Bin

© 2014 Aerospike. All rights reserved. Confidential

Bin

Bin

Pg. 13
Data Access Patterns
How does Aerospike handle the following
operations
– Read
– Write*
– Update*

* The following slides do not illustrate how replica are written.
© 2014 Aerospike. All rights reserved. Confidential

Pg. 14
Accessing An Object In Aerospike
Reading A Standard Data Type With SSDs

Client

DRAM (Index)

Master Node

Index reference

SSD (DATA)
1) Client finds Master Node from
partition map.
2) Client makes read request to
Master Node.
3) Master Node finds data location
from index in DRAM.
4) Master Node reads entire object
from SSD. This is true even if only
reading bin.
5) Master Node returns value.

Block size (128 KB by default)

© 2014 Aerospike. All rights reserved. Confidential

Pg. 15
Accessing An Object In Aerospike
Writing A New Standard Data Type Record With SSDs

Client

Master Node

DRAM (Index)

SSD (DATA)
1) Client finds Master Node from
partition map.
2) Client makes write request to
Master Node.
3) Master Node make an entry indo
index (in DRAM) and queues write
in temporary write buffer.
4) Master Node coordinates write
with replica nodes (not shown).
5) Master Node returns success to
client.
6) Master Node asynchronously writes
data in blocks.
7) Index in DRAM points to location
on SSD.

Asynchronous write

Block size (128 KB by default)

© 2014 Aerospike. All rights reserved. Confidential

Pg. 16
Accessing An Object In Aerospike
Updating A Standard Data Type Record With SSDs

Client

Master Node

DRAM (Index)
New

SSD (DATA)
1) Client finds Master Node from
partition map.
2) Client makes update request to
Master Node.
3) Master Node reads the existing
record (if using multiple bins)
4) Master Node queues write of
updated record in a temporary
write buffer
5) Master Node coordinates write
with replica nodes (not shown).
6) Master Node returns success to
client.
7) Master Node asynchronously writes
data in blocks.
8) Index in DRAM points to new
location on SSD.

Old

New
Asynchronous write

Block size (128 KB by default)

© 2014 Aerospike. All rights reserved. Confidential

Pg. 17
Accessing An Object In Aerospike
How Space Is Freed Up
SSD (DATA)

Aerospike writes the data in large data
blocks.

1
2
3
4
5
6
7
8

Block size (128 KB by default)

© 2014 Aerospike. All rights reserved. Confidential

Pg. 18
Accessing An Object In Aerospike
How Space Is Freed Up
SSD (DATA)

As new data is added to the disk, new
blocks will be continually written to
the SSD.

1
2
3
4
5
6
7
8

Block size (128 KB by default)

© 2014 Aerospike. All rights reserved. Confidential

Pg. 19
Accessing An Object In Aerospike
How Space Is Freed Up
SSD (DATA)

Over time, some records will be
deleted or updated, resulting in
fragmented usage on the flash/SSD
disk. This unused space must be freed
up.

1
2
3
4
5
6
7
8

Block size

© 2014 Aerospike. All rights reserved. Confidential

Pg. 20
Accessing An Object In Aerospike
How Space Is Freed Up
SSD (DATA)

Some databases use a nightly process
called “compaction,” which is an
intensive process. Aerospike runs a
regular process (every few minutes) that
looks for blocks below some level of use
(called the high watermark).

1
2
3
4
5
6
7

In this example, if the high watermark is
50%, blocks 1 and 3 to the left are below
50% occupied. The defragmenter will
take the data in these blocks and merge
then into another block.

8

Block size

© 2014 Aerospike. All rights reserved. Confidential

Pg. 21
Accessing An Object In Aerospike
How Space Is Freed Up
SSD (DATA)

The defragmenter will get write the new
block (block 7) and clear up blocks 1 and
3 for new writes.

1
2
3
4

Because this runs constantly, there is no
special time where the performance of
the database is bad.

5
6
7
8

This algorithm operates best when the
SSD is less than 50% occupied. As disk use
grows above this, the performance of the
defragmenter will decrease.

Block size

© 2014 Aerospike. All rights reserved. Confidential

Pg. 22
Data Hygiene
Every database has a maximum capacity.
Aerospike provides you with a few tools to
manage the behavior of the database.
TTL (time-to-live) and Expiration
 High watermark and Eviction
 Stop-writes


© 2014 Aerospike. All rights reserved. Confidential

Pg. 23
TTL and Expiration
Aerospike has a mechanism for automatically
expiring data if it has not been changed in a
while.
In the configuration of the namespace you can set
a TTL (time-to-live). When the data has reached
its TTL limit, it will be automatically deleted
from the database.

© 2014 Aerospike. All rights reserved. Confidential

Pg. 24
TTL and Expiration
This works using the following logic:
• When a record is first written, the server will take the current
time and add the TTL. The server will use the default TTL as
configured on the server or, if supplied, an overriding TTL from the
client.
• If the record is updated the TTL will be extended as if it were a
new write. You can override this from the client.
• A “touch” from the client has the same impact, but does not
change the data.
• Reads do not affect the expiration time.
• When the expiration time has been reached a background job will
delete the data.

© 2014 Aerospike. All rights reserved. Confidential

Pg. 25
TTL and Expiration
Special Note:
If you do not want data to expire, but want to keep all data, you can set
the TTL value to 0.
However, if you have set the TTL to any non-zero value, it is not possible
to set any object to not expire.
As a workaround, you can set a very long TTL from the client.

© 2014 Aerospike. All rights reserved. Confidential

Pg. 26
High Watermarks and Eviction
One of the most dangerous things that can happen to a
database is to reach maximum capacity.
Aerospike has a set of safety measures that will allow you
to minimize the chances of hitting that limit and taking
corrective action before then.

© 2014 Aerospike. All rights reserved. Confidential

Pg. 27
High Watermarks and Eviction
A high watermark is a threshold for RAM or disk use. When the
watermark has been breached, the server will begin to evict data. It
will start by evicting data closest to its TTL.
For example:
A namespace has a 90 day TTL. The server automatically deletes data
that has not been written in the past 90 data. The server hits the high
watermark for SSD usage. It will begin to delete data that is 89 days
from its TTL, then 88, etc.

© 2014 Aerospike. All rights reserved. Confidential

Pg. 28
Stop Writes
Suppose data is being written/changed in the
database at such a rate that the evictions cannot
keep up.
It is possible for the database to use more and
more space until it hits 100% usage. In order to
prevent data loss, Aerospike has a mark called
“stop-writes.” When the database usage hits this
level, the database will stop writing new data.
The server will respond with an error to new
write requests.
© 2014 Aerospike. All rights reserved. Confidential

Pg. 29
Configuring Storage
Configuration File
There are 7 major stanzas in an Aerospike
configuration file.









service (required, covered in Part 1)
logging (required, covered in Part 1)
network (required, covered in Part 1)
mod-lua (required for 3.x, covered in Part 1)
cluster (optional, not covered)
namespace (at least 1 required)
xdr (optional, not covered)

These will look like this:
namespace <NAMESPACE NAME> {
...
}

© 2014 Aerospike. All rights reserved. Confidential

Pg. 31
Special Note

Parameters that are most commonly problematic
are denoted in RED. Pay special attention to
these, since the ramifications of improperly
setting these variables may take months to show
up or be difficult to fix once set.

© 2014 Aerospike. All rights reserved. Confidential

Pg. 32
Namespace Configuration Parameters
There are 2 different kinds of namespaces:
o
o

RAM (with or without HDD for persistence)
Flash/SSD

Each namespace type has specific parameters,
but some are common to all of them.

© 2014 Aerospike. All rights reserved. Confidential

Pg. 33
Namespace Parameters: Common Parameters
Some of the parameters for namespaces are
common for all types.
Parameters covered:






Replication factor
Watermarks
DRAM allocation
Time-to-live (TTL)

© 2014 Aerospike. All rights reserved. Confidential

Pg. 34
Replication Factor
Description

The total (master + replica) copies of data in the database
cluster.

Stanza location

namespace

Config parameters
(defaults)

replication-factor

Notes

Some databases refer to the replication factor as being only the
number of copies, without the master. Aerospike refers to it as
the total number of copies.

Change dynamically

No

Best practices

For almost all use cases, the best replication factor is “2”.
“1” would not give any replication and means that the loss of a
node means a loss of data.
“3” or more would mean you would need additional storage to
accommodate the additional copies.

© 2014 Aerospike. All rights reserved. Confidential

Pg. 35
Storage Watermarks
Description

Aerospike has built in a set of watermarks that trigger actions
meant to act as safety valves.

Stanza location

namespace

Config parameters
(defaults)

high-water-memory-pct
high-water-disk-pct
stop-writes-pct

Notes

These features do not exist in most other databases, so some care should
be taken to understand how these work. If either the high-water-memorypct or high-water-disk-pct, the server will begin to evict data closest to its
time-to-live (TTL). If the either RAM or disk should exceed the stopwrites-pct, the server will no longer accept write requests for new records
(note that it will accept updates to existing records).

Change dynamically

Yes

Best practices

•

•
•

•

Recommended settings are:
•
high-water-memory-pct 60
•
high-water-disk-pct 50
•
stop-writes-pct 90
You should always account for changes in node could within the
cluster. So consider what happens if you were to lose a node.
These settings are dynamically changeable, if you do want to increase
these values temporarily, makes sure to take the appropriate
corrective action.
In order to properly defragment Flash/SSD namespaces, keep the highwater-disk at 50.

© 2014 Aerospike. All rights reserved. Confidential

Pg. 36
RAM Allocation
Description

All namespaces (whether RAM or Flash/SSD) require RAM for at
least the index. This controls how much RAM is allocated.

Stanza location

namespace

Config parameters
(defaults)

memory-size (4G)

Notes

The minimum size for this is 1 GB. Aerospike uses exactly 64
bytes of memory for each record. This will be multiplied by the
replication factor.
If you are using a RAM namespace, all data will also be stored
in RAM. Aerospike does not cache data.

Change dynamically

Yes

Best practices

Since each namespace uses at least 1 GB, do not configure
unused namespaces.
Always be aware that the amount of RAM in use will increase if
the cluster loses a node.
The amount of memory set here should also take into account
the high water marks for memory above.

© 2014 Aerospike. All rights reserved. Confidential

Pg. 37
Namespace Configuration: Common Parameters
The general configuration parameters for every namespace are:
namespace test_namespace {
replication-factor 2
high-water-memory-pct 60
high-water-disk-pct 50
stop-writes-pct 90
memory-size 4G
default-ttl 2592000
...
}

# TODO: Default 30 days expiration (1 day=86400)

© 2014 Aerospike. All rights reserved. Confidential

Pg. 38
Data Storage In RAM (No persistence)
RAM namespaces with no persistence stores all
data and indexes in RAM.
The configuration parameters are:
➤ Replication factor*
➤ Watermarks*
➤ RAM allocation*
➤ Time-to-live (TTL)*
 Storage Engine
*See the Data Storage Common Parameters above.

© 2014 Aerospike. All rights reserved. Confidential

Pg. 39
Storage Engine for RAM (No Persistence)
Description

Sets how data will be stored.

Stanza location

namespace

Config parameters
(defaults)

storage-engine memory

Notes

Aerospike does not cache. So all data (index + data) will be
stored in RAM.

Change dynamically

No

Best practices

Be sure to take into consideration what will happen if you lose
one or more nodes. See the Storage Watermark section above.

© 2014 Aerospike. All rights reserved. Confidential

Pg. 40
Namespace Configuration: Common Parameters
The general configuration parameters for every namespace are:
namespace test_namespace {
replication-factor 2
high-water-memory-pct 60
high-water-disk-pct 50
stop-writes-pct 90
memory-size 4G
default-ttl 2592000
storage-engine memory
}

# TODO: Default 30 days expiration (1 day=86400)

© 2014 Aerospike. All rights reserved. Confidential

Pg. 41
Data Storage In RAM + HDD
RAM namespaces with persistence (RAM +HDD)
stores all data and indexes in RAM, but stores the
data on disk. Note that although we say “HDD,”
you may also use SSDs.
The configuration parameters are:
➤ All the values from Data Storage in RAM above
 Storage Engine
 Persistence File
 Whether or not to load at startup
 Whether or not to store data in memory
© 2014 Aerospike. All rights reserved. Confidential

Pg. 42
Storage Engine for RAM + HDD (With Persistence)
Description

Sets how data will be stored.

Stanza location

namespace

Config parameters
(defaults)

storage-engine device

Notes

Aerospike does not cache. So all data (index + data) will be
stored in RAM. The device will only be used for persistence and
will only be used when starting up the node. The server will use
this to rebuild the index in memory.

Change dynamically

No

Best practices

Be sure to take into consideration what will happen if you lose
one or more nodes. See the Storage Watermark section above.

© 2014 Aerospike. All rights reserved. Confidential

Pg. 43
RAM + HDD Persistence File
Description

These are the settings for the persistence file

Stanza location

namespace:storage-engine

Config parameters
(defaults)

file or device
filesize

Notes

When using a file, you specify the path of the file. When using
the device, you specify the device (such as “/dev/sdb1”) of the
disk or partition. You must also specify the filesize.
When using device, the server assumes it will use the entire
disk, so please make sure there is no data on this partition.

Change dynamically

No

Best practices

•

•

Aerospike recommends setting the size of the persistence
file at 8x the amount of RAM allocated in the “memorysize” of the namespace.
You may use more than one file or device, but the server
will balance between them.

© 2014 Aerospike. All rights reserved. Confidential

Pg. 44
Load At Startup Option
Description

Determines whether or not the server should read from
persistence to load data.

Stanza location

namespace:storage-engine

Config parameters
(defaults)

load-at-startup (false)

Notes

When set to true, the server will read from the persistence
store and build up the primary index in RAM.
When set to false, the server will disregard any data in the
persistence store and get data from the other nodes.

Change dynamically

No

Best practices

•
•

Aerospike recommends setting this to be true.
If the node has been offline for long enough (many hours or
longer), the server will have to deal with data conflicts. It
will take less time to get the data from the other nodes. In
this case, you should set the value to “false”. However,
after the server has started, change the value in the config
file to “true” again to deal with short-term outages.

© 2014 Aerospike. All rights reserved. Confidential

Pg. 45
Store Data In Memory
Description

Tells the server to store data in memory, rather than on
storage.

Stanza location

namespace:storage-engine

Config parameters
(defaults)

data-in-memory

Notes

When set to “true”, the server will store data in RAM and use
disk only for persistence.
If set to “false”, the server will only store the index in RAM and
use the disk for data storage.

Change dynamically

No

Best practices

•

In principle it is possible to use rotational disk to store the
data and use RAM only for the index. Aerospike has found
that performance with this configuration is very poor.
Aerospike does not recommend or support this
configuration.

© 2014 Aerospike. All rights reserved. Confidential

Pg. 46
Namespace Configuration: Common Parameters
The configuration parameters for RAM + HDD are:
namespace RAM_persist_namespace {
replication-factor 2
high-water-memory-pct 60
high-water-disk-pct 50
stop-writes-pct 90
memory-size 4G
default-ttl 2592000
# TODO: Default 30 days expiration (1 day=86400)
storage-engine device {
file /opt/aerospike/data/test.data
filesize 32G
load-at-startup true
data-in-memory true
}
}

© 2014 Aerospike. All rights reserved. Confidential

Pg. 47
Data Storage In Flash/SSD
Flash/SSD namespaces store indexes in RAM and
all data on Flash/SSD.
The configuration parameters are:
➤ Common Data Storage Parameters
 Storage Engine
 Flash/SSD Devices
 Whether or not to load at startup
 Whether or not to store data in memory
*See the Data Storage Common Parameters above.
© 2014 Aerospike. All rights reserved. Confidential

Pg. 48
Storage Engine for Flash/SSD
Description

Sets how data will be stored.

Stanza location

namespace

Config parameters
(defaults)

storage-engine device

Notes

The server will use RAM for index only and Flash/SSD for data.

Change dynamically

No

Best practices

•

•

Be sure to take into consideration what will happen if you
lose one or more nodes. See the Storage Watermark section
above.
Flash/SSDs should be no more than 50% full to allow for
efficient defragmentation. Usage at above this rate is fine
for short periods of time.

© 2014 Aerospike. All rights reserved. Confidential

Pg. 49
Flash/SSD Devices
Description

These are the settings for the Fash/SSD devices

Stanza location

namespace:storage-engine

Config parameters
(defaults)

device

Notes

You must specify the device (such as /dev/sdb) of the SSDs.

Change dynamically

No

Best practices

•
•

You may use more than one file or device, but the server
will balance between them. Do not use heterogeneously
sized devices.
You may use SATA or PCIe devices.

© 2014 Aerospike. All rights reserved. Confidential

Pg. 50
Load At Startup Option
Description

Determines whether or not the server should read from
persistence to load data.

Stanza location

namespace:storage-engine

Config parameters
(defaults)

load-at-startup (false)

Notes

When set to true, the server will read from the persistence
store and build up the primary index in RAM.
When set to false, the server will disregard any data in the
persistence store and get data from the other nodes.

Change dynamically

No

Best practices

•
•

Aerospike recommends setting this to be true.
If the node has been offline for long enough (many hours or
longer), the server will have to deal with data conflicts. It
will take less time to get the data from the other nodes. In
this case, you should set the value to “false”. However,
after the server has started, change the value in the config
file to “true” again to deal with short-term outages.

© 2014 Aerospike. All rights reserved. Confidential

Pg. 51
Store Data In Memory
Description

Tells the server to store data in memory, rather than on
storage.

Stanza location

namespace:storage-engine

Config parameters
(defaults)

data-in-memory

Notes

When set to “true”, the server will store data in RAM and use
disk only for persistence.
If set to “false”, the server will only store the index in RAM and
use the disk for data storage.

Change dynamically

No

Best practices

•
•
•

In principle it is possible to use Flash/SSD as persistence
only. However, most modern rotational hard drives are fast
enough so that using Flash/SSD is not necessary.
The drives must be cleared or “dd”ed prior to use in the
database.
Be sure to test the drives in the servers using the Aerospike
ACT test tool (http://aerospike.github.io/act/).

© 2014 Aerospike. All rights reserved. Confidential

Pg. 52
Write Block Size
Description

Tells the server what block size to use when writing data.

Stanza location

namespace:storage-engine

Config parameters
(defaults)

write-block-size

Notes

The value for this must be a multiple of 128 KB. Aerospike has
tested these up to 1 MB. No single record can be larger than
this block size, so size this according to the maximum size in
the database.

Change dynamically

No

Best practices

Size these according to the largest size of any object in your
database.

© 2014 Aerospike. All rights reserved. Confidential

Pg. 53
Namespace Configuration: Common Parameters
The configuration parameters for RAM + HDD are:
namespace ssd_namespace {
replication-factor 2
high-water-memory-pct 60
high-water-disk-pct 50
stop-writes-pct 90
memory-size 4G
default-ttl 2592000
storage-engine device {
device /dev/sdb
device /dev/sdc
load-at-startup true
data-in-memory false
write-block-size 128K
}
}

# TODO: Default 30 days expiration (1 day=86400)

© 2014 Aerospike. All rights reserved. Confidential

Pg. 54
Agenda






Data Hierarchy
How Aerospike reads/writes/updates data
Defragmentation
Data Hygiene
Configuring Storage

© 2014 Aerospike. All rights reserved. Confidential

Pg. 55
Q&A
Thank You
Send any questions/comments/complaints to

Young Paik
young@aerospike.com

More Related Content

PPTX
Aerospike Architecture
PPTX
Configuring Aerospike - Part 1
PPTX
Redis vs Aerospike
PPT
Aerospike: Key Value Data Access
PDF
Aerospike Hybrid Memory Architecture
PPTX
Aerospike Architecture
PPTX
Introduction to Aerospike
PPTX
Getting The Most Out Of Your Flash/SSDs
Aerospike Architecture
Configuring Aerospike - Part 1
Redis vs Aerospike
Aerospike: Key Value Data Access
Aerospike Hybrid Memory Architecture
Aerospike Architecture
Introduction to Aerospike
Getting The Most Out Of Your Flash/SSDs

What's hot (20)

PDF
Building a SIMD Supported Vectorized Native Engine for Spark SQL
PDF
Grafana introduction
PDF
Etsy Activity Feeds Architecture
PDF
PostgreSQL High Availability in a Containerized World
PDF
[Meetup] a successful migration from elastic search to clickhouse
PDF
PostgreSQL replication
PPTX
Where is my bottleneck? Performance troubleshooting in Flink
PDF
Sql server 2019 new features
PDF
DPDK & Layer 4 Packet Processing
PPTX
A Technical Introduction to WiredTiger
PDF
Developing a user-friendly OpenResty application
PDF
Parquet performance tuning: the missing guide
PPTX
How we solved Real-time User Segmentation using HBase
PDF
HTTP Analytics for 6M requests per second using ClickHouse, by Alexander Boc...
PDF
Altinity Quickstart for ClickHouse-2202-09-15.pdf
ODP
Block Storage For VMs With Ceph
PDF
Spark + Parquet In Depth: Spark Summit East Talk by Emily Curtin and Robbie S...
PDF
Scalability, Availability & Stability Patterns
PPTX
Ceph Introduction 2017
Building a SIMD Supported Vectorized Native Engine for Spark SQL
Grafana introduction
Etsy Activity Feeds Architecture
PostgreSQL High Availability in a Containerized World
[Meetup] a successful migration from elastic search to clickhouse
PostgreSQL replication
Where is my bottleneck? Performance troubleshooting in Flink
Sql server 2019 new features
DPDK & Layer 4 Packet Processing
A Technical Introduction to WiredTiger
Developing a user-friendly OpenResty application
Parquet performance tuning: the missing guide
How we solved Real-time User Segmentation using HBase
HTTP Analytics for 6M requests per second using ClickHouse, by Alexander Boc...
Altinity Quickstart for ClickHouse-2202-09-15.pdf
Block Storage For VMs With Ceph
Spark + Parquet In Depth: Spark Summit East Talk by Emily Curtin and Robbie S...
Scalability, Availability & Stability Patterns
Ceph Introduction 2017
Ad

Similar to Configuring Aerospike - Part 2 (20)

PPT
fdocuments.in_aerospike-key-value-data-access.ppt
PDF
Aerospike meetup july 2019 | Big Data Demystified
PDF
Aerospike AdTech Gets Hacked in Lower Manhattan
PDF
You Snooze You Lose or How to Win in Ad Tech?
PDF
Real Time Big Data (w/ NoSQL)
PPTX
Flash Economics and Lessons learned from operating low latency platforms at h...
PDF
Handling Increasing Load and Reducing Costs Using Aerospike NoSQL Database - ...
PDF
Brian Bulkowski. Aerospike
PPTX
Aerospike TCO Vs memory-first architectures
PDF
Aerospike DB and Storm for real-time analytics
PDF
Storm Persistence and Real-Time Analytics
PDF
Developing for Real-time_Art Anderson.pdf
PPT
Predictable Big Data Performance in Real-time
PDF
Aerospike Today and Tomorrow Product Roadmap 2023_Lenley Hensarling.pdf
PPT
Big Data Learnings from a Vendor's Perspective
PDF
Art of the Possible_Tim Faulkes.pdf
PPTX
IMC Summit 2016 Breakout - Brian Bulkowski - NVMe, Storage Class Memory and O...
PDF
Aerospike Meetup - Introduction - Ami - 04 March 2020
PPTX
Countdown to Zero - Counter Use Cases in Aerospike
PDF
What enterprises can learn from Real Time Bidding (RTB)
fdocuments.in_aerospike-key-value-data-access.ppt
Aerospike meetup july 2019 | Big Data Demystified
Aerospike AdTech Gets Hacked in Lower Manhattan
You Snooze You Lose or How to Win in Ad Tech?
Real Time Big Data (w/ NoSQL)
Flash Economics and Lessons learned from operating low latency platforms at h...
Handling Increasing Load and Reducing Costs Using Aerospike NoSQL Database - ...
Brian Bulkowski. Aerospike
Aerospike TCO Vs memory-first architectures
Aerospike DB and Storm for real-time analytics
Storm Persistence and Real-Time Analytics
Developing for Real-time_Art Anderson.pdf
Predictable Big Data Performance in Real-time
Aerospike Today and Tomorrow Product Roadmap 2023_Lenley Hensarling.pdf
Big Data Learnings from a Vendor's Perspective
Art of the Possible_Tim Faulkes.pdf
IMC Summit 2016 Breakout - Brian Bulkowski - NVMe, Storage Class Memory and O...
Aerospike Meetup - Introduction - Ami - 04 March 2020
Countdown to Zero - Counter Use Cases in Aerospike
What enterprises can learn from Real Time Bidding (RTB)
Ad

More from Aerospike, Inc. (15)

PDF
2017 DB Trends for Powering Real-Time Systems of Engagement
PPTX
WEBINAR: Architectures for Digital Transformation and Next-Generation Systems...
PPTX
Leveraging Big Data with Hadoop, NoSQL and RDBMS
PDF
Using Databases and Containers From Development to Deployment
PDF
01282016 Aerospike-Docker webinar
PPTX
There are 250 Database products, are you running the right one?
PPTX
The role of NoSQL in the Next Generation of Financial Informatics
PPTX
Tectonic Shift: A New Foundation for Data Driven Business
PPTX
How to Get a Game Changing Performance Advantage with Intel SSDs and Aerospike
PDF
What the Spark!? Intro and Use Cases
PDF
Get Started with Data Science by Analyzing Traffic Data from California Highways
PPTX
Running a High Performance NoSQL Database on Amazon EC2 for Just $1.68/Hour
PPTX
ACID & CAP: Clearing CAP Confusion and Why C In CAP ≠ C in ACID
PPTX
Aerospike: Maximizing Performance
PPTX
Distributing Data The Aerospike Way
2017 DB Trends for Powering Real-Time Systems of Engagement
WEBINAR: Architectures for Digital Transformation and Next-Generation Systems...
Leveraging Big Data with Hadoop, NoSQL and RDBMS
Using Databases and Containers From Development to Deployment
01282016 Aerospike-Docker webinar
There are 250 Database products, are you running the right one?
The role of NoSQL in the Next Generation of Financial Informatics
Tectonic Shift: A New Foundation for Data Driven Business
How to Get a Game Changing Performance Advantage with Intel SSDs and Aerospike
What the Spark!? Intro and Use Cases
Get Started with Data Science by Analyzing Traffic Data from California Highways
Running a High Performance NoSQL Database on Amazon EC2 for Just $1.68/Hour
ACID & CAP: Clearing CAP Confusion and Why C In CAP ≠ C in ACID
Aerospike: Maximizing Performance
Distributing Data The Aerospike Way

Recently uploaded (20)

PPTX
Cloud computing and distributed systems.
PDF
Empathic Computing: Creating Shared Understanding
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
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
A Presentation on Artificial Intelligence
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Approach and Philosophy of On baking technology
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
Cloud computing and distributed systems.
Empathic Computing: Creating Shared Understanding
Building Integrated photovoltaic BIPV_UPV.pdf
Unlocking AI with Model Context Protocol (MCP)
NewMind AI Weekly Chronicles - August'25 Week I
Spectral efficient network and resource selection model in 5G networks
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
The AUB Centre for AI in Media Proposal.docx
Understanding_Digital_Forensics_Presentation.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Network Security Unit 5.pdf for BCA BBA.
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
A Presentation on Artificial Intelligence
Digital-Transformation-Roadmap-for-Companies.pptx
Approach and Philosophy of On baking technology
MYSQL Presentation for SQL database connectivity
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Advanced methodologies resolving dimensionality complications for autism neur...

Configuring Aerospike - Part 2

  • 1. Aerospike 3 Configuration: Basic Configuration Part 2 Young Paik Director of Sales Engineering young@aerospike.com Aerospike aer . o . spike [air-oh- spahyk] noun, 1. tip of a rocket that enhances speed and stability
  • 3. Curriculum This training module is an overview of the Aerospike Database and covers the basic configuration of a single Aerospike Database Cluster. This course has been split into 3 areas: 1. Overview* 2. Database Service Configuration* 3. Database Storage Configuration * These parts were covered in the first part of the webinar series. © 2014 Aerospike. All rights reserved. Confidential Pg. 3
  • 4. Agenda Data Hierarchy  How Aerospike reads/writes/updates data  Defragmentation  Data Hygiene  Configuring Storage  © 2014 Aerospike. All rights reserved. Confidential Pg. 4
  • 5. Data Hierarchy Cluster Node 1 Node 3 Node 2 Namespace Set Record Record Bin © 2014 Aerospike. All rights reserved. Confidential Bin Bin Pg. 5
  • 6. Database Hierarchy Term Definition Notes Cluster An Aerospike cluster services a single database service. While a company may deploy multiple clusters, applications will only connect to a single cluster. Node A single instance of an Aerospike database. For production deployments, a host should only have a single node. For development, you may place more than one node on a host. Namespace An area of storage related to the media. Can be either RAM or SSD based. Similar to a “database” or “tablespaces” in relational databases. Set An unstructured grouping of data that have some commonality. Similar to “tables” in a relational database, but do not require a schema. Record A key and all data related to that key. Similar to a “row” in a relational database. Bin One part of data related to a key. Bins in Aerospike are typed, but the same bin in different records can have different types. Bins are not required. Single bin optimizations are allowed. © 2014 Aerospike. All rights reserved. Confidential Pg. 6
  • 7. Cluster • Will be distributed on different nodes. • Management of cluster is automated, so no manual rebalancing or reconfiguration is necessary. • Will contain one or more namespaces. Adding/removing namespaces requires a cluster-wide restart. © 2014 Aerospike. All rights reserved. Confidential Pg. 7
  • 8. Nodes • Each node is assumed to be identical. • Data (and their associated traffic) will be evenly balanced across the nodes. • Big differences between nodes imply a problem. • Node capacity should take into account node failure patterns. © 2014 Aerospike. All rights reserved. Confidential Pg. 8
  • 9. Namespaces • Are associated with the storage media: – Hybrid (ram for index and SSD for data) – RAM + disk for persistence only – RAM only • Each can be configured with their own: – – – – replication factor (change requires a cluster-wide restart) RAM and disk configuration settings for high-watermark default TTL (if you have data that must never be automatically deleted, you must set this to “0”) © 2014 Aerospike. All rights reserved. Confidential Pg. 9
  • 10. Sets • Similar to “tables” in relational databases. • Sets are optional. • Schema does not have to be pre-defined. • In order to request a record, you must know its set. • Scans can be done across a set © 2014 Aerospike. All rights reserved. Confidential Pg. 10
  • 11. Records • Similar to a row in a relational database. • All data for a record will be stored on the same node. • Any change to a record will result in a complete write of the entire record. • Sometimes referred to as “objects” © 2014 Aerospike. All rights reserved. Confidential Pg. 11
  • 12. Bins • Values Are typed. Current types are: – Simple (integer, string, blob [language specific]) – Complex (list, map) • A single bin may be updated by the client. – Increment – Replacement – User Defined Function (UDF) © 2014 Aerospike. All rights reserved. Confidential Pg. 12
  • 13. Data Hierarchy Cluster Node 1 Node 3 Node 2 Namespace Set Record Record Bin © 2014 Aerospike. All rights reserved. Confidential Bin Bin Pg. 13
  • 14. Data Access Patterns How does Aerospike handle the following operations – Read – Write* – Update* * The following slides do not illustrate how replica are written. © 2014 Aerospike. All rights reserved. Confidential Pg. 14
  • 15. Accessing An Object In Aerospike Reading A Standard Data Type With SSDs Client DRAM (Index) Master Node Index reference SSD (DATA) 1) Client finds Master Node from partition map. 2) Client makes read request to Master Node. 3) Master Node finds data location from index in DRAM. 4) Master Node reads entire object from SSD. This is true even if only reading bin. 5) Master Node returns value. Block size (128 KB by default) © 2014 Aerospike. All rights reserved. Confidential Pg. 15
  • 16. Accessing An Object In Aerospike Writing A New Standard Data Type Record With SSDs Client Master Node DRAM (Index) SSD (DATA) 1) Client finds Master Node from partition map. 2) Client makes write request to Master Node. 3) Master Node make an entry indo index (in DRAM) and queues write in temporary write buffer. 4) Master Node coordinates write with replica nodes (not shown). 5) Master Node returns success to client. 6) Master Node asynchronously writes data in blocks. 7) Index in DRAM points to location on SSD. Asynchronous write Block size (128 KB by default) © 2014 Aerospike. All rights reserved. Confidential Pg. 16
  • 17. Accessing An Object In Aerospike Updating A Standard Data Type Record With SSDs Client Master Node DRAM (Index) New SSD (DATA) 1) Client finds Master Node from partition map. 2) Client makes update request to Master Node. 3) Master Node reads the existing record (if using multiple bins) 4) Master Node queues write of updated record in a temporary write buffer 5) Master Node coordinates write with replica nodes (not shown). 6) Master Node returns success to client. 7) Master Node asynchronously writes data in blocks. 8) Index in DRAM points to new location on SSD. Old New Asynchronous write Block size (128 KB by default) © 2014 Aerospike. All rights reserved. Confidential Pg. 17
  • 18. Accessing An Object In Aerospike How Space Is Freed Up SSD (DATA) Aerospike writes the data in large data blocks. 1 2 3 4 5 6 7 8 Block size (128 KB by default) © 2014 Aerospike. All rights reserved. Confidential Pg. 18
  • 19. Accessing An Object In Aerospike How Space Is Freed Up SSD (DATA) As new data is added to the disk, new blocks will be continually written to the SSD. 1 2 3 4 5 6 7 8 Block size (128 KB by default) © 2014 Aerospike. All rights reserved. Confidential Pg. 19
  • 20. Accessing An Object In Aerospike How Space Is Freed Up SSD (DATA) Over time, some records will be deleted or updated, resulting in fragmented usage on the flash/SSD disk. This unused space must be freed up. 1 2 3 4 5 6 7 8 Block size © 2014 Aerospike. All rights reserved. Confidential Pg. 20
  • 21. Accessing An Object In Aerospike How Space Is Freed Up SSD (DATA) Some databases use a nightly process called “compaction,” which is an intensive process. Aerospike runs a regular process (every few minutes) that looks for blocks below some level of use (called the high watermark). 1 2 3 4 5 6 7 In this example, if the high watermark is 50%, blocks 1 and 3 to the left are below 50% occupied. The defragmenter will take the data in these blocks and merge then into another block. 8 Block size © 2014 Aerospike. All rights reserved. Confidential Pg. 21
  • 22. Accessing An Object In Aerospike How Space Is Freed Up SSD (DATA) The defragmenter will get write the new block (block 7) and clear up blocks 1 and 3 for new writes. 1 2 3 4 Because this runs constantly, there is no special time where the performance of the database is bad. 5 6 7 8 This algorithm operates best when the SSD is less than 50% occupied. As disk use grows above this, the performance of the defragmenter will decrease. Block size © 2014 Aerospike. All rights reserved. Confidential Pg. 22
  • 23. Data Hygiene Every database has a maximum capacity. Aerospike provides you with a few tools to manage the behavior of the database. TTL (time-to-live) and Expiration  High watermark and Eviction  Stop-writes  © 2014 Aerospike. All rights reserved. Confidential Pg. 23
  • 24. TTL and Expiration Aerospike has a mechanism for automatically expiring data if it has not been changed in a while. In the configuration of the namespace you can set a TTL (time-to-live). When the data has reached its TTL limit, it will be automatically deleted from the database. © 2014 Aerospike. All rights reserved. Confidential Pg. 24
  • 25. TTL and Expiration This works using the following logic: • When a record is first written, the server will take the current time and add the TTL. The server will use the default TTL as configured on the server or, if supplied, an overriding TTL from the client. • If the record is updated the TTL will be extended as if it were a new write. You can override this from the client. • A “touch” from the client has the same impact, but does not change the data. • Reads do not affect the expiration time. • When the expiration time has been reached a background job will delete the data. © 2014 Aerospike. All rights reserved. Confidential Pg. 25
  • 26. TTL and Expiration Special Note: If you do not want data to expire, but want to keep all data, you can set the TTL value to 0. However, if you have set the TTL to any non-zero value, it is not possible to set any object to not expire. As a workaround, you can set a very long TTL from the client. © 2014 Aerospike. All rights reserved. Confidential Pg. 26
  • 27. High Watermarks and Eviction One of the most dangerous things that can happen to a database is to reach maximum capacity. Aerospike has a set of safety measures that will allow you to minimize the chances of hitting that limit and taking corrective action before then. © 2014 Aerospike. All rights reserved. Confidential Pg. 27
  • 28. High Watermarks and Eviction A high watermark is a threshold for RAM or disk use. When the watermark has been breached, the server will begin to evict data. It will start by evicting data closest to its TTL. For example: A namespace has a 90 day TTL. The server automatically deletes data that has not been written in the past 90 data. The server hits the high watermark for SSD usage. It will begin to delete data that is 89 days from its TTL, then 88, etc. © 2014 Aerospike. All rights reserved. Confidential Pg. 28
  • 29. Stop Writes Suppose data is being written/changed in the database at such a rate that the evictions cannot keep up. It is possible for the database to use more and more space until it hits 100% usage. In order to prevent data loss, Aerospike has a mark called “stop-writes.” When the database usage hits this level, the database will stop writing new data. The server will respond with an error to new write requests. © 2014 Aerospike. All rights reserved. Confidential Pg. 29
  • 31. Configuration File There are 7 major stanzas in an Aerospike configuration file.        service (required, covered in Part 1) logging (required, covered in Part 1) network (required, covered in Part 1) mod-lua (required for 3.x, covered in Part 1) cluster (optional, not covered) namespace (at least 1 required) xdr (optional, not covered) These will look like this: namespace <NAMESPACE NAME> { ... } © 2014 Aerospike. All rights reserved. Confidential Pg. 31
  • 32. Special Note Parameters that are most commonly problematic are denoted in RED. Pay special attention to these, since the ramifications of improperly setting these variables may take months to show up or be difficult to fix once set. © 2014 Aerospike. All rights reserved. Confidential Pg. 32
  • 33. Namespace Configuration Parameters There are 2 different kinds of namespaces: o o RAM (with or without HDD for persistence) Flash/SSD Each namespace type has specific parameters, but some are common to all of them. © 2014 Aerospike. All rights reserved. Confidential Pg. 33
  • 34. Namespace Parameters: Common Parameters Some of the parameters for namespaces are common for all types. Parameters covered:     Replication factor Watermarks DRAM allocation Time-to-live (TTL) © 2014 Aerospike. All rights reserved. Confidential Pg. 34
  • 35. Replication Factor Description The total (master + replica) copies of data in the database cluster. Stanza location namespace Config parameters (defaults) replication-factor Notes Some databases refer to the replication factor as being only the number of copies, without the master. Aerospike refers to it as the total number of copies. Change dynamically No Best practices For almost all use cases, the best replication factor is “2”. “1” would not give any replication and means that the loss of a node means a loss of data. “3” or more would mean you would need additional storage to accommodate the additional copies. © 2014 Aerospike. All rights reserved. Confidential Pg. 35
  • 36. Storage Watermarks Description Aerospike has built in a set of watermarks that trigger actions meant to act as safety valves. Stanza location namespace Config parameters (defaults) high-water-memory-pct high-water-disk-pct stop-writes-pct Notes These features do not exist in most other databases, so some care should be taken to understand how these work. If either the high-water-memorypct or high-water-disk-pct, the server will begin to evict data closest to its time-to-live (TTL). If the either RAM or disk should exceed the stopwrites-pct, the server will no longer accept write requests for new records (note that it will accept updates to existing records). Change dynamically Yes Best practices • • • • Recommended settings are: • high-water-memory-pct 60 • high-water-disk-pct 50 • stop-writes-pct 90 You should always account for changes in node could within the cluster. So consider what happens if you were to lose a node. These settings are dynamically changeable, if you do want to increase these values temporarily, makes sure to take the appropriate corrective action. In order to properly defragment Flash/SSD namespaces, keep the highwater-disk at 50. © 2014 Aerospike. All rights reserved. Confidential Pg. 36
  • 37. RAM Allocation Description All namespaces (whether RAM or Flash/SSD) require RAM for at least the index. This controls how much RAM is allocated. Stanza location namespace Config parameters (defaults) memory-size (4G) Notes The minimum size for this is 1 GB. Aerospike uses exactly 64 bytes of memory for each record. This will be multiplied by the replication factor. If you are using a RAM namespace, all data will also be stored in RAM. Aerospike does not cache data. Change dynamically Yes Best practices Since each namespace uses at least 1 GB, do not configure unused namespaces. Always be aware that the amount of RAM in use will increase if the cluster loses a node. The amount of memory set here should also take into account the high water marks for memory above. © 2014 Aerospike. All rights reserved. Confidential Pg. 37
  • 38. Namespace Configuration: Common Parameters The general configuration parameters for every namespace are: namespace test_namespace { replication-factor 2 high-water-memory-pct 60 high-water-disk-pct 50 stop-writes-pct 90 memory-size 4G default-ttl 2592000 ... } # TODO: Default 30 days expiration (1 day=86400) © 2014 Aerospike. All rights reserved. Confidential Pg. 38
  • 39. Data Storage In RAM (No persistence) RAM namespaces with no persistence stores all data and indexes in RAM. The configuration parameters are: ➤ Replication factor* ➤ Watermarks* ➤ RAM allocation* ➤ Time-to-live (TTL)*  Storage Engine *See the Data Storage Common Parameters above. © 2014 Aerospike. All rights reserved. Confidential Pg. 39
  • 40. Storage Engine for RAM (No Persistence) Description Sets how data will be stored. Stanza location namespace Config parameters (defaults) storage-engine memory Notes Aerospike does not cache. So all data (index + data) will be stored in RAM. Change dynamically No Best practices Be sure to take into consideration what will happen if you lose one or more nodes. See the Storage Watermark section above. © 2014 Aerospike. All rights reserved. Confidential Pg. 40
  • 41. Namespace Configuration: Common Parameters The general configuration parameters for every namespace are: namespace test_namespace { replication-factor 2 high-water-memory-pct 60 high-water-disk-pct 50 stop-writes-pct 90 memory-size 4G default-ttl 2592000 storage-engine memory } # TODO: Default 30 days expiration (1 day=86400) © 2014 Aerospike. All rights reserved. Confidential Pg. 41
  • 42. Data Storage In RAM + HDD RAM namespaces with persistence (RAM +HDD) stores all data and indexes in RAM, but stores the data on disk. Note that although we say “HDD,” you may also use SSDs. The configuration parameters are: ➤ All the values from Data Storage in RAM above  Storage Engine  Persistence File  Whether or not to load at startup  Whether or not to store data in memory © 2014 Aerospike. All rights reserved. Confidential Pg. 42
  • 43. Storage Engine for RAM + HDD (With Persistence) Description Sets how data will be stored. Stanza location namespace Config parameters (defaults) storage-engine device Notes Aerospike does not cache. So all data (index + data) will be stored in RAM. The device will only be used for persistence and will only be used when starting up the node. The server will use this to rebuild the index in memory. Change dynamically No Best practices Be sure to take into consideration what will happen if you lose one or more nodes. See the Storage Watermark section above. © 2014 Aerospike. All rights reserved. Confidential Pg. 43
  • 44. RAM + HDD Persistence File Description These are the settings for the persistence file Stanza location namespace:storage-engine Config parameters (defaults) file or device filesize Notes When using a file, you specify the path of the file. When using the device, you specify the device (such as “/dev/sdb1”) of the disk or partition. You must also specify the filesize. When using device, the server assumes it will use the entire disk, so please make sure there is no data on this partition. Change dynamically No Best practices • • Aerospike recommends setting the size of the persistence file at 8x the amount of RAM allocated in the “memorysize” of the namespace. You may use more than one file or device, but the server will balance between them. © 2014 Aerospike. All rights reserved. Confidential Pg. 44
  • 45. Load At Startup Option Description Determines whether or not the server should read from persistence to load data. Stanza location namespace:storage-engine Config parameters (defaults) load-at-startup (false) Notes When set to true, the server will read from the persistence store and build up the primary index in RAM. When set to false, the server will disregard any data in the persistence store and get data from the other nodes. Change dynamically No Best practices • • Aerospike recommends setting this to be true. If the node has been offline for long enough (many hours or longer), the server will have to deal with data conflicts. It will take less time to get the data from the other nodes. In this case, you should set the value to “false”. However, after the server has started, change the value in the config file to “true” again to deal with short-term outages. © 2014 Aerospike. All rights reserved. Confidential Pg. 45
  • 46. Store Data In Memory Description Tells the server to store data in memory, rather than on storage. Stanza location namespace:storage-engine Config parameters (defaults) data-in-memory Notes When set to “true”, the server will store data in RAM and use disk only for persistence. If set to “false”, the server will only store the index in RAM and use the disk for data storage. Change dynamically No Best practices • In principle it is possible to use rotational disk to store the data and use RAM only for the index. Aerospike has found that performance with this configuration is very poor. Aerospike does not recommend or support this configuration. © 2014 Aerospike. All rights reserved. Confidential Pg. 46
  • 47. Namespace Configuration: Common Parameters The configuration parameters for RAM + HDD are: namespace RAM_persist_namespace { replication-factor 2 high-water-memory-pct 60 high-water-disk-pct 50 stop-writes-pct 90 memory-size 4G default-ttl 2592000 # TODO: Default 30 days expiration (1 day=86400) storage-engine device { file /opt/aerospike/data/test.data filesize 32G load-at-startup true data-in-memory true } } © 2014 Aerospike. All rights reserved. Confidential Pg. 47
  • 48. Data Storage In Flash/SSD Flash/SSD namespaces store indexes in RAM and all data on Flash/SSD. The configuration parameters are: ➤ Common Data Storage Parameters  Storage Engine  Flash/SSD Devices  Whether or not to load at startup  Whether or not to store data in memory *See the Data Storage Common Parameters above. © 2014 Aerospike. All rights reserved. Confidential Pg. 48
  • 49. Storage Engine for Flash/SSD Description Sets how data will be stored. Stanza location namespace Config parameters (defaults) storage-engine device Notes The server will use RAM for index only and Flash/SSD for data. Change dynamically No Best practices • • Be sure to take into consideration what will happen if you lose one or more nodes. See the Storage Watermark section above. Flash/SSDs should be no more than 50% full to allow for efficient defragmentation. Usage at above this rate is fine for short periods of time. © 2014 Aerospike. All rights reserved. Confidential Pg. 49
  • 50. Flash/SSD Devices Description These are the settings for the Fash/SSD devices Stanza location namespace:storage-engine Config parameters (defaults) device Notes You must specify the device (such as /dev/sdb) of the SSDs. Change dynamically No Best practices • • You may use more than one file or device, but the server will balance between them. Do not use heterogeneously sized devices. You may use SATA or PCIe devices. © 2014 Aerospike. All rights reserved. Confidential Pg. 50
  • 51. Load At Startup Option Description Determines whether or not the server should read from persistence to load data. Stanza location namespace:storage-engine Config parameters (defaults) load-at-startup (false) Notes When set to true, the server will read from the persistence store and build up the primary index in RAM. When set to false, the server will disregard any data in the persistence store and get data from the other nodes. Change dynamically No Best practices • • Aerospike recommends setting this to be true. If the node has been offline for long enough (many hours or longer), the server will have to deal with data conflicts. It will take less time to get the data from the other nodes. In this case, you should set the value to “false”. However, after the server has started, change the value in the config file to “true” again to deal with short-term outages. © 2014 Aerospike. All rights reserved. Confidential Pg. 51
  • 52. Store Data In Memory Description Tells the server to store data in memory, rather than on storage. Stanza location namespace:storage-engine Config parameters (defaults) data-in-memory Notes When set to “true”, the server will store data in RAM and use disk only for persistence. If set to “false”, the server will only store the index in RAM and use the disk for data storage. Change dynamically No Best practices • • • In principle it is possible to use Flash/SSD as persistence only. However, most modern rotational hard drives are fast enough so that using Flash/SSD is not necessary. The drives must be cleared or “dd”ed prior to use in the database. Be sure to test the drives in the servers using the Aerospike ACT test tool (http://aerospike.github.io/act/). © 2014 Aerospike. All rights reserved. Confidential Pg. 52
  • 53. Write Block Size Description Tells the server what block size to use when writing data. Stanza location namespace:storage-engine Config parameters (defaults) write-block-size Notes The value for this must be a multiple of 128 KB. Aerospike has tested these up to 1 MB. No single record can be larger than this block size, so size this according to the maximum size in the database. Change dynamically No Best practices Size these according to the largest size of any object in your database. © 2014 Aerospike. All rights reserved. Confidential Pg. 53
  • 54. Namespace Configuration: Common Parameters The configuration parameters for RAM + HDD are: namespace ssd_namespace { replication-factor 2 high-water-memory-pct 60 high-water-disk-pct 50 stop-writes-pct 90 memory-size 4G default-ttl 2592000 storage-engine device { device /dev/sdb device /dev/sdc load-at-startup true data-in-memory false write-block-size 128K } } # TODO: Default 30 days expiration (1 day=86400) © 2014 Aerospike. All rights reserved. Confidential Pg. 54
  • 55. Agenda      Data Hierarchy How Aerospike reads/writes/updates data Defragmentation Data Hygiene Configuring Storage © 2014 Aerospike. All rights reserved. Confidential Pg. 55
  • 56. Q&A
  • 57. Thank You Send any questions/comments/complaints to Young Paik young@aerospike.com

Editor's Notes

  • #2: FastestBest uptimePredictable performanceconsistency