5 ms·
> When someone clicks a link to a Wix site... That server has to resolve the requested site from the site address by performing a key/value lookup URL to a site
by jlas 10y ago
> When someone clicks a link to a Wix site... That server has to resolve the requested site from the site address by performing a key/value lookup URL to a site.
So Wix uses MySQL to resolve site routes internally? Is this the best way to do it? Would it be possible to use internal domain names and rely on DNS to resolve everything?
- golergka 10y agoOn a site constructor with custom URLs created by millions of users for their websites every day?
- CraigJPerry 10y agoDefine best but it's a pretty reasonable approach. Some DNS servers (powerdns is an example from memory) use mysql over more traditional back ends like dbm which aren't so hot for high volumes of zone changes. I imagine a site like wix could be pretty tough on DNS. Re: nosql, I'm coming at that with really positive experiences in Cassandra but I can't imagine what kind of DNS system it would be a good fit for. The ability to tune CAP to fit DNS may be useful but in general I think of Cassandra as the solution you think about when your 2 node vertically scaled monster can't keep up.
- jlas 10y agoIt sounds reasonable, but with DNS you'd get geographic distribution for free, right? Won't you have to do something like sharding to achieve a similar thing with MySQL?
- CraigJPerry 10y agoHmmm I don't think you'd get geo dist for free. For example, I don't think start of authority can be shared by multiple resolving servers. Or if it can, it's a feature of some specific dns implementation. You get free caching which is tolerant to partitions, but you'd get that with either solution since it's largely the forwarding dns servers which make that happen and the difference here is constrained to the authorative resolving dns servers.
- backslash_16 10y agoI'm pretty new to this and just learned some more about routing requests in a cloud service at scale. For a lot of services where the location of the resources might change (frequently sometimes), you want to handle the routing internally and not use DNS because of the lag times and complexity of TTL and caching. For companies other than Wix I don't know what is used to handle it on the back end but I imagine it's either some specialized piece of hardware than can handle an insane load or some commodity hardware / cloud service & in-house software like here. At the end of the day, and I'm sure I'm missing some edge cases, I think it's basically a service that provides a mapping of domain.com/user-resource-or-website to the location of their resources with no lag time when changes are made.
- vkjv 10y agoIIRC, Github does this for Pages via an nginx module that queries MySQL. http://githubengineering.com/rearchitecting-github-pages/ http://githubengineering.com/rearchitecting-github-pages/
- tracker1 10y agoWhen I was at GoDaddy, we used a distributed Cassandra cluster to handle similar work... it worked very nice for a few key lookups (site, resource) ... most endpoints were static resources stored in C*, cached in local redis, and served via a load balanced application cluster.