Sevalla is the all-in-one PaaS for your web projects. Host and deploy your applications, databases, object storage, and static sites. Enjoy advanced deployment pipelines, a complete database studio, instant preview apps, and one-click templates. The pricing is simple: no hidden fees, no seat-based pricing, and you pay only for what you use. Get real human support from developers.

Get started now with a $50 credit at Sevalla.com.

Comparing laravel-mediable with laravel-medialibrary

Link –

Laravel-Mediable is a package to upload and handle all sorts of files (aka media) in a Laravel app. It was built by a Canadian based web agency called Plank.

With it you can do things like this:

$media = MediaUploader::fromSource($request->file('thumb'))
    ->toDestination('uploads', 'post/thumbnails')
    ->upload();

$post = Post::create($this->request->input());
$post->attachMedia($media, ['thumbnail']);

Pretty cool. You can read more on the way and how the package was built in an introductory post on the Plank blog.

At Spatie we've also built our own solution for handling media. In Plank's blogpost Sean lists these differences between their package and our Medialibrary.

spatie/laravel-medialibrary plank/laravel-mediable
Relationship many-to-one polymorphic, each media record is owned by one related model many-to-many polymorphic, each media record can connect to any number of related models, and vice versa.
Filesystem Files are stored in directories named after the media id relative to the disk root Files can be stored anywhere on the disk
Association Identifier Each media record belongs to one "collection" Media can be attached to a model with any number of "tags"
Aggregate Types Support for images and pdfs Configurable support for any number of custom types
Miscellaneous Features Glide manipulations Synchronization commands

Since our medialibary was introduced I've been asked from time to time why our medialibrary uses a many-to-one polymorphic relationship. The answer is: simplicity.

A previous iteration of our Blender CMS (a version that used Zend Framework 1 instead of Laravel ?) had a screen where the user could pick a file from all uploaded files (it looked much like this wordpress screen). We saw that, after having set up a lot of sites with Blender, that almost none of our clients used that screen...

In our projects we also see that our clients mostly need to attach an image, or a pdf or whatever, ... to only one model (for instance a news item). It rarely happens that a client wants to attach the same file to different models.

In our code we want to handle that use case as simple as possible and that's why we preferred using a many-to-one relation over a many-to-many relation. All the other differences listed in Plank's post are caused by the same reasoning, we preferred simplicity and ease of use over flexibility.

If you're looking for a good solution to handle media in a Laravel app I suggest you take a look at both our Medialibrary and Plank's Mediable package. Both packages are good at what they do. Pick the one that best fits your project (and just feels good to you).

Read more

The traits of a proficient programmer

Link –

Gregory Brown wrote an excellent article on how you can grow as a programmer.

Do you know what the difference between competence and proficiency is? ... Competence means having enough experience and knowledge to get stuff done; proficiency involves knowing why you are doing something in a certain way, and how it fits into the big picture. In other words, a proficient practitioner is always a competent practitioner, but the opposite may not be true.

https://www.oreilly.com/ideas/the-traits-of-a-proficient-programmer

Read more

Stay up to date with all things Laravel, PHP, and JavaScript.

You can follow me on these platforms:

On all these platforms, regularly share programming tips, and what I myself have learned in ongoing projects.

Every month I send out a newsletter containing lots of interesting stuff for the modern PHP developer.

Expect quick tips & tricks, interesting tutorials, opinions and packages. Because I work with Laravel every day there is an emphasis on that framework.

Rest assured that I will only use your email address to send you the newsletter and will not use it for any other purposes.

Adding a vue component to Spark

Link –

On his blog Christoph Rumpel explains how you can add a vue component to a Spark app.

Taylor Otwell, the creator of Laravel, is a big Vue fan and this is why you will find it in a lot of Laravel products. Spark is using Vue too. ... When I started to use Spark I wanted to use some of my already given .vue components too, but since Spark is a little bit different from standard Laravel projects I didn’t managed to use them. After some weeks of reaching out for help, I finally got the solution.

http://christoph-rumpel.com/2016/05/Larave-Spark-Using-Vue-Component/

Read more

Testing your composer dependencies with prefer-lowest

Link –

An older but still relevant post by Evert Pot on why and how you should also test your packages with the lowest versions of it's dependencies.

In some projects, there may be packages lying around that are not the latest version. This could be because it introduced some BC break, or introduced a bug.

If other packages also use the package that’s being held back, they may get an older version as a dependency.

So for package maintainers, they will want to find out if their package correctly works with the oldest package they claim to support.

https://evertpot.com/testing-composer-prefer-lowest/

EDIT: Here's another old, but also still relevant, blogpost on the subject by Cees-Jan Kiewiet:

https://blog.wyrihaximus.net/2015/06/test-lowest-current-and-highest-possible-on-travis/

Read more

Things you want to know about Let's Encrypt

Link –

On his blog Simone Carletti gives a good overview of everything Let's Encrypt has to offer (and he also touches on what the service doesn't offer)

Let’s Encrypt is a new certificate authority that entered the internet scene at the end of 2015. ... However, Let’s Encrypt is not only free. Quoting the homepage: Let’s Encrypt is free, automated, and open.

But what does it mean? In this article I’ll share some of the direct consequences of that quote to help you better understand how Let’s Encrypt (currently) works. My goal here is not to judge or advertise the service offered by Let’s Encrypt (either in a negative or positive way), rather provide an overview of what you should expect if you use this service, and let you decide whether Let’s Encrypt is a good fit for you or not.

https://simonecarletti.com/blog/2016/02/things-about-letsencrypt/

Read more

Our packages are now postcardware

Original – by Freek Van der Herten – 1 minute read

My company has released a lot of PHP and Laravel packages. According to the packagist stats they have been downloaded for a little over 700 000 times. Up until now they've all been free. That is going to change. Our packages are now postcardware. This means that from now on you are required to send…

Read more

Validating SSL certificates with PHP

Link –

With vanilla PHP it's possible to check of if the SSL certificate of a given site is valid. But it's kinda madness to do it. Let's look at the code required:

<br />// Step 1: downloading the certificate from the site
$streamContext = stream_context_create([
    'ssl' => [
        'capture_peer_cert' => true,
    ],
]);

$client = stream_socket_client(
    "ssl://spatie.be:443",
    $errorNumber,
    $errorDescription,
    $timeout,
    STREAM_CLIENT_CONNECT,
    $streamContext);

$response = stream_context_get_params($client);

$certificateProperties = openssl_x509_parse($response['options']['ssl']['peer_certificate']);

// Step 2: parsing the certificate

/*
* I'm not even going to type out the further code needed.
*
* `$certificateProperties` has two keys `validFrom_time_t` and `validTo_time_t`. 
* Those keys contain the UTC representation of the date.
* You will need to check if the current date is between those dates.
*/ 

What. The. Actual. F. Let's fix this!

We've released a new package named spatie/ssl-certificate that makes checking the SSL certificate of a site laughably easy. Let's take a look at the code:

$certificate = SslCertificate::createForHostName('spatie.be');
$certificate->isValid(); // returns true if the certificate is currently valid

Boom, done.

The package has a few more methods that makes working with an SSL certificate a breeze:

$certificate->getIssuer(); // returns "Let's Encrypt Authority X3"

$certificate->getDomain(); // returns "spatie.be"

//A certificate can cover multiple (sub)domains. Here's how to get them.
$certificate->getAdditionalDomains(); // returns ["spatie.be", "www.spatie.be]

$this->certificate->validFromDate(); // returns an instance of Carbon

$certificate->getExpirationDate(); // returns an instance of Carbon

You can also use isValid to determine if a given domain is covered by the certificate. Of course it'll keep checking if the current datetime is between validFromDate and expirationDate.

$this->certificate->isValid('spatie.be'); // returns true
$this->certificate->isValid('laravel.com'); // returns false

The source code of the package is available on GitHub. My company has made many more PHP framework agnostic, Laravel and JavaScript packages in the past. Take a look at the open source page at our site to see if we've made anything that could be of use to you.

Read more

How to use PHP Solarium in a Laravel project

Link –

Apache Solr is a high performance search engine much like Elastic. On his blog Peter Steenbergen explains how you can use Solr in a Laravel app.

This is my second blog in a series about SOLR with the PHP Solarium library. My first blog was about the usage of OR filters to create Multi-Select facets with SOLR. With this blog item I will show you how easy it is to implement the PHP Solarium library in the Laravel framework.

http://petericebear.github.io/laravel-php-solarium-integration-20160725/

Read more

Comparing Laravel with Zend Expressive

Link –

In a post on masterzendframework.com Matthew Setter shares his experiences with building the same application in both Laravel and Zend Expression.

The reason being, is that you can't give a straight yes or no answer. It's like asking: is desktop Linux as easy as Windows? The presumption there is that you want to do exactly the same thing in Linux as you can with Windows.

Well, if you wanted the exact same experience on Linux, as you get with Windows, then use Windows! As you're working with two different systems, two different approaches to solving the same challenge, then the end result may be the same — but how they work will naturally be different.

So it is with Laravel and Zend Expressive. They're two exceptional PHP frameworks which can be used to create similar applications. Yet they were designed with different preconceptions about how an application's should be put together. They were designed for different developer mindsets. And the list goes on.

So, whilst I was able to create the same application, roughly about the same size, the way they were developed was different.

http://www.masterzendframework.com/zend-expressive-or-laravel/

I'm currently perfectly happy in the Laravel ecosystem, so I won't be making a switch soon. But I like to keep an eye out on how other frameworks and communities are doing things to learn from that.

Read more

The new Closure::fromCallable() in PHP 7.1

Link –

PHP 7.1 will have a neat function to create closures from callables. Joseph Silber explains the function and offers some good examples on his blog.

With PHP 5.5 going EOL earlier this week and the PHP 7.1 beta expected later this month, now sounds like a good time to look into a neat little feature coming in 7.1: easily converting any callable into a proper Closure using the new Closure::fromCallable() method.
  • A short refresher on closures in PHP
  • When you need to convert a callable to a Closure
  • Introducing Closure::fromCallable()
  • Creating a closure that wraps a private method

https://josephsilber.com/posts/2016/07/13/closure-from-callable-in-php-7-1

Read more

Building a Laravel powered Slack bot

Link –

At Spatie we've recently introduced a bot to our Slack chat. We've named him Paolo (after the waiter in our favourite Italian restaurant in Antwerp: La Fontanella Da Enzo). Here's a demo of Paolo (the bot) in action.

Behind the scenes Paolo is powered by a Laravel application that responds to all requests Slack is sending to it. In this post I'd like to explain how you can set up your own Laravel powered Slack bot.

General flow

A message in slack that starts with a slash is called a slash command. Whenever you type in a slash command in Slack channel, an http request will be sent to your Laravel app. You have to respond to that command within 3 seconds. Failing to do some will result in an error being displayed in the channel.

After that initial response you're allowed to send multiple delayed responses. But there are some limitations for delayed responses. You may respond up to 5 times within 30 minutes after the user typed in the slash command on the slack channel. Want to know more about slash commands and how they work, then read this excellent article at Slack's API site.

To make responding to Slack a breeze we're going to used the package our team released a few days ago called spatie/laravel-slack-slash-command.

Setting things up

Before you can get started building our Laravel app, you'll need to set up slash command at Slack.com. Head over to the custom integrations page at Slack.com to get started. There click "Slash commands" and on the next page click "Add configuration". On that screen you can choose a name for your Slack command. In our examples we'll use paolo but you can choose anything that Slack allows.

You should now be on a screen that looks like this:

paolo integration settings

In the url field you should type the domain name of your Laravel app followed by one or more segments. In the screenshot we've added a slack segment. You can choose any segment you want. Normally the token field should already be filled. And that's all you need to do at Slack.com.

The next thing you'll need to do is to install the spatie/laravel-slack-slash-command package. Let's pull it in via Composer.

composer require spatie/laravel-slack-slash-command

Next, you must install the service provider:

// config/app.php
'providers' => [
    ...
    Spatie\SlashCommand\SlashCommandServiceProvider::class,
];

The configuration file of the package can be published with:

php artisan vendor:publish --provider="Spatie\SlashCommand\SlashCommandServiceProvider" --tag="config"

This is the contents of the published config file:

return [

    /**
     * Over at Slack you can configure to which url the slack commands must be send.  
     * url here. You must specify that. Be sure to leave of the domain name.
     */
    'url' => 'slack',

    /**
     * The token generated by Slack with which to verify if a incoming slash command request is valid.
     */
    'token' => env('SLACK_SLASH_COMMAND_VERIFICATION_TOKEN'),

    /**
     * The handlers that will process the slash command. We'll call handlers from top to bottom
     * until the first one whose `canHandle` method returns true.
     */
    'handlers' => [
        //add your own handlers here


        //this handler will respond with a `Could not handle command` message.
        Spatie\SlashCommand\Handlers\CatchAll::class,
    ],
];

And with that you're ready to respond to http requests coming from Slack.

Setting up your first command handler

Whenever a user types in a slash command Slack will send an http request to the Laravel app. Next, our package will go over all classes in the handlers key of the config file from top to bottom until the first one whose canHandle method returns true. A handler is a class that is responsible for receiving a request from slack and sending a response back.

Let's create our first handler. Handlers must extend Spatie\SlashCommand\Handlers\BaseHandler and implement the two abstract methods from that BaseHandler: canHandle and Handle.

Here's an example.

namespace App\SlashCommandHandlers;

use Spatie\SlashCommand\Request;
use Spatie\SlashCommand\Response;
use Spatie\SlashCommand\Handlers\BaseHandler;

class Hodor extends BaseHandler
{
    /**
     * If this function returns true, the handle method will get called.
     *
     * @param \Spatie\SlashCommand\Request $request
     *
     * @return bool
     */
    public function canHandle(Request $request): bool
    {
        return true;
    }

    /**
     * Handle the given request.
     * 
     * @param \Spatie\SlashCommand\Request $request
     * 
     * @return \Spatie\SlashCommand\Response
     */
    public function handle(Request $request): Response
    {
        return $this->respondToSlack("Hodor, hodor...");
    }
}

This Hodor class will just respond with Hodor, hodor, ... to every request that is sent to it.

You'll need to register this class in the config file.

// app/config/laravel-slack-slash-command
    'handlers' => [
        App\SlashCommandHandlers\Hodor::class,
        ...
    ], 

Let's see that in action.

A slightly more advanced handler

Let's create a slightly more interesting handler. This one that just repeats the command you've sent to it but only if the text after the command starts with repeat.

namespace App\SlashCommandHandlers;

use Spatie\SlashCommand\Request;
use Spatie\SlashCommand\Response;
use Spatie\SlashCommand\Handlers\BaseHandler;

class Repeat extends BaseHandler
{
    public function canHandle(Request $request): bool
    {
        return starts_with($request->text, 'repeat');
    }

    public function handle(Request $request): Response
    {   
        $textWithoutRepeat = substr($request->text, 7)

        return $this->respondToSlack("You said {$textWithoutRepeat}");
    }
}

Let's register this handler as well.

// app/config/laravel-slack-slash-command

    'handlers' => [
        App\SlashCommandHandlers\Repeat::class,
        App\SlashCommandHandlers\Hodor::class,
        ...
    ],    

If you type in /paolo repeat Hi, everybody in a slack channel now, you'll get a response Hi, everybody back. When you type in /poalo bla bla bla you'll get a response Hodor, hodor... because the Hodor handler is the first one which canHandle-method returns true.

Notice that Spatie\SlashCommand\Request being past in canHandle and handle? It contains all data that's being passed by Slack to our Laravel app. These are it's most important properties:

  • `command`: the command name without the `/` that the user typed in. In our previous example this would be `paolo`.
  • `text`: all text text after the command. In our the example above this would be `repeat Hi, everybody`.
  • `userName`: the Slack username of the person that typed in the command
  • `userId`: the Slack user id of the person that typed in the command
  • `channelName`: the name of the channel where the user typed in the command
  • `teamDomain`: the name of the Slack subdomain. So if your team is on `example.slack.com` this would be `example`.

Customizing your response

By default the response will be sent to the user who typed in the original message. If you want the response to be visible to all users in the channel you can do this:

    public function handle(Request $request): Response
    {
        return $this
           ->respondToSlack("Hodor, hodor...")
           ->displayResponseToEveryoneOnChannel();
    }

There are also many formatting options. Take a look at this response on Slack: attachments

$this->respondToSlack()
    ->withAttachment(Attachment::create()
        ->setColor('good')
        ->setText('This is good!')
    )
    ->withAttachment(Attachment::create()
        ->setColor('warning')
        ->setText('Warning!')
    )
    ->withAttachment(Attachment::create()
        ->setColor('danger')
        ->setText('DANGER DANGER!')
    )
    ->withAttachment(Attachment::create()
        ->setColor('#439FE0')
        ->setText('This was a hex value')
    );

There are many more options to format a message. Take a look at Slacks documentation on attachments to learn what's possible.

Using signature handlers

A console command in Laravel can make use of a signature to set expectations on the input. A signature allows you to easily define arguments and options.

If you let your handler extend Spatie\SlashCommand\Handlers\SignatureHandler you can make use of a $signature and the getArgument and getOption methods to get the values of arguments and options.

Let's take a look at an example.

namespace App\SlashCommandHandlers;

use Spatie\SlashCommand\Request;
use Spatie\SlashCommand\Response;
use Spatie\SlashCommand\Handlers\SignatureHandler;

class SendEmail extends SignatureHandler
{
    public $signature = "paolo email:send {to} {message} {--queue}"

    public function handle(Request $request): Response
    {   
        $to = $this->getArgument('to');

        $message = $this->getArgument('message');

        $queue = $this->getOption('queue') ?? 'default';

        //send email message...
    }
}

Notice that there is no canHandle method present in that class. The package will automatically determine that a command /paolo email:send test@email.com hello can be handled by this class.

Sending delayed responses

Remember that restriction mentioned above about the initial response to a slash command. Your Laravel app only has three seconds to respond otherwise an error message will be shown at Slack. After that initial fast response you're allowed to send 5 more responses in the next 30 minutes for the command. These responses are called "delayed responses". We're going to leverage Laravel's queued jobs to send those delayed responses. Please make sure that you've set up a real queue driver in your app, it needs to be something other than sync.

Imagine you need to call a slow API to get a response for a slash command. Let's first create a handler that will send the initial fast response.

namespace App\SlashCommandHandlers;

use Spatie\SlashCommand\Request;
use Spatie\SlashCommand\Response;

class SlowApi extends BaseHandler
{
    public function canHandle(Request $request): bool
    {
        return starts_with($request->text, 'give me the info');
    }

    public function handle(Request $request): Response
    {
        $this->dispatch(new SlowApiJob());

        return $this->respondToSlack("Looking that up for you...");
    }
}

Notice that we're dispatching a job right before sending a response. Behind the scenes Laravel will queue that job.

This is how that SlowApiJob would look like.

namespace App\SlashCommand\Jobs;

use Spatie\SlashCommand\Jobs\SlashCommandResponseJob;

class SlowApiJobJob extends SlashCommandResponseJob
{
    // notice here that Laravel will automatically inject dependencies here
    public function handle(MyApi $myApi)
    {
        $response = $myApi->fetchResponse();

        $this
           ->respondToSlack("Here is your response: {$response}")
           ->send();
    }
}

Notice that, unlike in the Handlers the response is not returned and that send() is called after the respondToSlack-method.

With this in place a quick response Looking that info for you... will be displayed right after the user typed /your-command get me the info. After a little while, when MyApi has done it's job Here is your response: ... will be sent to the channel.

Some useful handlers

The previous examples of this post were quite silly. You'll probably never going to use to handlers in your bot. Let's review a real life example. Our Poalo bot can lookup dns records for a given domain. This is how that looks like in a Slack channel.

This is the actual class that we use in our bot:

namespace App\SlashCommandHandlers;

use Spatie\SlashCommand\Attachment;
use Spatie\SlashCommand\AttachmentField;
use Spatie\SlashCommand\Handlers\SignatureHandler;
use Spatie\SlashCommand\Request;
use Spatie\SlashCommand\Response;

class Dns extends SignatureHandler
{
    protected $signature = 'paolo dns {domain}';

    /**
     * Handle the given request. Remember that Slack expects a response
     * within three seconds after the slash command was issued. If
     * there is more time needed, dispatch a job.
     *
     * @param Request $request
     *
     * @return Response
     */
    public function handle(Request $request): Response
    {
        $domain = $this->getArgument('domain');

        if (empty($domain)) {
            return $this->respondToSlack("You must provide a domain name.");
        }

        $sanitizedDomain = str_replace(['http://', 'https://'], '', strtolower($this->getArgument('domain')));

        $dnsRecords = dns_get_record($sanitizedDomain, DNS_ALL);

        if (!count($dnsRecords)) {
            return $this->respondToSlack("Could not get any dns records for domain {$domain}");
        }

        $attachmentFields = collect($dnsRecords)->reduce(function (array $attachmentFields, array $dnsRecord) {
            $value = $dnsRecord['ip'] ?? $dnsRecord['target'] ?? $dnsRecord['mname'] ?? $dnsRecord['txt'] ?? $dnsRecord['ipv6'] ?? '';

            $attachmentFields[] = AttachmentField::create('Type', $dnsRecord['type'])->displaySideBySide();
            $attachmentFields[] = AttachmentField::create('Value', $value)->displaySideBySide();

            return $attachmentFields;
        }, []);

        return $this->respondToSlack("Here are the dns records for domain {$domain}")
            ->withAttachment(Attachment::create()
                ->setColor('good')
                ->setFields($attachmentFields)
            );
    }
}

In order to get home every member of our team needs to bike a bit. That's why we've also created a command to display a rain forecast. This is what happens when /paolo rain is typed in our slack channels.

This is the class responsible for creating that response.

namespace App\SlashCommandHandlers;

use Spatie\SlashCommand\Attachment;
use Spatie\SlashCommand\Handlers\SignatureHandler;
use Spatie\SlashCommand\Request;
use Spatie\SlashCommand\Response;

class Rain extends SignatureHandler
{
    protected $signature = 'paolo rain';

    /**
     * Handle the given request. Remember that Slack expects a response
     * within three seconds after the slash command was issued. If
     * there is more time needed, dispatch a job.
     *
     * @param Request $request
     *
     * @return Response
     */
    public function handle(Request $request): Response
    {
        return $this
            ->respondToSlack("Here you go!")
            ->withAttachment(
                Attachment::create()->setImageUrl('http://api.buienradar.nl/image/1.0/radarmapbe?width=550')
            );
    }
}

In closing

The spatie/laravel-slack-slash-command package makes is it easy to let a Laravel app respond to a slash command from Slack. If you start using the package, let me know in the comments below what your bot can do. And if you like our package, take a look at this list of Laravel packages we've previously released to see if we've made something that can be of use to you.

Read more

Following PHP internals and RFC's

Link –

When features get added to PHP there's a lot of discussion first about the new functionality. This is done on the so-called internals mailing list. You can try to follow the discussions via a rather ugly interface at http://news.php.net. The site looks like a very old school web email client where all conversations are just running through each other.

A couple of days ago Matthieu Napoli launched his new site externals.io. This site makes following internals a lot easier. Messages that are part of a conversation are grouped and thus much easier to follow. If you're interested in this you should definitely also check out Made with Love's Why We Can't Have Nice Things project that lists all RFC's and votes.

Read more

Understanding dependency injection containers

Link –

At the heart of many modern PHP application there is an IoC Container, short for inversion of control container. When people talk about a "dependency injection container" or a "service container" they mean the same thing. It's purpose is to manage class dependencies. Though the concept is relatively simple, it can come across very confusing if you've never worked with one.

In a new post on his blog Matt Allan builds a simple one from scratch. Check it out if you're struggling with understanding how the IoC container works.

If you are writing modern PHP, you will run across dependency injection a lot. Basically all dependency injection means is that if an object needs something, you pass it in. ... Dependency injection makes your code more flexible and easier to test.

http://mattallan.org/2016/dependency-injection-containers/

EDIT: mattalan.org seems to be down, but you can still view the post in Google's cache.

Read more

Facebook's mobile device lab

Link –

As a user I've pretty much turned my back to Facebook, but boy must it be interesting to work at that scale. Here's how Facebook built their mobile device lab.

... We needed to be able to run tests on more than 2,000 mobile devices to account for all the combinations of device hardware, operating systems, and network connections that people use to connect on Facebook. Today, in our Prineville data center, we have a mobile device lab — outfitted with a custom-built rack — that allows us to run tests on thousands of phones. The process of building a lab in our data center wasn't a direct path, and we learned a lot along the way...

https://code.facebook.com/posts/300815046928882/the-mobile-device-lab-at-the-prineville-data-center/

Screen Shot 2016-07-15 at 21.23.13

I stumbled on this story via Bram.us. Subscribe to the RSS feed of that site if you haven't done so already.

Read more

How a 20mb data-set brought down a 14gb ElasticSearch cluster

Link –

Frank De Jonge, member of the PHP League and author/maintainer of Flysystem, was facing a world of pain with ElasticSearch. Luckily the story has an happy ending. Read all about his journey on his blog.

For a client project we are using ElasticSearch (ES) as one of our read-models. The use-case was pretty straight forward and the amount of data was super small. However, our problems were pretty big. It got to a point where we had to reboot our cluster periodically to prevent it from crashing. So, what was going on? Let's dig in.

https://blog.frankdejonge.nl/how-a-20mb-data-set-brought-down-a-14gb-elasticsearch-cluster/

Read more