-
Notifications
You must be signed in to change notification settings - Fork 11
Architecture
Hans Christian v. Stockhausen edited this page Jan 18, 2014
·
10 revisions
-
ed_supis the root supervisor -
ed_udp_serveraccepts incoming queries via UDP -
ed_udp_handler_supspawns child worker processes to answer queries -
<0.54.0>and<0.55.0>are examples ofed_udp_handler_serverinstances concurrently working on two DNS requests -
ed_zone_supis responsible for supervising the zone subsystem -
ed_zone_registry_servercontains information about all zones registered with the server -
ed_zone_data_supsupervises the actual zone servers -
<0.53.0>is an example of aned_zone_data_server(this one serves the sample root zone from the end-to-end tests). -
ed_extension_supsupervises extensions such as thesimple_stats_server.
- A DNS query is received via UDP and accepted by
ed_udp_server -
ed_udp_serverasksed_udp_handler_supto spawn a workered_udp_handler_serverto process the request -
ed_udp_handler_serverdecodes the request and callsed_query_resolver(and any extension resolvers) to answer the query -
ed_query_resolverasksed_zone_registry_serverfor the nearest zone associated with the request - if a zone exists
ed_query_resolverrequests a copy of the zone data from the associateded_zone_data_server -
ed_query_resolveranswers the query from the zone data, optionally making recursive calls to fetch additional details -
ed_udp_handler_serverencodes the answer data and sends it to the original requestor via UDP.
This is my first "real" OTP application, so I am not claiming that this architecture is particularly suitable or finalised for that matter. Comments are certainly most welcome.
If you are new to OTP, please take a look at my tutorial here: http://blog.bot.co.za/en/article/349/an-erlang-otp-tutorial-for-beginners. It's become quite popular and I had to constantly refer to it as I built up the app.
