-
Avoiding data anomaly when more than one system is involved
One of the most deadly errors a developer can make is to think that two different systems have same priority or they both are sources of truth with their own thinking/logic. This is one of the biggest reasons of data anomaly IMO, especially in data heavy systems. For example, when you’re manipulating data in one…
-
Processing 40k URLs using Laravel Queues
Some context – what really happened So a week ago I had a P1 task from SEO team with concerns that Google hadn’t been happy about some redirects on the site, not only Google but also some users. So to temporarily solve this issue we decided to deactivate all the dead redirects temporarily until I…
-
Some examples working with laravel collections
Before we get into data manipulation using Laravel please note that it’s best to try and use the right tools/technology for what you want to achieve. Laravel’s way to manipulate collection is just one of many ways to manipulate the data. This doesn’t mean you shouldn’t use functions provided by native language and best practices.…
-
Laravel: Code in Controller or a separate Class?
The problem with a lot of online advice is that it’s not backed by extensive experience at all, rather picked from small experiments and guesses.. A common advice you’ll hear, especially in Laravel community goes like this: Controller’s should only contain HTTP/requests logic, everything else should be separated. The issue with such statements is that…
-
PHP Binary Search Example
There’s many ways to search an array in PHP. Here’s 3 simple examples. Note that most of the times it really doesn’t matter how you do the search there’s always situations where you can’t simply use array_search function for example. This is especially true when it’s an associative array or you’re dealing with a bit…
-
Practical SELECT Queries in SQL
Few SUPER IMPORTANT things before we start: How to make this post ACTUALLY useful for YOURSELF: To make the most of this post please do yourself a favor and make sure you have basic understand of how this database is organised. I’d also recommdend to avoid looking at the queries. Instead read the problem, open…
-
AWS mistake that almost cost me £££
Let’s talk about something that’ll save you money. Most website’s goal is to make on-boarding process smoother. For example signups, saving credit details, buying a product and other actions. More effortless the better. So talking about effortless on-boarding.. Having used AWS for few years and I can tell you they have a very decent interface.…
-
AWS Lambda Function — Watermarking a PDF via S3 Trigger in Python
In the previous chapter I talked about the process of watermarking a PDF by sending it to Lambda function in a POST request. In this lesson we’ll automatically Trigger Lambda function when a PDF is uploaded to a S3 bucket and watermark it, then we’ll upload it to a different bucket. Prev chapter: [Part 1]…
-
AWS Lambda Function + API Gateway for Absolute Beginners.
Contents: What’s not covered: Introduction & Goal Serverless architecture has some good use but only if you plan for it. Anytime you use a service like AWS Lambda you should ask yourself “Why bother, is the additional complexity really justified?”. Additionally, you should think about the costs as they can be unpredictable, they’re not constant…
-
Some ways to improve bug fixing..
Bugs will happen whether you like it or not. But it pays off to know the type of bugs they are. External bug in an API/service your system relies on? A syntax bug? A logical bug? A bug caused by server itself? The list goes on. But that’s really the first step. You must know…