2,784 karma · joined March 29, 2011
Website: https://yorickpeterse.com
> and the glaring problem of "ruby doesnt scale well" is everpresent
GitLab has many performance problems (and many have been solved over the years), but Ruby has thus far not been one of them. > Why wait for all of the slave databases to be in sync? If at least one is in sync,
> can you get all database interactions in the application to the valid subset?
If queries fail on the replica we'll cycle through the available replicas until we have one that works. If we didn't wait for all to be in sync it could in theory be possible we'd retry our query on a host that does not yet have the data, though this would be very unlikely. So basically we're being a bit paranoid here. > Why escape the input and use string interpolation instead of a parameter?
Rails doesn't really provide an easy way of doing this unfortunately. That is, to run raw queries you'll use something like this: ActiveRecord::Base.connection.execute 'your query here'
This particular API doesn't support passing any parameters, so you have to resort to manually escaping data and using string interpolation.Another thing to take into account is that updating between minor versions (major versions per 10.x) is a bit tricky since IIRC the WAL format can change. This means that upgrading from e.g. 10.x to 11.0 requires you to either take your cluster offline, or use something like pg_logical. This is really my only complaint, but again it's not really a reason to _not_ use PostgreSQL.
It's entirely possible that a single Puma process may end up using more memory than a single Unicorn process, so the only way to know for certain is to measure the difference.
> Person as in a legal person. This includes entities like corporations,
> organizations, representatives and so on:
> http://legal-dictionary.thefreedictionary.com/person
This may be the case for US law ("person" including both individuals and organisations), but it might also not be the case for all
countries across the world. For example, Dutch law seems to define "person" as
the individual (e.g. you and me) and seems to use a separate term for legal
entities and the likes. It's possible that in practise the two are considered
the same but I haven't been able to find such an example.Exactly because of this it's better to be explicit. For example, the MPL 2.0 explicitly defines this:
> 1.1. "Contributor"
>
> means each individual or legal entity that creates, contributes to the
> creation of, or owns Covered Software.
Here the term "contributor" is used, but the same could apply to the term
"person". > It tries to. Any change contributed to the project grants permission to
> incorporate that change under the same terms of the license, which
> includes the patent grant.
The patent grant states that any patents owned by the author can be used by the
software's users: > and including usage rights to any patents the authors may hold on it
However, nowhere is it stated that patents used for contributions automatically
belong (or can be used by) the authors and can thus also be used by the users.
Defining what "authors" means could clear things up, though you'll probably want
to separate the definition from "contributors" since you probably don't want
random "contributors" to also be an "author" (this could give them too much
power for example).Again the MPL 2.0 is a good example since it does cover this, albeit not in a single place and in a somewhat hard to grok way.
> Permission is hereby granted by the authors of this software, to any person
Person as in what, a natural person? What about non persons such as legal entities? > and including usage rights to any patents the authors may hold on it
So the license allows you to use any patents (held by the project author) included in the project, but it doesn't cover anything about patents used by contributors when submitting changes. OK... > Any modification to the software submitted to the authors may be incorporated into the software
> under the terms of this license.
May? That seems like something that should really be changed to "Any modification to the software submitted [...] will be incorporated into [...]" or something similar that _doesn't_ let people decide about this on the fly.This license as a whole is rather vague, leaving a lot up to interpretation. This isn't something you want from the only thing that stands between you and a potential legal nightmare. Just use good existing licenses such as the MPL 2.0, Apache, GPL (or some flavour of it), or even the MIT license (though I would strongly recommend not using it without a CLA).
1. Regular migrations (located in db/migrate)
2. Post-deployment migrations (located in db/post_migrate)
Post-deployment migrations are mostly used for removing things (e.g. columns) and correcting data (e.g. bad data caused by a bug for which we first need to deploy the code fix). The code for this is also super simple:
# Just dump this in config/initializers
unless ENV['SKIP_POST_DEPLOYMENT_MIGRATIONS']
path = Rails.root.join('db', 'post_migrate').to_s
Rails.application.config.paths['db/migrate'] << path
ActiveRecord::Migrator.migrations_paths << path
end
By default Rails will include both directories so running `rake db:migrate` will result in all migrations being executed as usual. By setting an environment flag you can opt-out of the post-deployment migrations. This allows us to deploy GitLab.com essentially as follows:1. Deploy code to a deployment host (not used for requests and such)
2. Run migrations excluding the post-deployment ones
3. Deploy code everywhere
4. Re-run migrations, this time including the post-deployment migrations
We don't use anything like strong migrations, instead we just documented what requires downtime or not, how to work around that (and what methods to use), etc. Some more info on this can be found here:
* https://docs.gitlab.com/ee/development/what_requires_downtim...
* https://docs.gitlab.com/ee/update/README.html#upgrading-with...
* https://docs.gitlab.com/ee/development/post_deployment_migra...
You can get cheaper or more expensive plans depending on the amount of value you pay yourself (known as the "eigen risico" or "own risk"), but the cheapest I could find was around €80 / month.
Since writing recursive descent parsers is not that hard (at least if your grammar is LL(1), see https://github.com/YorickPeterse/inko/blob/a76a8c23f901c5b2a... for an example) I would personally go with this approach whenever possible.
Parser generators definitely have their use cases (and allow you to write a parser much faster), but error reporting is often tricky to get right.
My only complaint is that I had my display replaced 3 (or maybe already 4) times either due to dead pixels, or these white smudges on the screen (these appear to be caused by damage to the LCD). These smudges in particular keep popping up and aren't too uncommon amongst other users either. There's a new one since I last had my screen replaced, but it's fortunately only visible when looking down on the laptop from the top (even then it's hard to see).
I question starting people on Ruby for web development.
Heavens forbid using a popular, practical language combined with a mature and even more popular web framework. Anyone starting web development now would do well to stick with Javascript.
Yes, let's recommend people to use a language where the things they learn (to use) stop being maintained/used/relevant 1 month later. And you can always use that on the backend if you have to
You can use Ruby in the frontend as well: http://opalrb.org/ and if you need to spend time learning something for the backend part you'd be better
served learning about relational databases than Ruby.
What? Learning Ruby doesn't somehow mean you can't learn about relational databases.When learning/teaching something you very much want to pick something that:
1. Has been around for at least 5 years
2. Is actively used, maintained, and overall has proven itself
3. Has good documentation and tooling
4. Perhaps has programs to help people getting started (Rails Girls, PyLadies, etc)
5. Is still around 5 years from now
Ruby and Rails are a perfect choice for this, though Rails (just like most frameworks out there) _is_ a bit complex for total beginners.
> What would a "professional and politically neutral as possible" company, in your definition, do in this case?
* "Male"* "Female"
* "Other (feel free to specify in the text field below)"
Or something along those lines, it's not that hard.
In case of Javascript such a question could be:
Users are reporting that page X takes a long time to load. How would you go
about finding out why this page takes long to load and where time is being
spent? What are the benefits and drawbacks of your approach, and what are
the alternatives?"
The phrasing is just an example, but the idea is to:1. Propose a problem that one can solve in e.g. 5-10 minutes
2. Ask them to think about the problem, their approach, benefits, drawbacks, etc
3. Have them deal with a problem that's actually relevant to the position, giving the applicant a better taste of what it's like to work at the organisation
> it be weird to take a week off just to work for another company
It's not even weird, it's just downright insane. No person should be expected to essentially work for free for a week without any guarantees they will get anything out of it. > I can't imagine finding a new programming job while still working at the old job.
Imagine having things such as: a family, a car, a mortgage, bills, etc.Giving up a job (therefore your income) just to find another job is not an option for many.
1. Fire them the usual way, in this case there is a termination period (usually 1 month).
2. Fire them on the spot. This is possible, but usually only done if an employee violated a contract agreement, harassed somebody, or basically committed some kind of serious offence.
This only applies to those employed in The Netherlands, other countries may have other rules.
More information: https://www.rijksoverheid.nl/onderwerpen/ontslag/vraag-en-an...