MySQL clutering: innoDB or NDB storage engine?

Synergy Dave24 days ago

Hello,
I’ve just created a mysql MDB cluster with 1 management node, two data nodes and two sql nodes.
I’ve seen talks on the web about NDB being more performant than innoDB.
Does it matter for traccar if we use NDB cluster and storage engine?
Regards

Synergy Dave23 days ago

As a side note, we use traccar with forward feature and don’t use the traccar web ui. So not all db tables will be used which may require non NDB features like FULLTEXT.

Anton Tananaev23 days ago

Haven't tried it personally, but let us know how it works.

We don't have FULLTEXT indexes anywhere in the database, so that's not a problem.

Synergy Dave12 days ago

Hello,
after installing the mySQL NDB cluster and changed NDB to be the default engine, I create a traccar db and pointed traccar to use it.
All table creation failed due to the existing of varchar(4000) fields which exceed NDB engine max row size (limited to 14kb) while varchar(4000) is 4000*4 due to db character encoding.
Two solution;

  1. change all varchar(4000) to TEXT
  2. change db encoding to latin1 so row size is 4000*1 only

I tested option 2: CREATE DATABASE traccar
CHARACTER SET latin1
COLLATE latin1_general_ci;
now all tables are created but I wonder if this will have any affect on my setup where I'm using traccar with url forwarding. In my use case, users don't use traccar db. What I see, is the attributes field and I wonder if I'll need utf to store for example responses from devices ...

If my setup is valid, I'll test traccar in production with NDB cluster and report performance results.

I think that with NDB we'll need to use ClusterJ mysql driver. But I managed to make current jdbc driver to connect to SQL nodes like this:

<entry key='database.url'>jdbc:mysql://[10.10.1.140:3306,10.10.1.141:3306]/traccar?allowPublicKeyRetrieval=true&amp;useSSL=false&amp;serverTimezone=UTC&amp;allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode=''</entry>
Anton Tananaev12 days ago

Why do you need a database if you don't use it?

Synergy Dave11 days ago

I said I don’t use it because I’m not using default traccar web ui. But I think in all cases we need a database even with forward url, is this assumption incorrect? I think we’ll need it in case of traccar restart to retrieve last position and related attributes like total distance, will be used by api to send commands to devices.
Am I using forward url incorrectly? Please clarify.

Anton Tananaev11 days ago

To calculate distance correctly you would need a proper database, but then it means you do use the database, not just forwarding.

I think changing the encoding should be safe. Another option is to adjust the schema to have shorter fields.

Synergy Dave11 days ago

let me give it a try with the latin1 encoding and report results with NDB cluster.