Abstract-The multimedia databases are becoming more and more popular nowadays. One of their main problem is a huge data amount storage. Another problem with multimedia databases is querying. Traditional approaches, based on textual keywords are not sufficient. More advanced techniques, incorporating image content features, should be used. In this paper we propose new multimedia database structure with ability of Content Based Image Retrieval which is based on our previous work: Query by Shape method (QS). Query by Shape is a method which is based on decomposing an object into features. Each feature may consists of shape primitive, a color or a texture. In this paper we only use shape primitives. In order to achieve high scalability and workload control, we propose a modified Scalable Distributed Two-layer Data Structure, as a storage. The modification incorporates adding tree structure, comparing algorithm and returning a set of results to the client.