I was curious if MongoDB compression can efficiently store IDs if they are represented as string instead in a more compact binary form. So I made a benchmark and measure compression performance of three available compressors: zlib, snappy, and zstd.

Results for MongoDB 4.4.1 of storing 128 bit random values (e.g., UUIDs) as binary (16 bytes) or as base-58 encoded (22 characters):

Image for post
Image for post

zstd compression looks really good. Moreover, it is clear that storing values as binary is more efficient than as string, even with compression, because compression can compress also binary representation despite values being random. The most compressed string size (zstd, 5410816 B) is still larger than the least compressed binary size (snappy, 4923392 B). Do note though that zlib compressed string (5537792 B) and zstd compressed string (5410816 B) are smaller than uncompressed binary (6168576 B), meaning that those compression algorithms can recover storage lost in string representation. …


Gravity seems to be our first and most important teacher. Patient, consistent and always present. Children can learn cause and effect through it. What happens if I lift an object and let go? Over and over again. On repeat. Always the same thing.

When we think about life in space. Can we raise children there? Can children grow up in zero gravity? Can they develop their mental abilities without having this teacher around them? Or will they develop in other ways? A different kind of logic?


Database-abstraction APIs where you write a query using the host programming language should not exist. Or more precisely, should not have to exist. For example, in Django you can query the database using the following Python code:

Entry.objects.filter(is_draft=True)
SELECT *
FROM blog_entry
WHERE is_draft = true;

Babel

I have confidence in this claim because of the success of Babel JavaScript transpiler and the ecosystem around it. Babel can take a newer version of JavaScript as input and converts it so that it can run in older JavaScript runtimes. It maps new features to old ones. It allows one to use syntax of new or even just proposed features of the JavaScript language. …


I recently finished my PhD thesis and is now available online. Most of the code related to the thesis is available in this repository.

Abstract

The rapid increase in the amount of data collected is quickly shifting the bottleneck of making informed decisions from a lack of data to a lack of data scientists to help analyze the collected data. Moreover, the publishing rate of new potential solutions and approaches for data analysis has surpassed what a human data scientist can follow. At the same time, we observe that many tasks a data scientist performs during analysis could be automated. …


Recently I was exploring the use of PostgreSQL as a replacement for MongoDB. PostgreSQL has in recent versions great support for JSON. You can store JSON values and you can even make indices on JSON fields. When combined with node.js and its driver things look almost magical. You read from PostgreSQL and you get automatically a JavaScript object, JSON fields automatically embedded. But can we also use JSON for transporting results of queries themselves, especially joins? In MongoDB the idea is to embed such related documents. In PostgreSQL we could also embed them instead of joining them, but would that be faster? …


I am a big fan of the application architecture promoted by Meteor. I like declarative programming. You describe what you want and not how and the system does the rest. Reactive programming is very similar. You define how outputs should be computed from inputs, but when is this computed and how it is composed with other computations is left to the system. So you can define what is read from the database and send to the client. And how it is read on the client and transformed and send to the UI library. And then UI library can render this data. …


Proof of work consensus protocol used in modern cryptocurrencies like Bitcoin and Ethereum consumes a lot of energy and requires participants to use their CPUs for mining instead of other useful work. But exactly this cost is why it is works to prevent Sybil attacks. One cannot participate in the selection of the next block without paying this cost, which makes the issue of puppet participants trying to influence block selection irrelevant, because they also have to do the work, and pay the cost.

In recent Intel CPUs a new set of instructions is available, SGX, which allows one to run code inside a special environment where even operating system cannot change its execution. In the paper we published (arXiv, Cryptology ePrint Archive) we explore consensus protocol designs using the Intel SGX technology, with the goal of making blockchain participation energy efficient, with low CPU usage, and to democratize mining so that participants can participate again with their general purpose computers (with Intel CPUs) instead of only with specialized ASICs. …


In May 2011 a EU directive was adopted with the goal of empowering web users with control over their exposure to cookies. The main issue is that 3rd party cookies allow users to be tracked across websites. The issue is that websites are often a mash-up of content coming from various services, each providing their own set of cookies. A service (a 3rd party) can thus track users across all websites using it.

In Slovenia I have participated in the process of adopting this directive into a local law which come into the effect in 2013. During this process I believed that the goal is good, and the law is reasonable. I thought that it handles technology well and with understanding, defining cookies broadly enough to be applicable to various tracking techniques and not just literally only cookies. …


Bitcoin, Ethereum, and blockchain in particular are often claimed as revolutionary as the Internet itself. They will decentralize the Internet again, change how we make apps, empower end-users, and remove intermediaries. But are they really so revolutionary? Even ignoring the technical limitations of scaling and power consumption, we can hardly imagine such wide influence on our society as we observed for Internet. Internet connected people globally, provided means of immediate communication and access to knowledge and information. It changed many aspects of our lives and how we as a species operate. But blockchain, does it really have this potential?

Take Bitcoin for example. Its technical innovations are undeniable, but as a currency itself, it lacks innovation. It is still a one-dimensional numeric-like value assigned to each transaction. If we are comparing it with the Internet, then it is the Internet in the form where people would take physical books, scan them as images, and make them available online. No interactivity, no multimedia, no searching or social capabilities, no additional value besides digitizing the content in the most simple way. Bitcoin does the same. It just digitizes existing concept of money. It does this in an interesting and innovative way, but it is still just a digital image of money. …


Together with popularization of blockchain we can notice revived calls for decentralization of national and international governments, their reboots, or even their dissolution. But such calls lack fundamental understanding of how our governments operate, their role in our global society, and what all in fact regulate and control our existence beyond just governments.

Jo Freeman in her essay The Tyranny of Structurelessness reminds us that humans tried to remove centers of power and organize themselves in a horizontal way in the past as well, and presents to us issues with power relations she observed in a 1960s women’s liberation group.

What she observed was that once you removed explicit centers of power, implicit and hidden centers of power emerge. I see this is as a normal social phenomenon. More people we have to coordinate with, more effort and time coordination requires from us. Especially as the community scales up and more people join. We start interacting more with those we interact easily, and cliques emerge. Through time some of those gain more power than others because they do not distribute their power outside the clique in the same way as inside. …

About

Mitar

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