Privex Launches Steem Blockchain Database Service

What is SBDS?

SBDS stands for Steem Blockchain Database Service. It allows importing data from the STEEM blockchain into a MySQL database for fast and easy querying of data.

thumbnail_thumbnail.png

thumbnail_What are sbds (1).png

We did not create SBDS. It is an open source project created by Steemit Inc. developers (@sneak @layz3r @recrypto) and is available at https://github.com/steemit/sbds

We run a PUBLIC SERVER, on high quality hardware for developers to use. SBDS requires fast SSDs, and over 400GB of space, making it moderately expensive to run for a small project.

Why should I use it?

thumbnail_RPC VS SBDS (1).png

As you can see, SBDS is much faster for querying large sets of data from the blockchain.

We recommend a hybrid approach to your application (as is done by Steemit Inc's Jussi system), take recent/realtime data from RPC via websockets, while querying older data via SBDS.

Server Specs

CPUIntel(R) Xeon(R) CPU E3-1270 v3
RAM32gb DDR3
DISKS2x480gb SSDs in RAID 0 (for epic speeds)
NETWORK1gbps
LOCATIONGermany

Want a similar server for yourself? Check out our website @ www.privex.io. We sell Dedicated and Virtual servers for STEEM, SBD, LTC, and BTC located in Germany and the USA (more regions coming soon).

Connection Details

UserPassHostPort
steemsteemsbds.privex.io3306

!!! DISCLAIMER !!!

SBDS is BETA SOFTWARE. This means that it is not stable, and may sometimes stop syncing, or provide bad data. Please do not rely on it for anything mission critical. We'll do our best to keep it online, however it has hung randomly several times over the past few days.

We've found certain queries such as querying witness blocks extremely slow, and some tasks such as calculating post rewards are currently not possible. We hope that the SBDS developers work to improve these kind-of issues and make SBDS more versatile.

Connect to SBDS

We use MariaDB, which is mostly compatible with MySQL clients and libraries. In some cases you may experience issues, if you do, please try to use a MariaDB compatible client.

$ mysql -u steem -psteem -h sbds.privex.io steem

Get the structure of a table

MariaDB [steem]> show create table sbds_tx_account_creates;

| Table                   | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| sbds_tx_account_creates | CREATE TABLE `sbds_tx_account_creates` (
  `block_num` int(11) NOT NULL,
  `transaction_num` smallint(6) NOT NULL,
  `operation_num` smallint(6) NOT NULL,
  `timestamp` datetime DEFAULT NULL,
  `fee` decimal(20,6) NOT NULL,
  `creator` varchar(50) NOT NULL,
  `new_account_name` varchar(50) DEFAULT NULL,
  `owner_key` varchar(80) NOT NULL,
  `active_key` varchar(80) NOT NULL,
  `posting_key` varchar(80) NOT NULL,
  `memo_key` varchar(250) NOT NULL,
  `json_metadata` text DEFAULT NULL,
  `operation_type` enum('account_create') NOT NULL,
  PRIMARY KEY (`block_num`,`transaction_num`,`operation_num`),
  KEY `ix_sbds_tx_account_creates_timestamp` (`timestamp`),
  KEY `ix_sbds_tx_account_creates_block_num` (`block_num`),
  KEY `ix_sbds_tx_account_creates_operation_type` (`operation_type`),
  KEY `ix_sbds_tx_account_creates_creator` (`creator`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4

Example query (get all accounts created by AnonSteem after the account delegation changes in a recent HF)

MariaDB [steem]> select timestamp,new_account_name 
from sbds_tx_account_create_with_delegations 
where creator = 'anonsteem' and timestamp > '2017-11-01' limit 10;
+---------------------+------------------+
| timestamp           | new_account_name |
+---------------------+------------------+
| 2017-04-03 22:50:15 | anontest2343     |
| 2017-04-03 23:28:27 | anontest2350     |
| 2017-04-03 23:32:33 | anontest2351     |
| 2017-04-03 23:44:39 | anchovy          |
| 2017-04-03 23:44:45 | archdruid        |
| 2017-04-03 23:44:51 | paul.allen       |
| 2017-04-03 23:44:54 | freebornsociety  |
| 2017-04-04 03:23:42 | zhangyong        |
| 2017-04-04 03:23:51 | greenland        |
| 2017-04-04 05:04:33 | revregor         |
+---------------------+------------------+

Thanks for reading!

We hope to make more contributions to the Steem Community, along with smaller coins such as PeerPlays, GOLOS etc.

If you want to help us out, you can buy a server from https://www.privex.io - we accept STEEM, SBD, LTC, and BTC. Support your local STEEM businesses :)

Have any questions about our servers? Email us: sales [at] privex [dot] io, or message us on STEEMIT.CHAT and we'll be sure to help you out.

A big thank you to @timcliff who makes regular donations to help us keep our RPC server running (steemd.privex.io), to @malicered who designed the graphics for our post, and to @drakos who helped us to get SBDS working well.

H2
H3
H4
3 columns
2 columns
1 column
19 Comments