Support Topics Documentation Slack YouTube Blog

Cache related problem

(Rajasekhar Puligadda) #1

Getting issue " object cannot exceed 10240 bytes" while cache data using backendless

(Sergey Chupov) #2

There’s a hard limit for the size of each object in cache, and it’s exactly 10240 bytes. What kind of object are you trying to save? Probably you don’t need to store an object that big in cache.

(Rajasekhar Puligadda) #3

Actually i want to maintain cache for store geopoints data

(Sergey Chupov) #4

Can you provide an example object you’d like to store in JSON format here?

(Rajasekhar Puligadda) #5

{“objectId”:“0007E55F-CA4B-E39C-FFC3-86BFD6008707”,“categories”:[“EVENTS”],“metadata”:{“city”:“test city”,“event”:[{“place_name”:“test place”,“created”:1544696232420,“place_street_nr”:“test strret”,“event_subregion_id”:“ghfghfg”,“event_title”:“dfgdfgdf”,“ownerId”:null,“Horbehinderung”:false,“event_eventtype”:“test type”,“GeistigeBehinderung”:false,“place_zip”:12167,“datum2”:“Do, 17.10. 16-17 Uhr”,“Gehorlos”:false,“event_id”:119960,“Mobilitatsbehinderung”:true,“place_equip”:“sdfsdfsd”,“Sehbehinderung”:false,“updated”:null,“objectId”:“96F35BA9-EE8A-25AD-FFC3-1ACE3573B400”,"___class":“events”}]},“latitude”:52.449453461192,“longitude”:13.338511457672,"___class":“GeoPoint”}

(Rajasekhar Puligadda) #6

this is single one, i have many records in object

(Sergey Chupov) #7

The one you provided is way less than 10240 bytes (it is even less than 1000 bytes). Objects like this are totally fine to cache. It looks like you have some other object that is 10+ times bigger than this, and I guess you should split it before storing into cache.

(Rajasekhar Puligadda) #8

I have 20000 geopoints like above single record

(Sergey Chupov) #9

So you should store them into separate cache objects, not merge into one. How do you store them in your code?

(Rajasekhar Puligadda) #10

Actually now i am getting only 100 because of cloud version, event though it crosses 10240 bytes. I am trying to save the object into cache by converting into byte array and saving into cache but i am not able to get original object from byte array while getting from cache

(Sergey Chupov) #11

Well, you can purchase a function pack called “100 Cache Objects” to increase the number. This is just how it is now: the limit for a number of cache objects in Cloud 99 plan is 100, and the limit for a single object size is 10240 bytes. If you have any issues with this, I guess you could discuss it by writing to

(Rajasekhar Puligadda) #12

I have doubt regarding getting actual object from byte array while getting cache, i am not able to get that?

(Sergey Chupov) #13

It depends on how you serialize your object into byte array and how you deserialize it. Anyway, this is out of our support scope as it’s not directly related to Backendless. I’d say you don’t need to do that at all, since the object is serialized to bytes on the backend anyway before storing into cache, so you’re not likely to save the size by doing it manually. From your perspective it should look similar to this example in the doc, i.e. you just work with the class you’re trying to store or retrieve: