Hi All, I’m wondering what the best way to achieve this use case is:
So we currently have a relational MySQL DB which we want to migrate to Aerospike. So let’s say I have the following tables (for example):
What I want to do is now compact this if you like, so in Aerospike I have a record which contains a few bins of the
Items data, and then the
Users. At the moment I am considering writing those (which will be arrays) as JSON in bins in the record, so I will have something like this:
PK Bin1 Bin2 Devices Countries Users 1 this that ["1","2"] ["GB","US"] ["1", "8"]
Now I’m wondering a couple of things really…
- Is there a limit to the amount of JSON (or the length of a string I guess) that a single bin can hold in Aerospike?
- Is JSON the best way to go about this?
- Would this be better done using LLIST format for the Devices, Countries etc?
- If I use LLIST - is there a way in the PHP client to be able to run a query to return $records …
WHERE $myDevice IS IN LLIST 'Devices'kind of thing?
- Is LUA the best way to achieve this? In that should I be writing something which says ‘get all items for $thisDevice in $thisGeo’ - I’m not overly familiar with LUA but my initial thought is that this may be the best option.
Any other advice to try and achieve what I’m looking for?
Maybe this is one for @rbotzer and his vast knowledge of PHP / Aerospike