After searching the web for this answer and not finding the right answer anywhere, I decided to write it myself in the end.

First of all, there is not really a way to Unit Test your CRON. The only logical test that you can make is an Integration Test.

Here our tokens have expires_at columns. We run our CRON weekly and take all the expired tokens, then delete them.

How to test it properly:

We create a user in the DB and expired tokens for him, we use the artisan to run the command.

We should also check how many tokens were before and after the CRON running. And this should be it.


Firstly, a little about myself.
I am working at an IT company for over a year now and as far as the policy goes, the best code is no code at all.

Why you may ask? I suppose everyone will tell you that the more lines of code you add, the harder the app is to maintain and you have to test most if not every aspect of that feature you add.

You could do this manually but you would have to do it over and over after any and every new functionality added.

Or you could make some automation…


Some of the popular options are MongoDB and Firestore.

In this paradigm our model structures data in documents where each one of them holds key-value pairs of data (Quite the evolution from Key-Value and Wide-Column paradigms, right?).

They do contrast strongly with the traditional RDB because they store data in separate tables that are defined by the programmer.

But how are documents found?

Documents are found in the DB by a unique key that represents the document’s identity, it can be an ID, a string, a URI or a path.

Can I edit documents?

Yes, you can!

Document DB’s typically provide some mechanism for updating/editing the content of a…


In short, a wide column model is a type of NoSQL Database. It uses tables, rows, and even columns! (Quite the upgrade since the key-value model)

But wait… we can interpret the wide-column store as a two-dimensional key-value store.

The two major players in this category are firstly Apache Cassandra and Apache Hbase, I said earlier that they have columns and rows but they are not in the original sense.

In the original columnar data model, each column is stored separately on the disk.

Wide-column stores usually support the notion of column families where data is stored in a row-by-row…


I feel like I should not reiterate this but… we all know what a database model is. It is a type of data model that determines the logical structure of a database.

The most popular database paradigm is the relational model.

But why is it so? And are there any other database paradigms used?

Key-Value Model

It is similar to an object in PHP, Javascript or others. It contains unique keys that point to unique values.

{
"key" : "value"
"foobar" : "foo"
}

And we can directly add or retrieve values by using commands!

redis> SET key:something "Coffee with beans"
redis> GET…

Before we talk about anything, we should define what an RDBMS is.
RDBMS stands for “Relational Database Management System” and is designed specifically for relational databases.

But what is an RDBMS used for?
They are used for: writing data, running queries, controlling database access, etc.

SQLite Overview and features

SQLite is an embedded, file-based RDBMS that does not require any installation or setup, which means it can work serverless and its serverless architecture enables the database to be cross-platform compatible.

The database is stored in a single file on the disk and all writes and read take place directly on the disk file.

Advantages

Easy…

Coman Cosmin

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