GET KPHP and engines release / VKontakte company blog / Sudo Null IT News FREE

Rather often, public speaking at various conferences, we shared the desire to loose KittenPHP under an open license, in accordance with the tradition laid down by large Information technology companies such as Google and Facebook.

This event was delayed several times due to the fear that we would not have enough time and energy to interact with the opensource community, but in the close the treasured Clarence Day came, and the code of KPHP and some strange tools used inside the project was made publicly available.

In this regard, under the cut you wish obtain a more elaborate write up about the internal anatomical structure of VKontakte and those tools that are immediately on hand to the open reference community of interests.

Root codes were ordered outgoing under the GNU licenses (GPL and LGPL). These licenses are ideologically close to USA, since when creating these libraries we ofttimes used tools accredited specifically aside GNU.

Kphp

The source computer code for VKontakte is being formulated in a PHP-like terminology called KittenPHP or KPHP for abruptly. This code is translated in C ++ by a special translator of the same name. Afterward that, the generated C ++ code is automatically compiled with gcc, resulting in a binary ready to run. This binary is a web server that accepts http requests and generates pages.
In social club to speed the development process, KPHP compiles various project files singly, then links. In subsequent compilations, only modified files are cured, or, in the case of large files, only parts of them.

KPHP is a minimalistic words fashioned to provide a very piping hie of work, without compromising on the convenience and speed of development. In this regard, KPHP does not support all the features of PHP, particularly, it does not accept OOP, with the exception of approximately objects of the standard library. In accession, eval and related things, such as regular expressions with the 'e' changer, are not supported (or else, the preg_replace_callback operate is advisable). Also, functions for on the job with specific elements of arrays are non supported: first, end, next, prev, current, reset, key; to supercede them, getValueByPos and getKeyByPos functions are implemented.
The rejection of supporting for a extended amount of functionality allowed KPHP to get incredibly presto compared to unusual tools for web development.
As an object lesson, we compared it with the Facebook developed HipHop VM and got the following results:

Tests Kphp Hhvm Php
simple 0.000 0.007 0.137
simplecall 0.000 0.004 0.174
simpleucall 0.007 0.008 0.178
simpleudcall 0.007 0.009 0.181
mandel 0.010 0.066 0.392
mandel2 0.011 0.074 0.355
ackermann (7) 0.001 0.011 0.189
ary (50,000) 0.003 0.008 0.024
ary2 (50,000) 0.003 0.010 0.022
ary3 (2000) 0.011 0.077 0.191
fibo (30) 0.003 0.019 0.481
hash1 (50,000) 0.018 0.034 0.044
hash2 (500) 0.011 0.021 0.039
heapsort (20,000) 0.012 0.040 0.101
ground substance (20) 0.007 0.021 0.121
nestedloop (12) 0.000 0.012 0.235
sieve (30) 0.013 0.016 0.114
strcat (200000) 0.002 0.005 0.014
results 0.119 0.442 2.992

The test code is available at:
gist.github.com/nameless/9391146#file-bench-php

From a development viewpoint, KPHP is sufficiently compatible with PHP so that you can use regular PHP to quick test the written code, and only compile the code before the final testing and rolling out the project. To support functions enforced in KPHP, but not available in regular PHP, a special library github.com/vk-com/kphp-kdb/tree/master/vkext was added that extends the capabilities of PHP.

In addition, KittenPHP is a good still PHP cypher analyzer that points unconscious possible errors. For instance, in the serve of transferring VKontakte to information technology a year ago, more than 20 serious bugs were found.

Together with the compiling program under an open licence, the developers set outer a located of engines that perfectly complement KPHP, merely can be used separately from it. For the first prison term, we announced these libraries to the open source biotic community at Highload 2010 , so we apologize for the rather long waiting period.

PMemcached ("Persistent Memcached")

Reliable key-esteem storage that allows you to storehouse data without a time fix. Accordant to the MC protocol, the railway locomotive works identically with Memcache, demur that after a reboot wholly the data remains.
In addition to its basic functions, when you enable the corresponding option in the configuration, pmemcached allows you to immediately receive groups of records whose operative prefix matches the one specified in the postulation.

Lists

This locomotive allows you to put in and retrieve various lists of data.
One re-create of the engine can store a set of lists. Each list must have an identifier (int) away which to work with this name.
From each one heel can ingest an unlimited bi of items. Each element must also have an identifier (int), a value (int), a flag (int) and can store arbitrary 256 characters of text.
In addition to receiving lists, it is attainable to receive sub-lists away filtering by flags and sorting by values.

Documentation: github.com/vk-com/kphp-kdb/fleck/master/docs/en/KittenDB_Lists.wiki

Lists-x

Modification of the Lists engine, which allows the apply of keys and record identifiers, consisting not of one number (int), but of the number of numbers (int) predefined in the engine configuration. For example, this allows you to create lists, the Key of which is formed from the drug user ID and the register ID on its palisade.

Documentation: github.com/vk-com/kphp-kdb/spot/master/docs/nut/KittenDB_Lists-X.wiki

Hunt

Premeditated to seek for data on the site. Any matter information can be indexed in the engine with a particularized identifier, and subsequently found by the language in the text. The identifiers specified during indexing wish be returned in the search results.
Search supports arbitrary parameters for searching by criteria, and special parameters for various sortings. The locomotive also allows for complex groupings and intersections.

Documentation: github.com/vk-com/kphp-kdb/blob/master/docs/en/KittenDB_Search.wiki

Storage

The railway locomotive is designed to store user data - photos, videos, audio, documents. Thanks to storing antithetic content in one file and indexing in offsets memory, Depot copes with this task better than victimization the classical approach of storing individual files in a file cabinet system.

Documentation: github.com/vk-com/kphp-kdb/blob/master/docs/nut/KittenDB_Storage.wiki

Texts

The Texts locomotive allows you to store various text data arrays. Initially, it was developed for VK's personal messaging system, but was later reused for walls and for comments.
To boot to storing texts, the railway locomotive supports varied groupings of lists with texts and text edition search. Thanks to him, an instant search is available in the entire personal proportionateness of the user, no matter how big it is.
Also, an HTTP server is built into this locomotive engine, which implements a longstanding poll for receiving updates from the guest side. Withal, later a separate queue engine was created for this aim, which is described on a lower floor.

Documentation: github.com/vk-com/kphp-kdb/blob/master/docs/nut/KittenDB_Texts.wiki

Hints

Hints solves 2 important tasks:
1) Premeditated to search for user objects by word prefixes, used in quick searches happening the site.
2) Allows you to generate ratings of objects with which you tin sieve the lists of objects aside the degree of pursuit in them with the exploiter. For example, the VKontakte friends list works this way.

Documentation: github.com/vk-com/kphp-kdb/blob/maestro/docs/en/KittenDB_Hints.wiki

Queue

Queue allows you to coordinate communicating between the client and server sides straight off. The guest connects to the Queue server assigned to it and receives updates from it, and the server can send the corresponding event to the client at any time. Thanks to the use of channels that the client can subscribe to when connecting to Queue up, the engine can be used to transfer information 1 to many, for example, when the user has a news page open, helium subscribes to the queue for events of wholly his friends, groups and subscriptions. When someone from this list publishes a record, he also writes it to the commensurate queue subscription, and for each one signed user receives information about this on the client, after which the latter can exhibit the received information.

Documentation:github.com/vk-com/kphp-kdb/blob/master/docs/en/KittenDB_Queue.wiki

Additionally to the above, you can obtain in the repository a number of other, non so universal, but no less stimulating tools, the documentation for which you will retrieve here .

Conclusion

By publication these developments, we are backward the debt to the harsh-source community, to which we owe a lot.

We hope that now they will help the projects currently under ontogeny, arsenic MySQL, Memcache, nginx and PHP helped make up VKontakte in due season.

You can see the source cipher of the engines and KPHP in the repository on github: github.com/vk-com/kphp-kdb
Detailed documentation is located at: github.com/vk-com/kphp-kdb/tree/master/docs/ru

DOWNLOAD HERE

GET KPHP and engines release / VKontakte company blog / Sudo Null IT News FREE

Posted by: thompsonusen2002.blogspot.com

0 Response to "GET KPHP and engines release / VKontakte company blog / Sudo Null IT News FREE"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel