SteemSQL - Database updated and ready for SMTs

in steemsql •  4 months ago  (edited)

My work to prepare SteemSQL for the coming SMT and to revamp some table design is now complete.

In my previous post about SteemSQL database changes, I announced I will prepare SteemSQL's database for SMTs and taking the opportunity to also make additional modifications to improve the performance of SteemSQL for (d)Apps and processes that use SteemSQL.

1. New SMT transactions tables

On top of running on the mainnet, SteemSQL Database Injector has been running in parallel on the testnet to process SMT's operations.

A set of new tables has been created, each one corresponding to the different SMT related transactions that one will be able to issue:

  • TxSMTCreates
  • TxSMTSetRuntimeParameters
  • TxSMTSetSetupParameters
  • TxSMTSetupEmissions
  • TxSMTSetupICOTiers
  • TxSMTSetups

These tables will start to be populated as soon as SMT will be released. In the meantime, you can already take a look at it to get used to their structure.

For more information on the different fields contained in these tables, I invite you to read the excellent posts written by @howo on this subject here and here

2. Existing tables revamped

One of SteemSQL's weak points in terms of performance is the fact that many fields containing value for assets are stored in the database as character strings. This is mainly because, during the initial design of the database, I wanted to stick 1:1 to the structure of the data returned by the Steem nodes. And they return amounts as a numeric value followed by its symbol (ex: "1234.123 STEEM" or "654.456 SBD")

In its updated design, the database will now store assets value in two separate columns, the first one with the same name containing the numerical value and a second one suffixed with _symbol which will contain... the asset symbol ;)

Before:

columntypevalue
vesting_sharesvarchar(50)12345.678 VESTS

After:

columntypevalue
vesting_sharesnumeric(19,6)12345.678
vesting_shares_symbolvarchar(5)VESTS

This change will allow me to create additional indexes on assets columns to speed up the user's queries and lower resource usage on the server.

3. When these changes will occurs?

The new SMT tables are already available.

The switch to the new fields for assets columns will be put into production on 2020-01-31 at 20:00:00 UTC.

This gives about a week to anyone who relies on SteemSQL to adapt their processes.

If this deadline is still too short for you, SteemSQL will make the old content of the fields available for a week in an additional column prefixed with an x_ (ex: x_vesting_shares). This means that you can still run your processes, for a maximum of one week, by simply changing the name of the columns in your code. After one week, these x_ columns will be deleted!

Support

If you have any questions or need assistance with SteemSQL, support is provided on the dedicated SteemSQL channel on steem.chat,

You can also contact me directly on steem.chat, Discord or Telegram

Thanks for reading!


Support me and my work for the Steem community.

Vote for my witness

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Great!

cast(left(a.vesting_shares, len(vesting_shares)-6) as float)*RATE/1000000

will soon be

vesting_shares*RATE/1000000

A little easier to read and a bit quicker, although I'm sure it's not the bottleneck in most of my queries ;)

  ·  4 months ago (edited)

Something like that, yeah =)

BTW, you shouldn't underestimate string manipulation overhead when you apply it to thousands or millions of rows.

This is great news. Glad to see you are on top of things as always.

Now we just need some news about SMTs from Steemit Inc.

Posted via Steemleo

Thank you @taskmaster4450le

Tests for SMTs are still going on and the testnet has been crashed several times.
I really believe this will make it kind of bullet-proof. Better to crash it now than when put into production.

Something happen good steemit

Posted using Partiko Android

Thanks progres! Good proect!

Hi, @arcange!

You just got a 1.01% upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.

Good

Nice progress!

This is great news for the steemit community, steem adoption of SMT gives it a competitive advantage compared with the leading blockchains. My question is, how are you guys solving the problem of scalability?

On which aspects of the platform do you anticipate a scalability problem?

real time performance, i know steemit processes more transactions than any other blockchains, but with the launch of SMT there would be an increase in the number of transactions, so i’m just concerned on the real time performance.

  ·  4 months ago (edited)

If you look at blocktivity, you will see that Steem Capacity Utilization Index is at the bottom, which means that we have a lot of reserve in the network for a higher transaction volume.

image.png

We have already exceeded 2.5 million transactions per day (~ 3x the current volume) and performance was absolutely not a concern at that time, so I am not worried about scalability.

Thank you for your update @arcange.

Thks @arcange for the updates. Always on the edge.

Good news for all of us.

Great work @arcange - Thanks for all that you do!

Thank you =)

Looking forward to the future of steem.

Keep the good work guys

Posted using Partiko Android

The explanation is very technical, @arcange. I just hope Steem gets better going forward. Thanks a lot for sharing.

YOU COULDNT HACK A TOASTER

Great stuff youre the best

Dear @arcange

I've been wondering, what will be main difference between SMTs and SE (from user point of few) and I'm not sure if there will be many differences that would really matter.

I was already told that in order to purchase or sell SMT - one would still need to have his own account on STEEM blockchain. That first buyer will still need to purchase STEEM and only then trade it to SMT. Which means, that price of our tokens will still depend on price of STEEM. Any idea if it's true?

Yours
Piotr

You're right, from a pure user's point of view, there won't be many differences

Whether with SE or SMT, you will need a STEEM account anyway because SE uses Steem custom_json operations.

On Steem Engine, a user will need to buy STEEM then buy STEEMP(pegged/backed with STEEM) before being able to buy a SE token
With SMT, a user will be able to directly buy any token once he/she as STEEM.

Finally, saying that a token price depends on STEEM price is not both correct and incorrect. It depends on the intrinsic value of the token.

Let's say 1 TOKEN as a value of 1 STEEM and 1 STEEM is $1, so you basically can say that your TOKEN value is $1
Then the value of STEEM falls down to $0.5.
Without changing the intrinsic value of TOKEN, you now need 2 STEEM to buy 1 TOKEN (which still worth $1)
But if you consider TOKEN value kind of pegged to STEEM, then yes, its value is STEEM dependent.

Good news! Thank yoi!