Peter Coles

Category: Laravel

Big Data Seeding Part I – Importing Large Datasets into Laravel

I love Laravel’s data seeding. I use it to create test and sometimes initial production data on every Laravel project that I do. But recently I was presented with a (very) large lump of pre-existing test data.

A bit of background … I was extracting microservices from a monolithic legacy system, and had decided that to minimise risk, I’d maintain data compatibility between old and new systems. With Laravel, this was really easy as Laravel models allow us to define table names and relationships even when they don’t conform to Laravel’s default expectations.

Having an existing, large scale, integration test database looked like a huge benefit, and it was. It would have taken ages to construct this much data from scratch, but thought of translating it to into seeding classes filled me with dread. Happily there’s a much better way of handling this.

Continue reading

Bi-weekly (fortnightly) Scheduling

We have a lot of tasks run to a bewildering schedule across multiple servers. We use cron, of course. But maintaining the schedule is painful. Very painful.

We’ve tried committing copies of the crontab to a repository, but they’re almost never up-to-date.

And worse, if I need to do something even moderately complex like, say, schedule a job to run every two weeks, cron starts to get complicated.

But things just got better.

Continue reading

Copyright © 2017 Peter Coles

Theme by Anders NorenUp ↑