Views: 3824
Last Modified: 28.05.2021

The Information block module is considered as "heavily resource-demanding" for creating "lightweight" directories or storage of large data volumes (when module can behave sub-optimally). Now an option to create analog to iblocks (Highload blocks module), but a lot simpler and "lightweight" is available. New module is available from product version 14.0 and is written on the new core D7. Data structure for this module provides for use of high-load projects.

Note: Highload blocks and traditional information blocks are conceptually two different things. That's why there is no option to convert traditional iblocks into highload blocks. Technically, a mirroring structure can be created and data moved, however it makes sense only for a specific project, if required.

Highload blocks

Highload blocks - are fast listing directories, without hierarchy support, with limited property support. They could query the database, including via HandlerSocket and handle large volumes of data. Highload blocks store elements in their tables and use their own indexes.

Note: with exception to module Highload blocks, core D7 can query database via HandlerSocket for all ORM entities.

Previously, data was stored using the module that closed tables via Table Module design pattern. Highload blocks have additional layer called Table Data Gateway that supports all techniques for handling tables, with business logic located in expanding class.

Highload blocks is a logic for handling data, nothing more. For specific data use, developer must envisage implementation of business logic by the application itself. Accordingly, Highloadblock class must be expanded to implement this logic:

use Bitrix\Highloadblock as HL;
$hlblock   = HL\HighloadBlockTable::getById( # )->fetch();
$entity   = HL\HighloadBlockTable::compileEntity( $hlblock ); //class generation 
$entityClass = $entity->getDataClass();

class MyDomainObjectTable extends #entityClass# {
…//our project business logic, overview the contents of $entityClass and write it into #entityClass#
} 

Highload blocks advantages

  • Low overhead cost (PHP, less SQL queries).
  • Low risk of blockages in database: because data is are stored in respective tables, there is no unified, global table that can be blocked upon high loads (data retrieval and simultaneous import).
  • Thousands, millions entities, directories.
  • Reduce load on the database, hosting.

About performance and resources

Highloadblock is a middleware between user and ORM. OOP (object-oriented programming) leads to an increased use of memory and CPU, offering a more convenient and effective development process. Highloadblocks are intended for high-loads experienced by the system. Their advantages are in the area of architecture, allowing easier scalability, management and risk assessment.

Database handling is the specific advantage database handling. Developer receives:

  • separate tables for entities (can be noticeable when handling large volumes),
  • possibility to easy index assignment for necessary selections,
  • possibility to transparently use handlersocket that significantly reduces load to DBMS.


Chapter contents:


Courses developed by Bitrix24