Storing images in Weaviate

As a prototype, I was passing the base64 encoding of an image to a property in the record (‘i.e. imageData’). However, I think this might stress the Weaviate database, so I was wondering if it would be okay to store images in the Weaviate database this way.

Good morning @Tejas_Sharma,

If I understand you correct, you are looking to efficiently store images. It’s perfectly right approach to store images in Weaviate as base64. This is how the blob data type is intended to function

There is no specific file size limit for the blob data type in Weaviate, which means you can store large images. However, keep in mind that larger images may affect overall database performance, depending on your setup, the number of images stored and infrastructure.

If the concern is about stress on the DB in a heavy load production, then consider offload images to a storage such as AWS S3 and store references (URLs) in Weaviate instead. This way, the database handles smaller pieces of data, reducing memory and disk usage.

1 Like

Morning @Mohamed_Shahin , thanks for the response!

I’m particularly using the serverless cloud from the Weaviate console, so I’m curious how it would impact performance and how large the images would have to be. Generally, it’s users uploading images so I expect it to be from all shapes and sizes, but since Weaviate is handling the underlying storage and infrastructure, I wanted to know if my base64 implementation was safe.

Thanks for the doc link, I just saw it and it says base64 is safe to use, but just wanted to confirm if it would not degrade performance for all tenants if one tenant for example uploads a lot of really large images.

1 Like

@Tejas_Sharma

It’s indeed safe, and performance would depend on best practices and infrastructure to handle the load. However, I would highly recommend High Availability in Cloud to ensure reliability and performance, preventing stress on a single node.

If you face any issues or would like to run some checks, feel free to open a ticket with support@weaviate.io, and I’d be happy to review your cluster and recommend improvements if necessary.

1 Like

Oh I see, is this supported natively in the Weaviate serverless architecture?

@Tejas_Sharma when you create a cloud cluster, there is an option to turn on HA, which will set up a 3-node cluster in the cloud. I highly recommend enabling this for better performance and reliability.

1 Like