How I managed to insert dates in MongoDB and run queries between days.

Introduction

I think one of the most tedious things in Computer Science is dealing with datetime and timezone. If Computer Science were just ordering records by day or querying DBs for records created between ranges of days, I would call myself out of the game.
I learned that the way a timestamp is stored makes the difference and could allow you to run the right query or gives you one of those days.
My case was pretty simple, yet it took me hours to sort it out. We had…


Recently, I came to a situation where I had to schedule a series of tasks that will run periodically in order to do some jobs. A scenario like this looks like a good fit for crontab but I decided to give Celery a go and use Celery Beat.
First of all let’s make a quick recap of what Celery is and what it is good at.
Celery is a python library used to handle time consuming tasks and delegate them to separate processes or distributed network hosts in order to reduce the load of web servers/backend services.
Most of the…


in a nutshell, how to use consumer.seek with kafka-python and python3.x

In this post I’d like to give an example of how to consume messages from a kafka topic and especially how to use the method consumer.position, consumer.seek, in order to move backward to previous messages. I have spent a few days figuring out of to do, so I’ve decided to write a post not to waste my time anymore and share what I’ve learnt. Frankly speaking I’ve found the official documentation of the python package kafka-python a little bit skinny with just ordinary examples. It took a while ,but…

Antonio Di Mariano

Dealing with cloud computing and distributed services. My personal blog http://cloudbased.me

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store