To reduce database size, convert layout_builder__layout_section column to a hash of the content

Created on 2 March 2022, over 3 years ago
Updated 7 February 2023, over 2 years ago

Problem/Motivation

  • ๐Ÿ› layout_builder__layout_section column hitting database limit Needs work says that in some cases a single layout builder section record can contain >64kb of serialized data.
  • Every node revision creates a new record in the node_revision__layout_builder__layout table for each section, even for sections that have not changed.
  • This can lead to large database sizes.

Steps to reproduce

Proposed resolution

  • Create a new table that maps a hash (e.g., sha2) of the serialized section data to that data.
  • Store only that hash in the layout_builder__layout_section column.
  • An even further optimization would be to remove inline custom blocks' block_revision_id from the section data before generating the hash, and to have a separate database column containing those block revision ID values. That way, for the case where you edit the layout and the only edit made is to edit the fields of an inline custom block, then the new revision would generate the same section storage hash.

Remaining tasks

Discuss whether or not this is a good idea.

User interface changes

API changes

Data model changes

Release notes snippet

๐Ÿ› Bug report
Status

Active

Version

10.1 โœจ

Component
Layout builderย  โ†’

Last updated about 8 hours ago

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States effulgentsia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024