Working only with styles can be rather limiting, depending on what you want to achieve.
The problem with styles is that they have a rigid interaction with fields.
This can be somewhat circumvented by using a field of type json which allows to specify complex data structures.
Doing this, however, increases the complexity for the person filling in the content.
If database interaction must be implemented that exeeds the capability of fields there is the possibility to create a component which is not a style. With such a component the interaction with the database can be fully customised and is not limited by style fields. However, there is a drawback: The content of such components cannot be managed by the CMS.
To create a custom component the following steps must be followed. Lets assume that the new component is called myComponent.
Make sure to create the new folder in the path server/component/ and also make sure to give the new folder the name of the component:
mkdir sever/component/myComponent
The only class that is required is the component class. However it is recommended to stick to the MCV pattern for reasons of separation of concerns and reusage of code.
The component class must be defined in a seperate file which must be placed in the component folder. Make sure that the class file uses the name of the component (with a capital first letter), postfixed with Component.php:
touch server/component/myComponent/MyComponentComponent.php
Finally a page needs to be created which will render myComponent.
In the CMS create a new page of type Component and name it myComponent.
For being able to select the page type Component the checkbox Advanced must be enabled.