DaDaBIK logo

Blog

Best practices for DaDaBIK applications development, part 1/2

Hello everybody,
during the last years, I have been involved in the design and development of some big and complex Web applications created with DaDaBIK.

They are BPM (Business Process Management) applications that typically:


  • automate some enterprise business processes / workflows in order to improve efficiency 

  • provide analytics / dashboards to keep monitored some aspects of the business.


While they are not open to the public (typically they are internal applications), they might have thousands of users that log-in daily to accomplish their jobs and quite big databases where all the related information is stored.

I would like to share with you what I consider some best practices when it comes to develop these kind of applications. In this first blog post, I will only talk about database design suggestions, in a second and last blog post I will talk about all the rest.

So the first rule is the following: spend an appropriate amount of time designing your database before starting the DaDaBIK configuration.

A lot of problems I see on complex DaDaBIK applications depend on poorly designed database. I know that sometimes you just get a legacy database and you have to deal with it but maybe the creation of a new application is the right moment to do some adjustment/refactoring. Here are my suggestions:


  1. Choose the right field types: this help data integrity and makes the DaDaBIK configuration faster (DaDaBIK uses the field type info to automatically set some parameters in form configurator). So, it sounds obvious but if you know that a field will only contain integer numbers, set it as INT (or SMALLINT, BIGINT, …) !

  2. Choose the right field names: if you are consistent with field names, you will never wonder how you called that particular field when you are adding some custom code, you just know it. It can also help the DaDaBIK configuration, not only because you immediately recognize the goal of your fields in the form configurator / permission managers but DaDaBIK also uses the names as an additional information (have you ever noticed that if you have a field called email_customer DaDaBIK automatically chooses email as content type?). 

  3. Set referential integrity constraints (foreign keys): again, this helps both data integrity and DaDaBIK: for a foreign key, DaDaBIK will automatically set a lookup field, without additional manual step in form configurator (this automatism, however, only works with MySQL at the moment).

  4. Indexing: this can help a lot with the performances of your final application. There is a lot to say about indexes but if you don't know much about the topic, here is a general and simplistic rule that works most of the time: if your users, for a table X, frequently search or sort for a particular field Y, you should index such field.

  5. Normalization: for this point, there would be a lot to say, but in a nutshell:

    • For each object (or, better, entity) of your application, create a table (e.g. products and customers are two entities, you need two tables)

    • If you have a 1-to-many relationship between two entities, add the primary key of the first table as an additional field of the second table and set the corresponding referential integrity constraint (foreign key); e.g. for each customer you can have many invoices, for each invoice one customer, so in the table invoices, you add the field id_customer as foreign key.

    • If you have a many-to-many relationship you need to create a new table to represent it, e.g. each author can write many books, the same book can be co-authored by many authors so you create a books_authors table having as fields id_author (foreign key) and id_book (also foreign key); the two fields, together, should be the primary key of the table books_authors (check, however, what I say in the last point "use auto-increment fields").

    • If you end up having a table with a huge number of fields, this might be the sign that something in the design of your db was wrong. This is not a rule, if your fields all describe properties of a specific entity, that's fine; however what I have seen several times in real world with legacy databases is that a table schema having many columns is the result of a bad design and the table can be split in two or more tables .

  6. Double check that you are actually using UTF-8 character encoding.

  7. Use auto-increment fields as primary keys. This is not a general database design advice, this is a DaDaBIK specific advice. This might change in the future but at the moment there are some features, such as after insert hooks or (insert) revisions that correctly work only if your table has an auto-increment field as primary key. Furthermore, if you have a table having a composite primary key (such as a table derived from a many-to-many relationship, see normalization before), consider that DaDaBIK cannot use it as unique field so you need to add an additional auto-increment field (for MySQL, this can be done automatically).


I hope this first set of simple rules can help you!

Best,

Eugenio Tacchini
DaDaBIK founder

V. 10.3 is out + Summer Survey

Hello everybody,
I am glad to announce the availability of DaDaBIK 10.3 Manarola.

This is a maintenance release, fixing a few issues. In particular, a security issue related to the use of a shared computer and two additional issues, the first related to select multiple fields and the second related to the less_equal_than search operator are something you should definitely go through. As usual, I advise to check all the change log

You can buy your license here .
As usual, if you already have a license, get your v. 10.3 copy from the upgrade page.

Since only a few files have been changed and since the new fast upgrade procedure is not ready yet, please find here the list of the files (program_files folder) that have been changed respect to version 10.2. This should make the upgrade process easier (you don't need to replace all the files, only the ones in the list, you still have to execute the last two steps of the upgrade instructions starting from running the upgrade.php script). This works only if you don't change edition (Pro, Enterprise, Platinum ... e.g. if you upgrade from 10.2 Pro to 10.3 Enterprise, this can't work).

/apps (the whole folder)
/include/business_logic.php
/include/header.php
/index.php
/install2.php
/upgrade2.php
/pwd.php
/version_first_installation
/views/details.php
/views/form.php
/views/results_grid.php

One more thing: the community of DaDaBIK users is growing year by year and I feel the need to understand something more about how you use DaDaBIK, in order to take better decisions in the future. I have created a very short (4 multiple choice questions) survey that you can access here:

https://dadabik.com/forum/list.php?3

Please have a look and spend two minutes to answer the four question!


Best,

Eugenio Tacchini
DaDaBIK founder

V. 10.2 is out: new calendar/date picker, new permissions copy feature, many important fixes

Hello everybody,
I am glad to announce the availability of DaDaBIK 10.2 Manarola.

This version contains two important new features, some other improvements and the fix for many issues.

Here are the two big features:

1) We have a new, modern and powerful calendar/date picker: flatpickr. This replaces the old jquery date picker (you can still use the old date picker by setting $date_picker_type in config.php) and provides several improvements including localization (the calendar uses the general language you chose for your DaDaBIK application) and user-friendly date format (you can show, in the edit form, something like May 12, 2020 even if the value you are sending to the server is 2020-05-12, see new config param $date_format_edit).

2) Table-to-Table permissions copy. This was the most upvoted feature in our canny and therefore I decided to implement it.
When you copy permissions from table A to table B, DaDaBIK identifies the fields that A and B have in common and copy the permissions, for all the groups, only for those fields. A typical use of this feature is when you create a view B starting from a table A (where the view B has the same fields table A has, or a subset of them) and you want to assign the same permissions.
This feature is for Enterprise/Platinum version only.

You can see both the new features in the sales management online demo (check the table orders to see an example of the new date picker)

Other improvements in the change log

About the issues fixed: the bug related to group-to-group copy permission (you probably heard about it if you are registered to this newsletter) made me go for a complete code revision (related to wildcard escaping) so in the changelog you will see a more complete description of the bug (that has been fixed) and the description of several other (related and not related) issues that have been fixed.

I strongly suggest to go through the change log ( to understand which issues your current DaDaBIK application might have) and to upgrade to this latest version.

Among the other things, a known bug, not fixed yet, has been added to the documentation, related to records having, has unique field value, a string containing particular characters. I would say that the vast majority of typical dadabik applications are not affected, but it is important to check that out.

You can buy your license here

As usual, if you already have a license, get your v. 10.2 copy from the upgrade page .

I hope you will have a great and safe summer!

Best,

Eugenio Tacchini
DaDaBIK founder

New upgrade procedure + Folding@home

Dear DaDaBIK community,
I hope that you and your beloved ones are still doing fine during this difficult period.

I am writing this email because some time ago I started to work on a long-awaited improvement: an easier upgrade procedure.

The general idea for the new procedure is:
1) you copy the zip file you download into an "upgrades" folder
2) you run the upgrade script, that should take care of everything

It's not a trivial thing to develop, it's full of tricky details and I would like to hear your comments, ideas, thoughts about it. I've created a post on the forum with some details and you can add your comments there:


Finally let me add something not related to DaDaBIK: this is a very difficult period all over the world and in the area where I live (north Italy) the impact of the virus has been particularly strong.

There are many ways we can contribute to the fight against COVID-19 (by donating money to the most under pressure hospitals in your area or all over the world, for example) and I think you all are aware of them.

I would like to add one little thing we all can do from our home, using our computers: download and install foldingathome.org to use the computational power of your computer to help research on COVID-19 and other diseases.

Maybe you can use foldingathome when your computer is idle or you have an old computer or other supported device that you can use (switching off the monitor to save electricity).

I've just created a DaDaBIK team on foldingathome and if you want, feel free to join it (Team ID 264163) to connect our little efforts.

Best,

Eugenio Tacchini
DaDaBIK founder

Low-Code Corner, a new YouTube Series

Dear DaDaBIK community,
first of all, I really hope that you and your beloved ones are doing fine during this very difficult period.

As probably most of you, I am spending my time at home and during the last week I started to work on a few things that I always postponed.

One of these things is a new YouTube series called "low-code corner": it's a series of short videos, each focused on a very specific aspect related to the development of a Web application using DaDaBIK, most of the times related to the questions I receive more often.

Every Monday morning I will post a new episode. If you want to keep updated on the videos, click on SUBSCRIBE and then hit the notification bell on YouTube , I won't send you an email for the next videos.

The first episode is related to the language translations / localization of a DaDaBIK application, including some advanced uses. You can watch the video here .

If you have any suggestions for the next episodes, send an email or post a comment on YouTube.

Stay home. Stay safe.

Eugenio Tacchini
DaDaBIK founder

Page 1 of 221 2 3 4 5 6 7 8 9 10 > >>