4 ms·
Redis, Redis, again more about Redis .... From you people who know a lot about Redis, help me out here: For my Web site code (for my startup), I needed a key-
by graycat 3y ago
Redis, Redis, again more about Redis ....
From you people who know a lot about Redis, help me out here: For my Web site code (for my startup), I needed a key-value store. Soooo, it looks like I could use Redis for that.
But instead, wrote a little code using two instances of a Microsoft .NET collection class. Simple code. Plenty fast. Welcome programming exercise using .NET classes. Cheap -- no ongoing charges and no chance of charges in the future. And, no concerns about what might happen from politics, business, some remote service, etc.
Question: What am I missing by using my little DIY (do it yourself, roll your own) solution and avoiding Redis, work of other people, or a service from Amazon Web Services, etc.????
- rmbyrro 3y agoYou are presuming everyone has the same needs as you had when assessing Redis, which is a bit naive, if I may share my opinion.
- graycat 3y ago> You are presuming ... No, no, not at all: I admit, accept that no doubt Redis has a lot more functionality than the few pages of code I wrote. My question was: My code looks like it will do what I need done, but maybe I'm missing something, i.e., maybe Redis has some features that very likely I should have? If want to expand the question to other people, what is the chance that usually Redis is overkill, more functionality, code, complexity, considerations, ..., than needed? I don't know so am asking. Or, I had a 2 wheel drive car, but did I miss a lot not having a 4 wheel drive car that I nearly always used in only two wheel drive?
- JackSlateur 3y agoIf that is enough for you, then that is good You may need data persistence (keep the data live while you restart your process), cross-instance coherencies could be nice too, automatic data expiration too. But if you do not, then it is ok!
- graycat 3y agoThanks. My project had an interruption, and I'm getting back to the code. My code that needs a key-value store is simple, short, just uses two instances of a .NET collection class. I need NAT (network address translation) to keep affinity of each user with their one execution instance of my code, but I suspect that is automatic with Microsoft's IIS (Iinternet Information Server) that the code uses. For persistence, the code needs that only long enough for each user connection. And for performance, I don't need sharding across several servers acting like a cluster -- maybe that is some of what Redis supports. It appears that .NET has more functionality and performance potential (user connections per minute) than my project needs, so I'm trying not to try to master everything Google, Facebook, Amazon, a big bank, Walmart, etc. might need! So far, I'm pleased with .NET.
- junto 3y agoActually you want a ConcurrentDictionary, but that still wouldn’t provide you with a cluster across instances. https://learn.microsoft.com/en-us/dotnet/standard/collections/thread-safe/how-to-add-and-remove-items?redirectedfrom=MSDN https://learn.microsoft.com/en-us/dotnet/standard/collection...
- graycat 3y agoNice! Thanks! Looks like a nice .NET class! It's thread safe so that if my startup is more successful than I'm assuming then I'll be free to do less on how to exploit parallelism from several servers. As it is, the code I wrote serialized access to the key-value store I wrote. Sooo, that could be a performance bottleneck. I should review network address translation (NAT) and affinity of one user to some one server, instance of Microsoft's IIS (Internet information server), thread of execution, etc.
- neonsunset 3y agoPlease don't use IIS hosting. Use latest LTS version (.NET 8) and ASP.NET Core in Kestrel mode of hosting (which is default and cross-platform). This will save you a lot of headache and get the best experience.
- graycat 3y agoThanks! LTS and Kestrel are new to me! Just did a first Google search on them. Thanks! I'm the self-funded, sole/solo founder. So, I pay attention to the business, e.g., getting and pleasing the users, and also the computing. If successful, then getting paid for running ads, accounting, taxes, lawyers, floor space, employees, etc. So, for now, concentrating on pleasing the users. Part of that is some original applied math. Users won't be aware of any math, but the math should be secret sauce and an unfair advantage. So, am also concentrating on applying the math. For the software, trying to keep that simple. Had a disaster, but before that had the Web site running: Mid tower case ($40 with a $20 rebate), $65 motherboard, 8 core AMD processor with a 4.0 GHz standard clock ($100 at Amazon), Windows 7 Professional, some 4.x version of .NET, IIS, ASP.NET, ADO.NET. As I understand it, .NET CORE came later and is more restrictive. My project is only for a Web site; users will get to the site only via the Internet and a standard Web browser. E.g., I'm making no use of anything mobile. So, the project has no mobile app. Am highly motivated (1) to stay with just Windows, soon Windows Server, and (2) to keep down, to zero, the investment of time to program on Linux, IoS, Android, etc. -- hope never to write any code for any of them. That is, I can get paid only from revenue from the business; while I have to write the code, and it's fun to do, that's all a business expense; I can't get paid for writing code. I'm assuming that Microsoft and Windows have a foundation plenty sufficient for my business objectives. I have yet to move to a later version of .NET: Okay, I should, but, still, not looking forward to the effort. To me, the 4.x version of .NET I used looked fine. For another outrage, I wrote in the .NET version of VB (Visual Basic) and wrote no C, C++, or C#. I really like VB.NET, regard it as a nicely designed, implemented, documented language with plenty of features for what I need. For what I wrote, the UI (user interface) is simple and traditional -- billions of people will understand it at zero effort, immediately. There is a huge range, world, universe of Web page design features I didn't use. The timings I did show that the site is astoundingly fast, fast enough that if can keep the computing on average 50% busy 24/7, then standard ad rates will generate some gratifying revenue. An 8 core processor with a 4.0 GHz clock is no toy, is a lot of computing. Recently heard about Amazon and their AWS (Amazon Web Services) wanting the TLS (Transport Layer Security) version 1.2. Soooo, I checked, saw that I was using version 1.1, that 1.2 was available, so picked 1.2. What I'm doing now is dirt simple: Have 1000+ Web pages of Windows and .NET documentation, so wrote just ~300 lines of Rexx code to extract the page titles from the HTML tags <title> ... </title> and make a TOC (table of contents) I can read into my favorite editor KEDIT and search -- then one keystroke to KEDIT will have Firefox display the Web page. Want to do some more system management, get the site running again, do some revisions, do some marketing, and go live. In short, my CEO-business hat has me think, for the foundation of .NET, it's good on features, is now old and likely quite reliable for the old features I will use, and seems plenty fast -- soooo, I know, I should be ashamed, that's good enough!