Public class DBServerAchieve {public static List <Front> frontList = null; public static List <Line> LineList = null; public DBServerAchieve () {if (frontList = null & LineList = null) {frontList = new List <Front> (); LineList = new List <Line> (); GetSaticDataFromMySql (out frontList, out LineList );}} /// <summary> /// Load Static Data /// </summary> /// <param name = "frontList"> </param> /// <param name = "LineList"> </param> private void GetSaticDataFromMySql (out List <Front> frontList, out List <Line> LineList) {throw new NotImplementedException ();}}
Paste a short piece of code here, which is relatively simple. In fact, it is loaded in the DBServer implementation class constructor. Some static data, the database persistence layer used by the author, the factory mode is used for data separation. I think there should be a lot in the garden.
Finally, let's talk about how MYSQL replication works.
(1) The master will record changes to binary logs (these records are called binary log events, binary log events); (2) slave copies the binary log events of the master node to its relay log. (3) slave retries the events in the relay log to reflect its own data.