Hacker Newsnew | past | comments | ask | show | jobs | submit | mehphp's commentslogin

I think you just convinced me to drop redis for my new project.

Definitely a premature optimization on my part.


We dropped Redis from a 4 year old app that had a rapidly growing userbase. Best choice ever. We never looked back once other than to think how annoying it was to have to deal with Redis in addition to Postgres.


Sincerely (Feel the need to add that given the tension around here in these comments), I'm curious how Redis was annoying. Can you give any detail/insight?


Every component takes work. You have to upgrade it, something goes wrong with tuning, you have to debug it, etc. It went wrong about once a month, somehow. I'm sure it was fixable, but time is a commodity, and not having it any more gives us more time to work on other things.

We can't get rid of Postgres, but since we run Postgres on GCP we really never even think about it.


“Dropping” something from a “new” project is premature optimization?

Wherever you go, there you are.


Presumably adding Redis to a new project with no performance issues (yet?) is the premature optimisation.


If you are optimizng for simplicity it may not be, as the use as a cache is much (much) more straightforward. Also, for a new project, I'd go with in-memory service-level cache as it outperforms both (in any metric) and can be easily replaced once the need arises.


I read it as dropping something that _had been_ a premature optimisation.


I was referring to adding redis prematurely


“Premature optimization” typically refers to optimizing before profiling. Ie optimizing in places that won’t help.

Is redis not improving your latency? Is it adding complexity that isn’t worth it? Why bother removing it?


I like to call cases like this "premature distribution." Or maybe you could call it "premature capacity." If you have an application running in the cloud with several thousand requests per day, you could probably really benefit from adding a service like Redis.

But when you have 0-10 users and 0-1000 requests per day, it can make more sense to write something more monolithic and with limited scalability. Eg, doing everything in Postgres. Caching is especially amenable to adding in later. If you get too far into the weeds managing services and creating scalability you might bogged down and never get your application in front of potential users in the first place.

Eg, your UX sucks and key features aren't implemented, but you're tweaking TTLs and getting a Redis cluster to work inside Docker Compose. Is that a good use of your time? If your goal is to get a functional app in front of potential users, probably not.


You probably don't need Redis until you have thousands of requests per minute, nevermind per day.


I'd go further and even say per second! Actually PG can still handle it, the main problem is that it has a more complex runtime that can spike. Backups? Background jobs doing heavy writes? Replication? Vacuum? Can tend to cause multisecond slowdowns which may be undesirable depending on your SLA. But otherwise it would be fine.


To be clear my question isn’t claiming redis isn’t premature optimization, but rather asking why the op thinks that it is. Being new doesn’t automatically mean that there is no need for latency sensitivity. Making that assumption could be just as premature. Ripping something out that is already working also takes time and the trade offs need to be weighed.


Can't respond for them of course but I didn't take the impression that it was already fully implemented, working, and functionally necessary. I took the impression they had started going down that path but it was still easy to bail. That's just a vibe though.

But I agree that it would be appropriate to start out that way in some projects.


I’m so bad at drawing it only had a 46% confidence level that it was a fish


Anecdotally, I didn’t get severe anxiety and panic attacks until immediately after trying mushrooms. I didn’t even have a bad trip, but the next day something was off and I never truly recovered from that.


Thank you for posting this. While not everyone's experience is the same, after hearing all the hype I was inching closer to trying this... but this confirms that it's not a magic bullet and there are dangers. I don't have any specific mental issues right now, so there's also probably no reason to try it. The only thing I wish for, at 45 yo, is to have a faster to adapt mind like I had when I was younger.


Yes, it’s a roll of the dice which is unfortunate because it was actually pretty fun and a quite profound experience.

I’m not saying people shouldn’t do it but just to proceed with caution and ideally under professional supervision.


I've did a bunch of recreational drugs growing up, but mushrooms were the only one that I swore off forever. It just didn't sit well with me and would lead to a ton of anxiety both during and after taking them.

I think it's too easy for people to get caught up in the idea that these are miracle cures and forget that, just like with any drug, the effects will be different for different people. I'd love for it to be available for people who are seeing benefits, but I don't think there's any shame in people saying, "that doesn't work for me"


Yes, the one time I've tried mushrooms it was a very unpleasant experience. For weeks I was left feeling like I had done some permanent damage to my mental health. I eventually got past that feeling and there might be a point I try them again, but not without professional guidance. Psilocybin is powerful and not a remotely recreational thing (for me at least.)


The first time I tried them, it was like I peaked behind the “curtain” in the Wizard of Oz, and knew even in that moment I’d never be able to unsee or forget it. It was the equivalent of being a child and realizing Santa didn’t actually exist.

Life as I had known it, the things that then animated me, were “shown” to be a pantomime - a joke. It was tremendously sad, and - for better or worse - I’ve never been the same since.

Maybe it was a coming of age experience - something I would have more painfully experienced later anyway. But it cost something significant. It changed me. Still, some 25 years later, I don’t know if it was for the better.


Similar. Was over a decade ago. Not easy, but gradually gets better. Sorry to hear about it, it's not something I'd wish on anyone.


I have way too much mental illness in my family to ever consider trying psychedelics.


Ditto. They contributed to long-term trashing the psyche of a relative and we have a really strong history of such issues, stuff like schizophrenia that they can trigger. It’s an under appreciated risk.


In general, even with genetically inherited disorders your chances of developing most conditions drop from 54% to less than 18% in low stress environments.

Epigenetics are weird, but if you are past 35 without symptoms than you should be fine without medication (know several people that weren't as lucky.)

Stay healthy friend =3


“18% chance you go from depressed to schizophrenic” (in reality this risk is going to vary across a distribution of risk) is still not favorable odds the way I see it.


I have a buddy that ended up in a ward, and still phones from time to time.

The 3rd generation medications keep his cycles under control fairly well. Note, prior to being processed by our medical system. These same a--hole sycophantic dealers would target vulnerable people with BS treatments all the time.

Talk with your doctor, get out for a walk every morning, and try out cognitive behavioral therapy when you are ready. =3

A funny post about what not to do:

https://www.youtube.com/watch?v=LO1mTELoj6o


I have a family member who has never been alright due to moderate psychedelic and heavy marijuana use in college. Maybe some people are fine, sure, and maybe this is even a rare outcome, but the denialism bothers me when I personally know that they can, at some unknown rate, turn someone schizophrenic and ruin his life. I wish we could get him treatment but he's not high-grade enough to be involuntarily committed but paranoid schizophrenics who hate and distrust their family don't respond well to "hey we should get you treatment."

I have a friend from college who smoked too much marijuana during lockdown back in India. Thankfully the insanity cleared up after a few weeks to a month clean of it, but not all are so lucky.

The denialism and propaganda campaigns bother me. As pro-legalization as I am, I personally have never and will never use drugs. They are dangerous and unnecessary, and I resent those who would influence others' decisions to do something high-risk and potentially very damaging because they want to get high.


I will up front say that while I advocate taking mushrooms to depressed people, and said so elsewhere, I would not recommend them to _young people_.

But I think you might be missing the forest for the trees: unlike mushrooms, there is a _ton_ of research on pot specifically that illustrates that heavy use in the young is extremely detrimental to their mental health, especially young men. The studies on psilocybin/psilocin do not show this.

That said, Michael Pollan has a quote in one of his books that foes along these lines: coming to psychedelics in old age, when you are set in your ways and everything is locked in, helps you break out and reconsider things, but young people don't have those things, so the value is mostly absent.


While I respect your opinion, I disagree mostly by observing the people I've known for decades.

Folks with maladaptive coping strategies tend not to age well, and it is unrelated to the specific pharmacological recreational preferences they have chosen.

Some people refuse help, and will despise folks for trying. =3

https://www.youtube.com/watch?v=jG4qp-2O3hs&list=RDjG4qp-2O3...


> I have a friend from college who smoked too much marijuana during lockdown back in India. Thankfully the insanity cleared up after a few weeks to a month clean of it, but not all are so lucky.

I would love to meet one of these people that lose their minds in such a short time on drugs. I know they exist but I just want to see the reality of it.


Some have genetic vulnerability to addictions, and others latent disorders do manifest.

Very common side-effect for people that try strong hallucinogens and or use malformed neurotransmitters.

The find-out part happens later =3


Many people with psychiatric challenges (both acute or chronic disorders) will often seek self-medication options. Marijuana is indeed a mild hallucinogen, but you are correct in that many hard drugs can trigger a psychotic episode. Often illegal dealers lace the stuff with addictive compounds that cause severe problems during withdrawal.

Having a family member with active untreated disorders can tilt the odds out of ones favor, but those with intellectual gifts also tend to be more resilient to such situations.

>The denialism and propaganda campaigns bother me

Understandable, after a few years people see the same excuses, exploitive scams, and rhetoric. The Sackler family ruined a lot of lives to capture that money, and I guess a few psychopaths saw a business opportunity.

Best of luck =3


> in low stress environments.

How many people live in low stress environments these days?


Even Elmo has changed:

https://www.youtube.com/watch?v=Rbk7leQdxbo

Go outside, stop watching media, and meet real people. lol =3


come on man, youre sat here posting on hacker news.... its all a bit jordan petersons 12-rules-for-someone-elses-life


waiting for the build... paid to wait... rather be golfing... lol =3


"there's an XKCD for everything"

https://xkcd.com/303/


Psychodelics allow brain to change, but the change is not guaranteed to be positive.


Exactly. This is why I hate it when psychonauts push the "there are no bad trips" angle. It's a lie, and psychedelics can have a long lasting negative impact on the brain in some cases.


Following the logic, though, it could be undone with a positive experience on psychedelics...


Or you could have further triggering experiences


I'd guess it falls in the category of "don't do that", along with things like using dd to overwrite your failing hard drive with a copy of your shiny new blank drive. You shouldn't take psychedelics therapeutically unless you're set up to have a good experience, I assume.

(I've heard that expectation of your experience actually influences your experience a lot, so it could even be self-fulfilling!)


I had this exact same experience. It felt like it opened the door to panic attacks, and I had a few of them in the years that followed.


And I've gotten far worse effects from weed than shrooms or LCD weirdly enough.


thanks for sharing that


I agree with all you’ve said but with regards to writing a dissertation for larger changes : have you tried letting it first right a plan for you as markdown (just keep this file uncommitted) and then let it build a checklist of things to do?

I find just referencing this file over and over works wonders and it respects items that were already checked off really well.

I can get a lot done really fast this way in small enough chunks so i know every bit of code and how it works (tweaking manually of course where needed).

But I can blow through some tickets way faster than before this way.


Seems like it but I’m not sure consciousness necessarily comes along for the ride with AGI.


Depends on the game for me, there are definitely games that I get $80 worth of value.


I had no idea what I was getting into with that book


Can you elaborate on the difference, I’m not sure I get it.


There's people that would be happy winning the lottery, and others that would be happier if they had worked for it.


I, for one, love to think about having a lot of money that I can spend on fun things. I do, however, not love coming up with schemes all day to actually transfer that money from someone else's pocket to mine first.


People want the "end result" of making money (having money), not the "process" of making money.

Say you make a startup, you "make money" by working hard for 5 years, but you "have money" only when you exit in the end.


For whatever reason norms/laws just don’t apply to Trump. He’s above the law; it’s baffling.


Yes exactly. Not sure why either. But laws do not apply to him, they never have, and they never will. He knows that, too.


The reason is he’s positioned himself perfectly to have shared benefit and shared destruction in many other’s incentive structures.


It's not baffling. He just thinks that laws don't apply to him.


To be fair the Supreme Court just gave him an out to all but the most heinous crimes conducted as "official acts". He can do almost anything he wants and not worry about going to prison, and he can pardon all of his underlings.


Sure, I’m not baffled that he think that, I’m baffled that society allows it.


I find if i eat an early breakfast, it is indeed hard to not eat after the 8 hours. I find the opposite to be quite easy though. Just skip breakfast and don’t eat until around 1. I get to look forward to food later while actually being hungry.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: