How to set a dynamic background image

You can use the image parallax effect without the use of background image.

Add a flexbox container and give it a parralax-container class.

Then add an image inside of the container and you can set the Image src as a dynamic attribute value your database.

Then tick Image Parallax under Dynamic Attributes of the image.

Finally you need to apply some CSS:

.parallax-container {
  height: 340px;
  position: relative;
}

.parallax-container img {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
  -o-object-position: 50% 50%;
     object-position: 50% 50%;
}

You can alter the css for your needs.