Ljupcho Apostolov /data/devs/

On Queues

Following are some challenges I’ve faced with queues. I have multiple queues that have multiple processes each as I curl data from third party and trying to store it in database. There are queues running in parallel, but each queue might dispatch another job in synchronous way even though multiple processes are running on it. The idea is to maximize the time and get the job done quicker, if no need to wait for something to finish, it can go into another queue, but sometime as per business logic I need to wait from update from previous queue, but running in parallel for different entities that are not related. I am using supervisor for running the queues.


Continue reading...

CPU Frequency Scaling with Arch Linux

I wouldn’t go into installing and configuration of Arch Linux, the wiki is accurate, simple and details enough. After installing the main configuration I do is CPU frequency scaling, because after installation the kernel will be set to performance governor and as a result the fans will start running very often. What I want is a quite laptop, I appreciate the silence.


Continue reading...

Controllers don't hold data

Couple of things about how I use controllers. I have seem many cases, many of them I’ve been part of where we extend the functionality of a controller beyond being that a REST endpoint with the usual CRUD operations and having more than that, which usually includes AJAX calls, some business logic, inclusion of third party libraries etc. So, how do we reuse them, well we don’t, we copy/paste the same if-else conditions and put that in another place/class/controller. And what do we do when we change something about it later down the road, well we find/replace that and we’re done, with that we might mess something up but the testers will find it and we will fix it. This has been done for too long and for too many times.


Continue reading...

On Dependency Injection

Having the code decoupled seems like the way to go for re-usability outside the scope of a framework. That’s the main reason I prefer Symfony, I think it has the best approach since you can easily use some of its components someplace else in some other framework or as is.


Continue reading...

On Designing a Module, ORM or not

Most of the framework today are using the ORM approach when it comes to designing their modules/bundles. They would create a class which private or protected properties represent columns in database table. So ORMs would provide CRUD and auto-generate public functions for listing, creating, updating or deleting a record from the table that module lives on.


Continue reading...