HNHacker News
TopNewBestAskShowJobs

majidazimi

700 karma · joined August 7, 2013

submissionscomments
majidazimi··on MySQL High Availability at GitHub
Am I mistaken or it seems to me that promoting a slave to a master is kind of fragile operation(detecting that it did really fail). I mean there are more robust methods:

1. There is a bookkeeper cluster providing replicated log. (No Kafka! Hold on a second, move to 4)

2. All nodes of a single MySQL cluster have a service on them that has two responsibilities: 1. accepting writes. 2. following the log. MySQL service only serves reads. Write will be performed indirectly from the writer service which is running besides MySQL service.

3. Bookkeeper (and DistributedLog on top of it) enforces single writer. So essentially one node is appending to log, the others are following it.

4. Whenever one of slaves thinks master is failed (or maybe partially-failed), it issues a FENCE request to bookkeeper, which either stops current master from appending to log, or fails to get majority vote from bookkeeper nodes. In either way log stays consistent. (There exist no two masters at a single point in time)

5. If one slave is able to fence the current master, it just notifies service discovery component to redirect clients. This operation doesn't have to happen atomically. Since old master is fenced and it can't append to log, anyway. So client operation will be safely rejected.

This approach can convert any data store to a consistent, highly available store. It is even capable of running multiple databases grouped as one cluster. Replicated log is a separate module. It is possible to replicate from MongoDB to SQL Server as an example. It has the advantage that, you don't have to adopt any untested databases. Just use good old MySQL/PG/...

I understand that, it requires quite a lot of work to refactor already running infrastructure. But it is more robust and somewhat safer. Bookkeeper's built-in fence mechanism precludes any random writes from any partially failed master.

majidazimi··on Blockers to IPv6 Adoption
> A /64 can't be subnetted any more (one host, NO VMs!).

Why not directly bind all VMs to laptop's NIC? This way, they can get IP from the same /64 subnet. On firewall, only enable public access to those VMs that are needed.

I do have a home lab, but every VM is directly bridged to NIC and gets its IP from home router. So a single /64 is sufficient for me.

majidazimi··on Caching Beyond RAM: The Case for NVMe
Is there any reason why memcahced/redis doesn't provide external store as an interface and let people implement the load/store operations? I would like to be able to implement hierarchy of "hot(RAM) -> warm(NVM) -> cold(SSD) -> DB" style cache.
majidazimi··on Office 365 is being completely rewritten in JavaScript
Time to apply for a 20M dollar loan to buy a semi supercomputer in order to run skype, slack and office all together. Any remarks on cray supercomputers?
majidazimi··on Gitlab 500 error
> Unfortunately the smartest minds in CS are exactly suggesting “don’t reinvent the wheel”

Smartest minds never said that. Here is the correct quote: "Don't reinvent the wheel, but please learn how a wheel works".

majidazimi··on Gitlab 500 error
I do agree. But the trend/courage should be toward informative programming (how OS works, how DB works, how file systems works, ...). What we see now is exactly the opposite. Programmers are becoming more ignorant day after day. Even worse, people get credit for running away from C/C++/OCaml/Rust/,...
majidazimi··on Gitlab 500 error
> I don't want to write all of my backend in C++.

The difficulty of C++ is way too much over rated. Most mediocre projects can be written with basics of C++ (that everyone can learn in less than 3 months).

We could have lived in a way performant world, if people would stop horrifying beginners about difficulties of C++/Rust/...

Go talk to a beginner, the moment you say anything about C/C++, the first thing they mention is, what do you do for buffer overflows? They don't even know what it is, but they are worried about it.

majidazimi··on Gitlab 500 error
> This will be an unpopular opinion here, but I feel we've (collectively) failed.

We? NO. But those who refrained to learn SQL, yes. They've egregiously failed.

majidazimi··on Birth Rates Dropped Most in U.S. Counties Where Home Prices Grew Most
Exactly this. This is an interminable stupid loop.

1. People want their own house, 2 cars, ....

2. So they work more, to earn more.

3. In some cases you need to study more, to get better job.

4. Women also get involved in this shitty loop.

5. Getting loans are easier now. However housing supply is not sufficient. So prices go higher.

6. People end up working/studying more, because they need even more money now.

7. They end up having 1 child.

8. Now, since government wants more workers (1 child is not sustainable), they have to bring immigrants.

9. It is getting dangerous now. Corporations lobby politicians, to keep minimum wages at a very low level.

10. Ambitious immigrants are ready to work like a horse. (Don't feel offended, I'm also an immigrant)

11. Corporations bully current employees to work more, since if you don't work more, there is an immigrant out there to replace you.

12. People have to work even more to satisfy their employers.

13. Go to 1.

majidazimi··on Alternatives to Google Products
Regarding their cloud business, I think it's fine to use AWS. However, I'm kind of against their online shop, since there are many reports that they abuse their employees in warehouses.
majidazimi··on Alternatives to Google Products
It might sound a bit radical, but I think, even using rival's products to decrease Google's monopoly is an achievement on its own. To be honest, Firefox is somewhat an inferior product compared to Chrome, but I use it just to increase diversity in browser marketplace.
majidazimi··on Learning operating system development using Linux kernel and Raspberry Pi
After learning some C, start reading "The Linux Programming Interface"[0]. It totally changed my mind.

[0] https://nostarch.com/tlpi

majidazimi··on Alternatives to Google Products
We are facing two issues:

1. Privacy against advertisers 2. Privacy against security agencies.

From my perspective, first issue, is more important than second one. I think Apple does pretty decent job regarding first issue. MS holds second position. Google/FB hold the worst position.

So even though Apple/MS are closed source, I think our privacy will improve considerably just by installing an ad-blocker and sticking to Apple/MS products.

Second issue is more involved and you'd probably need to give up on all sort of mobile devices. On desktop you have to move to Linux/BSDs. No online storage (or at least move to self hosted solution). No hosted email(Or maybe just protonmail, ...). Life becomes tougher, if you decide to improve privacy against security agencies.

People tend to treat privacy as a binary issue. (either no privacy or full privacy). However, as said, majority of people experience much higher privacy just by dumping Google/FB and using an ad-blocker.

majidazimi··on Behind the Messy, Expensive Split Between Facebook and WhatsApp’s Founders
Why is everyone doing business with a black and white strategy? On one extreme, everything is free and funded by selling user information and on the other extreme, everthing is free but funded by donation. What is wrong with 2$/year model? Everyone (I mean truly everyone) is willing to pay that.
majidazimi··on Behind the Messy, Expensive Split Between Facebook and WhatsApp’s Founders
The problem is greedy attitude of people. As long as one can earn more by selling user information, there is no incentive for reasonably priced subscription model.
majidazimi··on Intel demonstrates a 28-core processor running at 5GHz
Atom/Electron Devs: Challenge Accepted...
majidazimi··on Telegram App Says Apple Is Blocking Updates Over Dispute with Russia
> More likely, updates are being rejected for another infraction. Telegram should publish the App Store reviewer’s criticisms publicly, and provide more context before making public denouncements.

Well, that's one of Durov's powerful weapons. Cry in public and blame others, while he is the one who messed it up.

majidazimi··on Getting 1Password 7 ready for the Mac App Store
Office 365 gives you a full office suite (including outlook) + 1TB of online storage + 50GB ad-free mail for 70$/year. According to complexity rules, 1Password shall ask for 36$/century.
majidazimi··on Unique IPv6 prefix per host [pdf]
Additionally you can install the routing software on server itself and let it form neighbor-ship with ToR router(s) and use ECMP directly from server in multi NIC scenarios. ECMP failover/recovery is faster and simpler (vendor agnostic) than link aggregation protocols. Basically each rack becomes its own OSPF totally stubby area. Data center core runs as area 0.
majidazimi··on Facebook Adds A.I. Labs in Seattle and Pittsburgh, Pressuring Local Universities
AI won't disappear definitely. However, more graduates will enter market as we move forward. Thus there will be more supply than demand which leads to drop in salaries.

This has happened in many markets in recent years. Don't you recall big data hype around 2007? You would be considered as God if you can barely install Hadoop back then.

majidazimi··on You can now run Linux apps on Chrome OS
at least for me, the answer is yes. I'm unsatisfied with almost all the options in laptop market based on my requirements. I just have to choose one, that makes me less unhappy.

Asus and Lenovo have great ultra books running Win10. Ultimate Office 365 support + good battery life. But it lacks a terminal + integrated UNIX utilities.

I prefer to use Linux on my laptop, but at the moment, it is lacking office 365 support. On some brands there is a serious battery issue.

Next option is macOS which has sane shell. But I don't understand, why is there such a huge race toward making thinner laptops? Previous generation MBP, was already thin enough. Consumers demanded thinner laptops. And now I have to bare with thinner MBP but less reliable battery power, fewer ports and a very noisy keyboard (which is disturbing everyone in library).

majidazimi··on Subscription Hell
> Most subscription software is a terrible deal in comparison.

This is actually my way of making decision to buy a subscription-based product. It must provide comparable service. Office 365 single user license costs around 70$/year. Now:

- Evernote is asking 60$/year. Seriously? One note is already offering same service with 1TB storage.

- Pocket is asking 45$/year. WTF? It is just a bookmarking service which is already offered by one note web clipper.

- Proton mail is asking 50$/year for 5GB mail box. Dude, Office 365 offers 50GB add-free mail box. However NSA is able to read your emails, which is not the problem here. At least MS is not selling my information to advertisers.

Other than streaming services, It is getting really difficult to find any subscription-based product that gets close to Office 365.

majidazimi··on Both in rich and poor countries, universal health care brings huge benefits
Isn't it better to design health care system based on some form of score, very much like credit score in financial systems? The healthier you live, the less you pay.

Obviously someone who drinks alcohol regularly, smokes regularly, is overweight, ... would be a burden on health care system (in long run) compared to someone who lives with a healthy life style. Why would they both pay the same amount? In a credit-based system the former pays more.

Making some exceptions in such a system is just fine. Not everyone has cancer. Insurance company can easily pay the full amount for these people. It is not the major cost for system.

majidazimi··on To censor the internet, 10 countries use Netsweeper filtering technology
The burden is on tech-workers. They should make sure for which company they are selling their talents.
majidazimi··on Toronto van attack suspect's Facebook post linked to anti-women ideology
Is this the new shit from western media? What the heck is "Anit-Women Ideology"? Apparently they have moved away from mental instability to anti-women ideology...

The fucking dude is a TERRORIST, Period.

majidazimi··on After Facebook scrutiny, is Google next?
I don't have problem if a company collects usage information. End of the day, they need it to improve the product. But for fuck's sake, DON'T sell it to others to increase revenue. Just use it for product development.
majidazimi··on Anna: A Fast, Scalable, Flexibly Consistent Key-Value Store
Here is my 2 cent on why this is the case:

On a general purpose hardware/network adding features as you mentioned, tends to be seriously difficult and tremendously workload dependent. At some point you need help from hardware designers which itself limits the use cases of your system.

FPGA supported databases, In-network SQL processing, Server-less caches (an SSD directly connected to network without OS), Storage systems with mind blowing low energy consumption, ... are just bunch of absolutely amazing research that are being done today. however the limited public availability is badgering.

With mass public usability in-mind, a general purpose K/V system is the highest summit you can really achieve.

majidazimi··on Anna: A Fast, Scalable, Flexibly Consistent Key-Value Store
> where is the service which adds replication, clustering and network interface on top of it?

Actually I would prefer such kind of database (just the engine).

1. Expose it to network via what ever framework you like. Thrift, Rest, grpc, ... You don't have to include different kind of libraries for each network service. I would love to connect to every network service (Redis, Elasticsearch, Cassandra, MySQL, ...) via a single framework (say grpc).

2. In most large scale scenarios, there is already some kind of log service (DistributedLog, NATS, Kafka, ...). Why not take benefit of that for replication? Isn't it great to separate the engine layer from replication layer? Currently we are doing double replication actually. Replicate data from master DB to slave DB. Then replicate the same data, from any DB to cache, search, ... components. The data is already there on log. Let everyone (slave DB as well as cache/search module) consume it. This is basically state machine replication idiom. PNUTS[0], Twitter K/V database, LinkedIn Espresso [1] (as well as Ambry[2] which is their internal object store), ... use this approach for replication.

3. I would agree with that, they only support basic low level operations.

[0] http://www.vldb.org/pvldb/1/1454167.pdf

[1] http://www.csce.uark.edu/~xintaowu/BDAM/p1135-qiao.pdf

[2] http://dprg.cs.uiuc.edu/docs/SIGMOD2016-a/ambry.pdf

majidazimi··on Writing a Microservice in Rust
Why? Even writing micro service in C++ is dead simple these days:

1. write the service specification in Thrift.

2. Generate the server and client stub with the framework.

3. Write the service functions.

4. Most probably you'd need to include some database/cache libraries. Poco project does a fairly good job.

5. Add some more logging and metric libraries.

6. General tools/libs are available in poco and folly.

7. If you are messing with REST, Microsoft Rest SDK and Facebook Proxygen is already providing a very solid foundation. High performance servers are already written. You just need to fill the call backs and configure the thread pools.

Why do you consider this more difficult than doing the same in Go? You just need some intermediate C++ knowledge for above tasks. No need to touch template programming, manually managing threads, ...

majidazimi··on Google's C++ Class
Chapter 32: Please (GC pauses the world) rewrite (GC pauses the world) it (GC pauses the world) with (GC pauses the world) C++.
← PreviousPage 3 of 6Next →