Online Education website design free download

Online Education website design free download tutorials – Education website template free download

The online education website HTML CSS Template is a website template that has a clean design with a lot of customization options. The site allows you to create your own online learning center with no coding skills required. There are many different layouts, colors, and fonts to choose from and it is easy to customize the site to match your needs. The site also has a blog section where you can write posts about your online education center.

Consistent Hashing is an algorithm for load balancing on servers. It is used to ensure that when new servers are added to a distributed system or a server goes down, the impact on other servers is as minimal as possible. In this article I will not discuss basic hashing so much, I will discuss how consistent hashing works and what kind of problems it is useful to solve.

Before describing the algorithm itself, I’ll start with some background so you understand exactly what problem it’s used to solve. A very common use of consistent hashing is to determine where data should be stored in a distributed cache. As we discuss that, we will learn about consistent hashing.

Let’s say you are the maintainer of an app like YouTube. You have a lot of video metadata in a database. That is, the title, category, uploader information of the video is kept. It can be any kind of database, that is not our discussion.

The problem is that your site has a lot of users, millions of users watch videos on your app every second. Each time you have to fetch your metadata from the database. Once you see that the database cannot handle so much load, what do you do when you install a cache server in front of the database.

If you cache the metadata of the videos in the memory of the cache server, when someone needs the data, first check whether the cache is there, if there is, then return immediately, if not, return the data from the database and leave the data in the cache. You can use LRU cache in this case, I discussed that in another article, no need to worry about it for now.

Online Education website design free download tutorials – Education website template free download

So your life was going well for a while, but then you see that a server is running out of space. Maybe your server has 50GB of memory but the metadata database has 150GB of data.

If you think about caching data on multiple servers as the cache miss rate increases a lot. And now the complex begins in your system!

Now you share 150 GB of data across 3 cache servers. But the question may have come to your mind, which video data will be on which server? Since we want to keep a single video data on a single cache server, data replication is out of today’s discussion.

Suppose the number of your cache servers is N

And each server is identified with a number between 0 and N–1. One way to distribute the key is to extract the hash value of the key and calculate the modulus with N. In our example this key will be video_id. For this purpose we can extract the hash value using any algorithm like sha256.

Now we can easily find out which video metadata is in which cache server. The problem will be if we have to add a new server. Then in our map_server_id function hash(video_id) is OK but N

Its value will change. By doing this, many video IDs will be hit on another server instead of the server they were hitting before.

Maybe 100120

The number video was hitting server 1 before, now maybe it will hit 2 and the video is not cached on that new server. Server 1 again

This video is cached but no one is looking there anymore. That is, the keys have been remapped to another server.

At some point, the old server’s cached data will expire and requests to the new server will actually be cached there, but for some time in between, the cache hit rate will be very poor and affect your service’s performance.

Same problem will happen if any server goes down. If only one server out of 100 is down, all keys

Its mapping will be random and will degrade the performance of the remaining 99 servers. This is where consistent hashing can help us.

Consistent Hashing

We can imagine our servers are placed on a circle. The full circle is 232–1

Divided into (INT_MAX) parts. After dividing, I have placed our server 3 in 3 parts.

This is called a consistent hashing ring. To get the location of the server on the circle we need to hash one of the identifiers of the server and mod it with 2^32 – 1, then we will get where the server sits on the circle. This identifier can be the server’s IP address or some other device ID.

Now in the same way we can map any video ID to any part of the circle using the same hash function and mod value.

The idea is that after mapping the key or in this case the video ID on the circle, we will rotate the circle clockwise and the nearest server will take over the responsibility of that key.

Online Education website design free download tutorials – Education website template free download

In the above example mapping 100120 to a location between servers 0 and 2, so 100120 is hitting server 2.

A. You can also implement counter clockwise instead of clockwise, it is your choice.

Now what happens if you add a new server? Let’s say I’m server 3

Adding up, it sits somewhere between 0 and 2.

Some keys that used to map between 0 and 2 after installing Server 3 will now map between 0 and 3. That means some keys that used to hit cache server 2 now hit server 3

This will hit. Adding this new server will not affect any other server.

Same thing happens if a server goes down, if server 1

If down then the traffic of that server is server 0

This is the basic concept of consistent hashing. Its advantage over normal hashing is that if the number of servers increases or the number of users increases, the impact is greatly reduced.

There are two major problems with this approach. I will discuss that now.

Server Location Distribution

One problem is the server location distribution. Mapping server hashes on a circle may not equal the distance from one server to another. 0 in our example

And the gap between 3 is quite big but the gap between 3 and 2 is quite small. That means more keys will hit server 3, server 2

You won’t get as much traffic. That means we have to figure out a way to keep the load on all servers close.

The domino effect

Online Education website design free download tutorials – Education website template free download

Before Download

You must Join our Facebook Group and Subscribe YouTube Channel

All Links in Below:






Join Our FreeWebsiteCreate Facebook Group to get an instant update for projects, templates, design resources, and solutions.

Join Our YouTube Channel & Subscribe with Bell Icon for New Video:

Join Our Official Facebook Page For the Latest updates All Code Projects are Free:

Visit our service page to get premium services.

Free Website Create – HTML CSS, PHP, JavaScript Programming Projects For Free

Follow Us

Thank You,

Stay with FreeWebsiteCreate.net

Share the post if necessary.

Before Download

You must Join our Facebook Group and Subscribe YouTube Channel




FreeWebsiteCreate.net tries to provide HTML, CSS, SCSS, JavaScript, React, Android Studio, Java, PHP, Laravel, Python, Django, C#(C Sharp), and ASP.net-related projects 100% free. We try to make learning easier. Free Website Create always tries to give free projects to new learners. Free projects and source code will help to learn quickly.

They can save time and learn more. In this post, we share a free portfolio project website code with HTML and CSS. This free code portfolio contains a single landing page with a responsive design. In this post, we get a free best carpenter and craftsman service website designed by FreeWebsiteCreate with HTML, CSS, Bootstrap, and JavaScript.

To get a free website project code,

Keep bookmarking our website, Save categories links, Follow Social Media, Follow the youtube channel Join Facebook groups.

Stay with FreeWebsiteCreate.net

Share the post if necessary.

Leave a Comment