Martin Joo Profile picture
Upcoming Laravel performance book: https://t.co/X1errH6QKl Blog, DevOps, DDD & microservice books: https://t.co/yJPUsoqTLh
Scott Profile picture Markus Profile picture 2 subscribed
Mar 12 15 tweets 5 min read
🛠️ How to measure performance in Laravel

There are some pretty simple tools you can start measuring your app's performance with:
- ab
- jmeter
- Inspector
- Telescope

🧵 Keep Reading Image 1/14 Here are some of the most important measures of an API/backend service:
- Throughput: the number of requests the system can handle
- Load time: the amount of time it takes for an HTTP request to respond
- Size: the total size of the HTTP response.
Nov 24, 2023 15 tweets 4 min read
💡How to integrate 3rd parties into your application?

We have to integrate with a ton of 3rd party APIs, and SDKs in every project. You can treat them as mini-applications inside your app.

🧵Keep Reading Image 1/14

Treat your 3rd parties as if they were mini-applications inside your application. They have their own namespaces with their own DTOs service classes and so on. Something like this: Image
Nov 21, 2023 10 tweets 3 min read
💡 If you're running PHP or Laravel apps in production you're probably using nginx and php-fpm.

But do you actually know what these terms mean?
- CGI
- FastCGI
- php-fpm
- How do they connect to nginx?

Let's find out!

🧵 Keep Reading
Image
Image
1/9 CGI

CGI stands for Common Gateway Interface. As the name suggests, it's not a package or library. No, it's an interface, a protocol.

CGI gives us a unified way to run scripts from web servers to generate dynamic content. Image
Sep 20, 2023 11 tweets 4 min read
🔥If you struggle to start with CI/CD pipelines here’s a pretty basic but useful one with:

- phpstan analysis
- phpinsight analysis
- unit tests

🧵Keep Reading
Image
Image
1/10

At the beginning of every GitHub workflow, we need to define what is going to trigger it.

In this case, it’ll run if you push to the main branch or you open a PR to it: Image
Sep 19, 2023 10 tweets 3 min read
💡 If you're running PHP or Laravel apps in production you're probably using nginx and php-fpm.

But do you actually know what these terms mean?
- CGI
- FastCGI
- php-fpm
- How do they connect to nginx?

Let's find out!

🧵 Keep Reading
Image
Image
1/9 CGI

CGI stands for Common Gateway Interface. As the name suggests, it's not a package or library. No, it's an interface, a protocol.

CGI gives us a unified way to run scripts from web servers to generate dynamic content. Image
Sep 11, 2023 18 tweets 6 min read
Here are my favorite 16 Laravel packages📦

I would immediately DIE without them!

🧵Keep Reading 1/17 laravel-excel

The single best package to handle Excel exports and imports:

- Exporting collections
- Storing files
- Exporting from a query
- Queue jobs
- And more Image
Sep 6, 2023 11 tweets 3 min read
🔥If you struggle to start with CI/CD pipelines here’s a pretty basic but useful one with:

- phpstan analysis
- phpinsight analysis
- unit tests

🧵Keep Reading Image 1/10

At the beginning of every GitHub workflow, we need to define what is going to trigger it.

In this case, it’ll run if you push to the main branch or you open a PR to it: Image
Sep 4, 2023 10 tweets 3 min read
💡 If you're running PHP or Laravel apps in production you're probably using nginx and php-fpm.

But do you actually know what these terms mean?
- CGI
- FastCGI
- php-fpm
- How do they connect to nginx?

Let's find out!

🧵 Keep Reading Image 1/9 CGI

CGI stands for Common Gateway Interface. As the name suggests, it's not a package or library. No, it's an interface, a protocol.

CGI gives us a unified way to run scripts from web servers to generate dynamic content. Image
Feb 1, 2023 15 tweets 4 min read
💡How to integrate 3rd parties into your application?

We have to integrate with a ton of 3rd party APIs, and SDKs in every project. You can treat them as mini-applications inside your app.

🧵Keep Reading 1/14

Treat your 3rd parties as if they were mini-applications inside your application. They have their own namespaces with their own DTOs service classes and so on. Something like this:
Jan 25, 2023 14 tweets 4 min read
💡Value Objects Everywhere

I collected some examples of value objects from a financial application I worked on in the past. In a larger, complicated, number-heavy app they really make a big difference!

🧵Keep Reading Image 1/13

In a financial application that deals with publicly traded companies, there are values like these:

- Prices
- Margins
- Ratios
- Market Capitalization
- Numbers in millions

So, instead of using floats and integers, we can create and represent these values as objects.
Jan 19, 2023 25 tweets 7 min read
🔥I just realized I never wrote anything about SOLID principles.

Shame on me… Let’s discuss all of them!

- Single-responsibility principle
- Open-closed principle
- Liskov substitution principle
- Interface segregation principle
- Dependency inversion principle

🧵Keep Reading Image 1/24 Single-responsibility principle

Each class should have only one reason to change.

A great example is data and its representation. Usually, they change for different reasons. Hence it's probably a safe bet to decouple the query layer from the representation layer.
Jan 5, 2023 24 tweets 6 min read
💡There are common mistakes that you can make in Laravel. I collected some of them I see (and make) on a daily basis.

There are three main groups:
- Performance issues
- Deployment issues
- Maintenance issues

🧵Keep Reading Image 1/23 Downloadable PDF

At the end of this thread, you can download a more detailed 40-page ebook (free).
Dec 1, 2022 14 tweets 5 min read
💡There are some common performance issues when working with Laravel. N+1 queries are the most common by far.

They are easy to fix but require some attention.

🧵Keep Reading Image 1/13

No matter what project I worked on in the past, N+1 queries always caused real performance issues.

They usually occur only in production and hard to trigger them while developing.

But first, let's discuss what is exactly an N+1 query problem: Image
Sep 26, 2022 27 tweets 7 min read
💡Here are 25 useful tools for PHP and Laravel developers I use almost daily!

Tools like:
- Medis
- Insomnia
- Hyper
- Notion

🧵Keep Reading 1/26 Insomnia

No, not the sleep disorder. With this Insomnia, you can REST.

It's a really great API client.

insomnia.rest
Sep 14, 2022 13 tweets 4 min read
💡This is a DTO or Data Transfer Object from the Domain-Driven Design world.

It helps you:
- Get rid of random arrays
- Structure your unstructured data
- Type-hints everywhere!

🧵Keep Reading 1/12 Life Without DTO

A DTO is used to store and transfer data inside your app. It’s really just a boring PHP class with some read-only properties.

I guess you have seen 500 lines functions from legacy systems where the only argument is an array called $data, like this:
Sep 12, 2022 22 tweets 7 min read
Here are my favorite 20 Laravel packages 📦

The best of the best. I would immediately DIE without them!

🧵Keep Reading 1/21 laravel-excel

The single best package to handle Excel exports and imports:

- Exporting collections
- Storing files
- Exporting from query
- Queue jobs
- And more
Aug 31, 2022 21 tweets 5 min read
💡How to communicate between microservices?

In the microservice world, we often have 10, 20, or even 50+ services. Communication can be pretty complex, so let’s make it easy!

🧵Keep Reading Image 1/20 In the microservice world, we split the app into different, small services and multiple databases.

We obviously need a way to communicate between these services. There are two main ways of communication:
- Sync
- Async, or event-based
Aug 24, 2022 10 tweets 3 min read
💡How to handle databases when you have microservices?

In the microservice world, we often need to work with 10, 20, or even 50+ databases. Which sounds crazy… Here’s a short explanation of why is that the case.

🧵Keep Reading 1/9

The first big challenge that comes with microservices is storing data.

This is harder than you think. The single most important thing is that you don’t want to have only one database.

So we don’t do this: Image
Aug 17, 2022 13 tweets 3 min read
💡What is a microservice and why is it micro?

Let’s continue with some basic microservices concepts:

- Boundaries
- Shared models
- Services

🧵Keep Reading 1/12

Imagine a restaurant where the waiter is using a mobile app to take your order. He takes your order, and the chef gets the information about what he has to cook.
Jun 17, 2022 15 tweets 5 min read
💡How to integrate 3rd parties into your application?

We must integrate with many 3rd party APIs and SDKs in every project. You can treat them as mini-applications inside your app.

🧵Keep Reading 1/14

Treat your 3rd parties as if they were mini-applications inside your application.

They have their own namespaces DTOs service classes and so on. Something like this:
Jun 10, 2022 14 tweets 4 min read
💡Value Objects Everywhere

I collected some examples of value objects from a financial application I worked on in the past.

In a larger, complicated, number-heavy app they really make a big difference!

🧵Keep Reading 1/13

In a financial application that deals with publicly traded companies there are values like these:

- Prices
- Margins
- Ratios
- Market Capitalization
- Numbers in millions

So, instead of using floats and integers, we can represent these values as objects.