ignasl
Joined 12 years ago
Joined 12 years ago
You might ask why only 5? Turns out personal wall is not as easy to solve without significant time investment if you want to keep it performant too. Simply naively aggregating posts would be costly on database and wouldn't scale for sure and potentially wouldn't even perform on small scale. Some smart architecture with smart caching for each user wall seemed complicated for that project that is already too big for one person. But then I thought of using things I already use - mongodb and meteor.js. My architecture is quite simple: there are tracker doc collection where document contain 5(or X) latest posts in an array and every-time something is posted this tracker is updated. Then there is userFollows collection with docs to connect users with trackers. From there I allow meteor.js to handle the rest. Once it subscribes to trackers that user follows all the posts of those trackers are shown on the front page with the added advantage that any new post if transferred right away because of meteor's reactivity so front page is "real time". I also use redis-oplog package for meteor which caches collections server side and made this pretty performant and very easy to implement. It's not ideal but hopefully it will be good enough.
>the fact that not so long ago they were over 3 times higher
They never were. You can check futures price data here: https://www.investing.com/commodities/natural-gas On top of that you're probably talking about those spikes in 2005 and 2008, but they were short lived and spikes are natural for gas markets because of various circumstances (seasonality, pipeline situation, weather, how full are the reserves etc).
>not so long ago It was 13 years ago! And now it's the highest price since. The reason for such a ridiculously low prices for so long was shale gas extraction. Now US is losing this and more. Because natural gas prices are so sensitive (and react quickly!) to various things - you better hope for warm winter with decisions like these...
Also comparing prices in US and in other countries is intellectually dishonest or you simply don't know how natural gas market works.