Yes, thank you, my name is Andres, I'm actually the most known from my Node.js email protocol
Libraries, like the Node Mailer and some other Libraries, basically if you use some kind
of like email client or that uses Node.js or JavaScript or load-flare email workers
and probably there's some kind of my library in the stack somewhere, usually.
But today I'm talking about one of my biggest projects that is called the Vital email server.
It's slightly similar to StarWart and it's also when I started it quite a long time
ago, it's probably in 2016, so it's quite old, but it's not very well known because
it's I've been mostly building it for one single company, but yeah, that's just some
code I came up with, but yeah, it's just that it means that we email is basically to the
end of today's work, it's like a digital passport, it's like a common alone, if you like
sign a document with a token sign or some other platform, then you are identified by your
email address, so it's even though it's not meant to be and it's not the digital passport
and in reality it is, so it's but so the services that are using email are like evolved
quite a lot, but the email infrastructure itself usually is not so much, so in this like
presentation, I'm not trying to like other things, but it's more like a lesson slurrent
store here, why is some design decisions, how they were done, so, and so it's mostly
used by this one single stone and company, and also from a stone from Dalin, and it's
a web hosting company that uses it, there are more than 100,000 active accounts, and if you
do the math and they're like the other, it's a mini actually, a mini one, say quota, account
is 12 gigabytes, so it's if you multiply 12 gigabytes with 100,000 then you get quite a lot,
more than 1000 gigabytes, so obviously not everyone is using all the like space that they have
like available, but in today's world nobody's deleting the email anymore, it's just moved
to the market, I've followed that, and so it means that mailboxes, mailbox sizes are like
confetti growing, and people are reaching the quota limits, and in addition to this company
uses custom email client built on top of a while the KTI, this email client is going to have
to not open source, but I hope it will be, but right now it's not, and yes, so it looks, and
and actually the problem statement, where the who's a fight act, like come from a way to
speak like this in these are in the history of them who don't lamp stack, before we had like
all these cloud hosting providers, they have like tons of small lamp hosting providers,
the Linux Appetra, MySQL, and PHP, so it's something where you would just put and the
host of birthplace for example, and thing was with these kind of providers is that the packages
are usually quite cheap, like $5, $10, or years, and the main business was this website hosting,
but in addition to that, usually the company is the hosting providers, also provided the email
accounts, and at first it was just give away basically, it was cheap to maintain for the
company, because the mailbox size is very small, if you've been around, then you maybe
remember that even hotmail had a mailbox quota size two megabytes, so that's not one email,
that's not one attachment, that's the entire mailbox, so all the emails had to fit into two megabytes
at this place, so when it's not too difficult, even in back in these days to host this,
where it's small mailbox, you don't put a lot of emails into this place, so two megabytes
is like an extreme example, but the 10 megabytes was quite common, I would say, and maybe later
there was a hundred megabytes, but it was still like really small, but once a Gmail game around,
then suddenly a Gmail had a very large quarter sizes, then people started demanding more,
and now the web hosting company has this issue that they were still getting this very cheap,
hosting clients, like $5 or $10, or years, but users demand that large as main boxes,
but they were not, they didn't want to pay for this, so it basically wanted to do the service
for free, but this, but providing the service was not so cheap for their hosting projects anymore.
Yeah, so it's kind of the back history of how one that came to be, it's basically
an attempt to quite cheaply provide more or less normal mail service to users that do not want to pay for it.
Yeah, and there's some additional problems as well,
like with mail, especially, we all have the major information in salvage speech, as well,
the main problem with mail there is that it's all your emails are in a single folder,
and so it gets really difficult to, if you have a large number of users, then it gets difficult
to provision a disk space to host these users. Let's say you have one gigabyte of quota
for one user, and you have one database that then means that you can put thousands of users into this,
but usually users have used, let's say maybe on other it's 100 megabytes, so it turns out that
you have this one database, like this, but you only use 10% of it, so 90% is unused,
and so the providers to, like, got cost, they would oversell it, and instead of selling this,
saying that they have by this, the thousands of users, they've ended 10,000, let's say.
But now sooner or later, he will start to hit the limits, and the users may want to not fit into this
piece anymore, and you have to start to migrate to some other, just in style, you know,
mail server, and migrate a bunch of this mail folder to this new server, but mail
there means that each email is a separate file, and if you have one gigabyte, like, mailbox
that you need to migrate at once, you can just migrate it like separately, but everything needs to be
moved, like, at the same time, then there might be, like, maybe 10,000 or 20,000 files in this folder,
and you have, maybe you have to, like, migrate 100 users of this, so it end up that you have to
start copying, like, millions and millions of small files, and even though, like networks are
fast, then moving small files is never, like it was too fast, so it gets, like, really thick,
and you have to do it like all the time, all of, like, if you go to this kind of hosting products,
like, network hack, then you can see that lights are always blinking, because there's so much
small files, like, moving around, so it's a very complicated. Other problems is that the
configuration changes, the standard source of the user's configuration files, and which means
that if you do something, like, then email address, like, alias to some user, or change the
quarter of whatever, you have to reload the process, but if you have, like, a large number of users,
then there's always someone who's changing something, and but you kind, like, constantly,
keep reloading the, like, to post-fix or Tomcourt or whatever. So what is the solution is that
you just wait a bit, maybe five minutes, wait, then minutes, and then you're reloading,
and then just all the changes are applied, at once, which is, like, highly inconvenient,
because if the user happens, that's, like, an email address, alias, he, like, submits the
form, and now the alias still doesn't actually work, because it takes five minutes, or
then minutes, until there's several configurations, he reloaded.
Some other problems is, like, a spam fighting, just, I first know why they didn't take it,
do anything about it, but then it's just full-time job, somebody has to, like, keep an eye
all the time, what's going on with, like, the spam situation, really bad visibility, just
log files, and two files at best, and one of the worst problems, IP blacklisting,
that if you have a lot, number of users, then there's always some bad apples there, and if someone
just sends out a spam email, and your IP address gets blacklist that you then, nobody from this
server is going to send any email, at least for our, which is, not okay.
And so, while that was meant to, like, fix these issues, there's, there's no single points of
failure, it's, each component can be, like, complicated and if anything comes down,
then one of these components then nothing actually happens. You can just set up a new process
it's also always not that scaling, and you can just add new instances, and you don't have to,
like, migrate use access, just, actually, the main thing here is not to wipe that itself,
but database, because most of the work is done by the database. And also, instant changes,
all changes are fun, VIPI, so it's just, if you have a new area of change quota, then it's just
a place immediately, and also this storage and the API haven't, but it's just getting to it
reversed. And now it's, like, sometimes, there are a lot of things to talk,
because it's used as a MongoDB as the email storage, it might not see very reasonable,
but, but it is, it's well long time down that the databases are not too
good for email, but, but using MongoDB's different, that MongoDB itself, it's, I chose it,
it was back in 2016, it was all the hate, everyone used MongoDB back then, and also one of the,
like, good, like, reasons for that MongoDB is, there's a backing component, because we were
considering the MongoDB, and the hate, and the hate, and the hate, as been, like, for yes,
but because MongoDB had a backing component and it's still around, works quite well.
And, I mean, the issue with MongoDB that it stores documents in, like, like,
not, like, table house, but, like, documents, and this, naturally fits the,
mind-tree structure, because in Wildtuck, when an email comes in, or has uploaded, then it's
passed into a mind-tree and stored as a, like, taste structure, and not as the whole email file.
Yeah, this is a, like, normally, you would, in the mail, you have this store, this email files
in, like, each folder, it may, it may be full, that is, actual folder on this,
but in Wildtuck, the message is passed, and stored in, like, this, stop, just form.
So, what it, it makes, like, the release of two is filled in API on top of it.
So, the Wildtuck API is actually just a, a healing thing in the map, just, on top of MongoDB,
you ask for, like, message, and there's, obviously, some, like, permission checks,
but, in the end, you just get, almost, the whole database echo from, from the database,
and it's just a structure, the JSON. So, it's just a turning, emails from,
storage is, like, extremely cheap and fast. And there's also a lot of storage optimizations,
because, when email comes in, it's, it's all, it's, it's talks, but,
attachments are taken out of it, of the email structure. So, the attachment usual in an email is
space 64 encoded. So, while it takes out, the attachment, the code is into, like, normal,
binary file, and then, it complicates it against the attachment storage. So, if you have all
had the same file stored in the database, then, we do not store it the same attachment second time.
One, the place where it's, like, helps a lot, like, food that she's not sure, that's usually
some kind of logo or something. And, these kind of emails can be, like, in millions, so, instead of
storing a million copies of some logo file, it just stored one copy, and it says all the,
all the emails just have, for instance, one copy from the database. So, it's, like, a, it's,
three level optimizations. And, this, although it just describes how we get back, how we use
attachments. So, the problem is that when we want to delete an attachment, then we want to make sure
that it's definitely not transparent by any email, anyway, because MongoDB is, it's not the
relation database. So, it's kind of, kind of, difficult to keep back what you just, what,
so we use this kind of multi-contest, just to keep back of it. But, I'm not going to be very
deep into it, because I don't have much time. Yeah, that's the same thing. The third level of
compression, but that didn't talk about, was that a wire type of compression, that also applies.
So, we first, when we get the base 64-thousand, then first, we decode it into binary file,
then we duplicate and finally, it's stored as our compressed file. And,
another thing that we did is that we used, like, this custom hardware. So, we set up this setup,
where we had this smaller SSD disk, and the larger SSD disk on every MongoDB instance,
like, several instance. And, to me, it's a point for us that we put all the, we structure the MongoDB
storage in a way that, or the main database was mounted to the SSD, but, at the, at the
attachment contents, where, at, mounted to the, it's very cheap, like, yeah, hey, well, database.
And, in this way, we had, like, MongoDB cluster with several copies, we didn't need to,
like, hey, there's some more, some other kind of, like, guarantees that disks are working.
Yeah, it's all stateless. So, it, you can just, it's just the point is that you can connect to any,
any, why, that instance, and that's it, because it doesn't matter which kind of things
are connected to. Yeah, maybe just one thing you mentioned is that we use a basically
floating, so it's a, you know, change something in an email, for example, marketer, say it,
or at the start, or whatever, or delete it, then we float in direct cluster with this information,
and if some, the same user has, like, active session in some other server, then it gets notified
with this, and we use the reddit group system for the floating. Yeah, that's the API thing.
Yeah, that's the, we don't have to heal out the system anymore. And there are also, it's just an example
that the making are like, I'm up client, on top of, like, actually, I'm up there, very more
difficult than just fixing a JSON from there, I think, which is coming, extremely fast, because
it's coming, it's taken from the database. And also we can, as we control an entire stack,
we can use, like, modern authentication systems, especially in the way, my client, we can use
the pass keys and whatever. And maybe it's just, yeah, also notice this is that we can also,
we have a really good visibility into everything, but it's also happening in the email cluster,
so we can just see, from which geographic locations, someone is logging in, or if even more
important, which geographic locations are trying to log in to different kind of users or
goings for example, just to find out that if someone is attacking the logging system, or all
kinds of different kinds of events that happen, because everything, everything that happens is sent to
the K-log server, and K-log server, just can show it like in my suite. And for just to
meet another, like, related project, it's own MTA, it's, it's, it's also built and used for
sending emails. And this is, this, the difference with, like, post-fixies that the user's share,
share, share, share, share, all point, Q. So we can just, if one sending server gets back,
it's likely that we can just take it out, and all the identified, the person who sent a spam,
so we can disable it, and just, who, everybody, sells emails to some other NJ server,
and you don't have to worry that this specific IP doesn't work at all.
Just, yeah, and just to finish it, what work is that among what it is, what, well,
the mind-tree, it's, having everything stateless is huge win, because you can just,
really easily replace, upgrade, for example, and stuff. Yeah, and the disk savings cost,
like the K-logs, but main problem is that as the database is really large, like hundreds of,
the habits of data, then it gets quite difficult to tune this kind of database.
And also, I'm a partner, well, I'll say in the third cases, which, so we each email client
can make some really worth a comment. Yeah, that's it for me.
I see that you're not storing the raw line is decomposing that. As an I'm explained, I need the original line.
So, example, what do you do? If I want to verify a digital signature, am I getting advice to buy,
you're hitting the mind-tree? Yeah, yeah, the question is that we,
basically, take compile the email into stocks at the format, but in a lot of cases, we need
the original email back. So, the answer is that in both cases, you will get the same email
by the byte, but not in all cases, because when we like take the email into bot,
then there's some data loss involved. It's very little, but it's still there. So, for example,
in take-aim validation, it's still there all the validation beforehand, the store, the information
with email. So, when you make the API request to get the information about the email, then you
get also the authentication validation results that this, but if you would try to replicate it,
then in most cases, you will get the same result, but not in all cases. The reason why I'm asking
is the, um, um, um, unobstruth of this email signatures that I can sign without encrypting, and then I can
verify any more of this program, right? Yes. So, let's move to the same question.
I want to continue the question. What will be this poor word in both sides? It was a poor
word in, you continue the same, it's very significant for example, and the take-aim sign is a
body and heaters, and if a polyurethane structure of a basis before you can't get for a basic
support structure, I should probably get right, but if it's a case, then take-aim signature will
force applied to the operating system, right? Yeah, the question is about forehanding and keeping
the integrity, I guess. In forehanding, everything works because email, like take-on-piling happens
when we store the email, but the whole having happened before it. So, we get an email, we see that
it matches some going the forehanding hole, and just forehand the email, and that's it, and store
it's in the email, but then we store it on the disk, tell me, do the take-on-piling, and after this,
you don't do any forehanding anymore. I may have missed it, but how do you undo search?
Search is handled by MongoDB built-in text search, why?