TheTree / Leaf

Leaf
http://leafapp.co
Other
8 stars 2 forks source link

Upgrader Script #37

Open iBotPeaches opened 10 years ago

iBotPeaches commented 10 years ago

Its useless trying to do all these "bad" standards in Leaf v3. We need to build the good foundation for Halo 5 / Destiny / Titanfall / whatever the hell gives us stats.

So these things need to go

0xdeafcafe commented 10 years ago

Mongo

Are you sure you want to keep using that? I've heard so about it corrupting once it hits a relatively large data.

iBotPeaches commented 10 years ago

I've done research into others like Foundation, Couch, Cassandra and RethinkDB.

Out of all of them. RethinkDB is coined as "Mongo without the problems", however its native plugin support for PHP is non-existent, so I'd have to write my own ORM to plug into Laravel so I don't have to write shitty code again.

As for the problems with Mongo. Those problems are rare, and nothing really happens except you loose all the last 1 minute of data as the memory hasn't paged back to disks yet. I don't have anything important that goes on there.

It could use some more research. Though Mongo has a huge community behind it, so I might just stick with it. Plowing the path with brand new stuff is difficult, but then again. If you write a driver for something, you are a pretty cool cat.

I'll see.

iBotPeaches commented 10 years ago

Note for myself.

Redis is absolutely amazing, but can't handle ties. I think to handle this, the below will work. Assuming the stock information

CSR | Name | KD
50 iBotPeaches 1.44
50 Pyrosquirrell 0.50
50 Major_Nelson 2.00

Redis is key-value, so we can only store csr and name. We can cheat this by appending the KD onto the number. However, this breaks because we can't split the number back up, because how do you know if 50.144 is a CSR 50 with a KD of 1.44 or 14.4. Obviously its not 14.4, but the problem still remains.

If you use 6 right padded zeros, with a 7th digit explaining the decimal point after CSR, it should work. That makes the above data.

50.1440001
50.0500000
50.2000001

1) CSR 50, last number is 1, therefore after CSR move decimal one point to get 1.44 kd 2) CSR 50, last number is 0, therefore .50 kd. 3) CSR 50, last number is 1, therefore 2 kd.

This should work. Will make unit-tests and confirm thoughts.