Tag: mysql

Time & timezones

If you’ve ever been far away from someone you want to communicate with, you’ll know how annoying daylight saving times & timezones make it to coordinate time across the world.

You don’t want your users to have to have to reason about that, so you’ll have to make your application do the work for them & display them the time at their location.

Dealing with time isn’t necessarily difficult, you just have to be consistent.

How to make your code scale

Building scalable software means that you are prepared to accommodate growth. There are basically 2 things you need to consider as your data grows:

  • Will requests be handled at a faster rate than they come in?
  • Will my hardware be able to store all the data?

Obviously, you will need more infrastructure as you grow. You’ll need more machines. You’ll probably also need/want to introduce additional applications to help lighten the load, like cache servers, load balancers, …

Geographic searches within a certain distance

A 2-dimensional location on our earth can be represented via a coordinate system similar to an X & Y-axis. These axes are called latitude (lat) & longitude (lng).

Latitude is the north-south axis with a minimum of -90 (south pole) and maximum of 90 degrees (north pole). The equator is zero degrees latitude.

Longitude is the X-axis equivalent, running around the globe from east to west: from -180 to +180 degrees. The Greenwich meridian is 0 degrees longitude. Everything west and east from it is respectively negative and positive on the longitude scale, up until the middle of the Pacific Ocean, near the International Date Line, where -180° longitude crosses over to 180°.

Using rollup tables to aggregate data in large datasets

A myriad of features may prompt the need to aggregate your data, like showing an average score based on multiple values, or even simply showing the amount of entries that abide to a certain condition. Usually this is a trivial query, but this is often untrue when dealing with a huge dataset.

How to build a MySQL-powered search engine

In content-heavy websites, it becomes increasingly important to provide capable search possibilities to help your users find exactly what they’re looking for. The most obvious solution is searching your MySQL database directly, but implementing a generic MySQL search is not at all trivial. Here’s how to avoid those pitfalls and build a robust MySQL-powered search engine for you website.

This article will solely focus on the most common text-based search (as opposed to e.g. geography- or time-based)