[Wiki] Allows people to use a model-driven approche to building applications. It is an implementation of the MOFM2T standard, for performing model-to-text transformation.
Acceleo provides tools for code generation from EMF (Eclipse Modelling Framework) based models. Allows:
Code generation from any kind of metamodel compatible with EMF like UML 1, UML 2 and even custom metamodels (DSLs)
Customization of the generation with user defined templates
Generation of any textual language (C, Java, Python ect)
The notion of model transformation is central to model-driven development (MDD). The goal of MDD is to describe a software system using abstract models (such as EMF/ECORE models or UML models), and then refine and transform these models into code
Available transformation languages:
M2M: Eclipse implementation of the OMG QVT standard
IJSPM is a fully refereed publication providing an international forum for high-quality papers seeking to discuss simulation and process modelling issues.
Objectives
The objectives of IJSPM are to develop the theory and practice of simulation and process modelling. It aims to provide a unified discussion forum for academics, researchers and practitioners interested in the modelling and simulation of business processes, production processes, service and administrative processes and public sector processes. Ultimately, IJSPM seeks to disseminate peer reviewed papers relevant to the simulation and process modelling communities.
Readership
Researchers and academics, industrial engineers, management scientists, operations managers, consultants and other practitioners, professional associations, software houses and software developers.
Contents
IJSPM publishes original papers, state-of-the-art reviews, modelling papers, case studies, conference reports, management reports, book reviews and notes, commentaries, and news relevant to the journal. Suggestions for special issues and publications are welcome.
Topics covered include:
Theory, methodology, techniques, tools
Modelling/simulation of:
Business processes
Production and healthcare processes
Service/administrative/public sector processes
Supply chains
Reengineering of business processes
E-business processes
Verification and validation, simulation life-cycle evolution
Web- and component-based simulation
Recent developments, distributed simulation
Performance optimization through simulation
Educational and training approaches, case studies and curricula
Simulation in collaboration environments
Simulation standards and languages
Monitor the execution performance and test coverage. Our profilers are made for the Pharo and Visual Works platforms
Rossal: an agile visualization engine. It turns your programming environment into a beauty center for objects. Roassal graphically renders objects using short and expressive Smalltalk expressions
Mondrian: build on top of Roassal
Map Builder: play with your visualizations and Roassal to get a really nice stuff like this
Graph-ET: draw charts, graphs and histograms, buit on top of Roassal, to let the user enjoy all the different interaction with the visualization
Research Paper (Academic Paper) : to make a contribution to the scientific body of knowledge
Insight Paper : to meet the needs of practitioners, managers, professionals, experts, and policy makers by being peer reviewed to high practical standards
Position Paper (Idea Paper): presents an arguable opinion about an issue. The goal of a position paper is to convince the audience that your opinion is valid and worth listening to, without the need to present completed research work and/or validated results. It may be a short report and discussion of ideas, facts, situations, methods, procedures or results of scientific research (bibliographic, experimental, theoretical, or other). The acceptance of a position paper is restricted to the categories of “short paper” or “poster”, i.e. a position paper is not a candidate to acceptance as “full paper”
Regular Paper: presents a work where the research is completed or almost finished. It does not necessary means that the acceptance is as a full paper. It may be accepted as a “full paper” (30 min. oral presentation), a “short paper” (20 min. oral presentation) or a “poster”.
Full Paper : reports on a completed project or piece of work, including validation of the results (Full papers must include at least one member of the Scientific Committee among the reviewers. Only full papers may be candidates for selection for the Best Research Paper, Best Student Paper, and Best Insight Paper awards). They will be awarded a 30′ min. slot for an oral presentation and they will be assigned a 12-pages limit in the Conference Proceedings. They are sent to all major indexers
Short Paper : intends for the reporting of part of a complete project or piece of work (for example, it may describe a project or research plan, a literature survey, the design of an information system, the development and testing of software, user evaluation of developed software, deployment, a real incident, a proposed new policy, …). They are awarded a 20’ minutes slot for an oral presentation or assigned to present at a Poster Session, and they will be assigned either an 8-page limit if submitted as regular papers or a 6-page limit if submitted as position papers, in the Conference Proceedings. They are sent to all major indexers.
Oral Presentation: Accepted papers can be presented either orally or as posters.
Poster: Posters will have a specific session for being presented to a larger audience, between 45 and 60 minutes, during which authors must be next to their poster to answer questions. The poster must not exceed the A0 (84 cm X 118 cm) portrait format. Please use an appropriate font size for the posters so that they are readable by the participants from 1.5 meter away. The poster message should be clear and understandable even without oral explanation
Doctoral Consortium: The student should prepare a set of slides that clearly illustrate the main points of her/his Ph.D. project, and make sure the presentation fits well within the assigned 15 minutes slot, leaving time enough for a period of question-answering from the advisory board, who’s comments are expected to be helpful for the progression of her/his Ph.D. project. It is normal to have slots of time when up to 3 Ph.D. related projects are presented and then have those presentations analyzed by the advisory board
Demonstration
Workshop: The purpose of workshops is to provide a more interactive and focused platform for presenting and discussing new and emerging ideas. The format of paper presentations may include oral presentations, poster presentations, keynote lectures and panels
Pharo is object-oriented language (live object), Smalltalk-inspired, an environment in which you can (do not even have to stop the system while doing those):
Extend Object
Modify the compiler
Customize object the inspector
Build your own the domain-specific debugger
Everything is object (Classes are objects too); every object has a class; all methods are public
Everything happens by sending messages
Consists of: Parsers, Compilers, Domain Objects …
Smalltalk is an object-oriented, dynamically typed, reflective programming language. Smalltalk was created as the language to underpin the “new world” of computing exemplified by “human–computer symbiosis.” It was designed and created in part for educational use [Wiki]
In Smalltalk, everything is object and everything happens by sending messages
Smalltalk offers no special syntax for control constructs. Instead, these are typically expressed by sending messageto booleans, numbers and collections with blocks as arguments.
There are 3 kinds of messages (with the precedence corresponding)
Unary message (ex: 1 factorial) – with form: receiver selector
Binary message (ex: 1 + 2) with exactly one argument – with form: receiver selector argument
Keyword message (ex: 2 raiseTo: 6 modulo: 10) with an arbitrary number of arguments – with form: receiver selectorWordOne: argumentOne wordTwo: argumentTwo
Unary messages are always sent first, then binary messages and finally keyword ones
The European Modeling and Simulation Symposium is one of the most important Simulation Appointment in Europe. As tradition the conference focuses on Modeling & Simulation in Industry taking into consideration both applications and theoretical approaches. This event is the ideal framework for setting up European Community and International Projects and it could be used as a framework for hosting project review meeting and project exploitation. The audience includes both users, vendors and scientists operating in applying advanced techniques to industry, business and services. The International Program Committee will accept two types of camera-ready papers: extended paper (10 pages, 2 columns); regular paper (6 pages, 2 columns)
Conference Topics
Topics of interest are included in the following areas, nevertheless different topics concerning Modeling & Simulation are welcome.
– Modeling & Simulation In Industry and in Industrial Engineering
– Effective Design by Modeling & Simulation
– Modeling & Simulation in Business, Economy, Finance and Commerce
– Modeling & Simulation Methodologies, Techniques and Applications
– Discrete and Combined Simulation
– Industrial Processes Modeling & Simulation
– Industrial Engineering
– Agent Directed Simulation
– Petri Nets based Modelling & Simulation
– Simulation and Artificial Intelligence
– Workshop on Cloud Manufacturing
– Simulation Optimization Approaches in industry, services and logistics processes
– Human-centred and Human-focused Modelling and Simulation
– Workshop on Soft Computing and Modelling & Simulation
– Workshop on Cloud Computing
– Simulation Approaches in Logistics Systems
– Modelling and Simulation in and for Education
Journal Special:
Modeling and Applied Simulation for the 3rd Millennium: Enhancements in traditional Approaches and moving towards Simulation as Service (Cải tiến những cách tiếp cận truyền thống Hướng đến mô phỏng như là một dịch vụ)”, International Journal of Modeling, Simulation, and Scientific Computing
New Insights into the Application of Simulation Modeling Multidisciplinary domains including Industry, Logistics, Defense, Healthcare, Energy and Environment (Ứng dụng mô phỏng trong đa ngành như công nghiệp, hậu cần, phòng vệ, sức khỏe, năng lượng và môi trường)”, Journal Of Simulation
Among practical applications of agents and multi-agents systems, the use of the agent paradigm in modeling and simulation of complex systems is now well established in various research fields (such as social sciences, ecology, finance…) and very successful. Agent-based simulation is a powerful tool to study complex systems and more particularly their dynamic. It allows to model systems at the appropriate scale, to explore these models at will and thus test theories that would not be possible to investigate in actual world. Huge efforts have been done to provide to non-computer scientists simple and easy-to-learn tools (Netlogo is perhaps the best example) that allow domain experts to implement their own simple models and test them.
However simulation is now used to study phenomena with more and more details and thus higher and higher complexity. Simple tools, simple ways to develop simulation and to explore them are no more adapted. Every stakeholder involved in the modeling and simulation process needs much more advanced conceptual, methodological and technical tools to face issues induced by their new goal to do large-scale simulation.
The aim of this workshop is thus to be a place of gathering, discussion and cross-fertilization between both agent-based simulation and engineering for multi-agent system communities. It provides an opportunity to exchange ideas on current and future research advances in modeling, implementation, simulation and management and analysis of simulation results of complex systems, to present the latest applications and to generate interdisciplinary discussions.
Topics of interest
Both ongoing innovative researches and reports on practical results are welcomed. Workshop topics of interest include, but are not limited to, the following:
Simulation and model design
Agent-based paradigm for modeling and simulation
Multi-scale simulation
Time representation in simulation
Model reuse
Multi-model simulators
Learning techniques for simulation model design
Participatory modeling and simulation
Collaborative modeling and simulation
Simulation platforms and languages
Domain Specific Languages
Engineering of simulation platforms
Agent-oriented engineering of agent-based simulators
Simulation and model analysis
Data analysis in the context of simulation
Simulation dynamic analysis and visualization
Optimization techniques for parameter sensibility analysis
Verification and validation of models and simulators
Parallel and distributed simulations
Emergence study
Applications
Disaster management
Finance and Economics
Ecology and Environment
Soil sciences
Epidemiology
Robotics
Social sciences
Traffic and Transportation
…
——————-
References:
PAAMS : Practical Applications of Agents and Multi-Agent Systems (http://www.paams.net/)
Simulation is the process of creating an abstract representation (a model) to represent important aspects of the real world. Just as flight simulators have long been used to help expose pilots and designers to both routine and unexpected circumstances, simulation models can help you explore the behavior of your system under specified situations. Your simulation model can be used to explore changes and alternatives in a low-risk environment. Simulation has been successfully applied to many applications. Cost savings and/or cost avoidance in a typical simulation project are often 10 to 20 times the initial investment within four to six months of initial use.
Thử nghiệm thực tế trên máy tính, tránh rủi ro, lãng phí tiền bạc, công sức, dự đoán đc kết quả
What is the difference between As-is Situation and To-be Situation?
(In BPMN, the current process to be enhanced is called as-is process. After it gets re-designed, we call it to-be process)
Several aspects that Simulation tend to come up frequently [Simulation with Arena – 2e Edition – Kelton]
Understand the system
Be clear about your goals
Formulate the model representation
Translate into modeling software
Verify that your computer representation represents the conceptual model faithfully
Validate the model
Design the experiments
Run the experiments
Analyze your results
Get insight
Document what you’ve done
II. Simulation Purpose
How can you be sure you have optimized a process before deploying it?
Have you tested it with various parameters to see if there are potential bottlenecks?
Running simulations of a process give you an opportunity to spot potential blocking issues, or to optimize it – with alternate flows or better resource management, for example.
Could we use the tools like Simio, Arena to simulate the process of the earthquake, tsunami response plan?
III. Some Simulation Tools: A Comparison
YAWL: for modeling and execution of business processes. Current version do not support the simulation function, have to use CPN Tools (follow: Business Process Simulation for Operational Decision Support 2006)
Bizagi: when simulating with Bizagi, we cannot modify (add, remove the task of the actor, for example) the structure of the process, it is fixed in design time. We can only modify the parameters, the resources.
WITNESS: an established dynamic process simulation software tool used by thousands of organisations to validate a business processes (gần giống Arena) | L-SIM : for the simulation of BPMN workflows | Px-SIM is a simulation software tool for rapidly understanding the difficult to predict variations that occur within pharmaceutical, consumer health and medical products manufacturing (http://www.lanner.com/en/simulation-explained.cfm)
Simio: Simulation Modeling Framework based on Intelligent Objects – Thiên về 3D hơn Arena
REGAL Tools: Mô phỏng kế hoạch sơ tán (evacuation plan) trong các sân vận động. REGAL Evac is a discrete event simulation model, developed in a partnership with the Department of Homeland Security (DHS) that evaluates evacuation plans and pedestrian flow for any stadium, arena, school or critical infrastructure. REGAL Evac executes simulations based upon unique threat scenarios by utilizing validated algorithms for processing crowd behavior and producing results in the form of 3D animation as well as statistical reports (http://www.regaldecision.com/#)
VILLON: (http://www.simcon.sk/en/tools/villon) Villon is a software simulation tool for creation and application of universal and detailed simulation models of transportation logistic terminals and their technological processes. Villon supports microscopic modeling of various types of transportation logistic terminals containing railway and road infrastructures (e.g. marshaling yards, railway passenger stations, factories, container terminals, depots, airports, etc.)
Simulex: Simulate occupant behaviour in the event of a building evacuation, identify potential problems and find solutions; Analyse occupant movement around a building; discover potential bottlenecks, check movement between spaces, interrogate layout; Its results are based on real human behaviour, using data gathered from video analysis of individuals moving in crowds (http://www.iesve.com/software/ve-pro/analysis-tools/egress/simulex)
Repast Suite:http://repast.sourceforge.net/ widely used free and open-source, cross-platform, agent-based modeling and simulation toolkit
NetLogo:
Swarm: is the name of an open-source agent-based modeling simulation package, useful for simulating the interaction of agents (social or biological) and their emergent collective behavior.
SeSAm (Shell for Simulated Agent Systems) provides a generic environment for modeling and experimenting with agent-based simulation. We specially focused on providing a tool for the easy construction of complex models, which include dynamic interdependencies or emergent behaviour. http://www.simsesam.de/
Protos:???
CPN Tools: for Colored Petri Nets Simulation
ProM: not a simulation tool, thiếu phần deploy, quản lý các tài nguyên, tạo scénario
Bonita: to simulate a process
Design process
Define Simulation Parameters on individual elements
Define/Manage Simulation resources,
Manage load profiles (scenarios)
Run the simulation, Analyze and Decide
Bonita Studio with a Skeleton process :
Design process
Add variables
Add transition conditions with “parameters”
Design forms
Define actors
Configure email connectors
Execute process
YAWL và Bizagi và Bonita tương đối giống nhau: modeling theo Petri nets, thực hiện các mô phỏng (ressources, roles, time) trên giao diện web, tuy nhiên Bizagi và Bonita cung cấp chức năng phong phú hơn với nhiều rằng buộc, đánh giá hơn. Bizagi phong phú hơn cả, Bonita cung cấp đánh giá, phân tích với nhiều biểu đồ hơn, cho phép export reports ra file pdf.
Cả YAWL và Bonita đều cho phép thiết kế mô hình sau đó chạy với các roles khác nhau.
Bonita được sử dụng nhiều bởi các công ty Pháp: Carrefour, SNCF …, linh động hơn YAWL trong việc thiết kế các form, có thể tương tác với mobile, ko thể simulation theo thời gian thực như Bizagi (animation), thiếu tài liệu mô tả. Bonita không hỗ trợ what-if analysis (comparing scenarios)
Simio có thể mô phỏng theo hình ảnh 3D, powerful simulation tool.
3 tiêu chuẩn để so sánh, đánh giá BPS Tools (Business Process Simulation) theo: Business Process Simulation – A Tool Servey (của M.H. Jansen-Vullers and M. Netjes 2006)
3 evaluation criteria :
Modelling capabilities
Ease of model building
Formal semantics
Workflow patterns
Resource and data perspective
Level of detail, transparency and suitability for communication
Simulation capabilities
Performance dimensions
Distributions
Animation
Scenarios
Output analysis capabilities
Statistics
Format
What-if analysis
Conclusion-making support
Thiếu chức năng collaboration cho editor: khả năng cùng nhau thiết kế các model Petrinet
1. Big Data : Mining unstructured data (such as social media conversations)
2. Process mining : Mining structured data from a process perspective and can be used in conjunction with unstructured mining techniques such as text mining ====>>>> dữ liệu lấy từ các trang mạng như Twitter liệu có phải là dữ liệu dạng Structured data ????
The core idea of process mining is to analyze data from a process perspective. All you need are data that can be linked to a case ID, activities, and timestamps. It does not matter where these data come from (ERP, CRM, workflow logs, ticketing system, PDM, HIS records, legacy log files, and so on)
Tweets contain precise and relatively accurate information about when they were posted. They can contain precise and accurate where (location) information as well if the tweet comes from a GPS enabled device for which the user has opted in to geolocation. Attribute information in tweets is challenging to extract due to the combination of the 140 character limit on tweets (which prompts extensive use of abbreviations) and the dramatic variety of tweet content spanning a range: from individuals documenting mundane daily activities in their lives, through professionals alerting followers about events and information (e.g., the Director of FEMA tweeting about the challenges of social media security), government and non-government organizations making regular announcements (e.g., UNGlobalPulse announcing events and new stories or CrisisMappers.org announcing maps or training webinars), and advertisers using Twitter for marketing purposes.
SensePlace2 uses a crawler to systematically query the Twitter API for tweets that contain any topics deemed to be of interest. The current implementation of the system uses a set of keywords and phrases that our research team has proposed over time and that is added to as new events happen around the world. Queries for each term are run every day and each can retrieve tweets and auxiliary metadata (e.g., creation time, tweet id, user id etc.) in JSON format. After parsing, each tweet is stored in a PostGresSQL database. Once tweets are loaded into the database, separate distributed applications analyze tweets for named-entities such as locations, organizations, persons, hashtags, URLs etc. These named entities are then written to separate tables such as an auxiliary location table, organization table etc. Lastly, locations that are extracted are then georeferenced using GeoNames. Once entities are identified and organized, a Lucene text index is generated that supports relatively fast full text querying as well as more advanced retrieval of relevant tweets within a geographic region and date range.
Visual Interface of SensePlace2
To support geovisual analysis, we designed a coordinated, multiple-view interface for SensePlace2 which supports an understanding of spatial and temporal patterns of activities, events, and attitudes that can be identified through analysis of our growing geo-located Twitter database. A key goal for this interface is to support an analyst’s ability to explore, characterize, and compare the space-time geography associated with topics and authors in Tweets. This includes the ability to describe the geographic content associated with tweets as well as the locations where Tweets were reported by users that have enabled that feature. The default SensePlace2 interface includes a query window, map, time-plot / control, relevance-ranked list of tweets, and task list. The primary display views (map, time-plot/control, and tweet list) are dynamically coordinated. Each view is introduced in the screen capture below, which is the result of a short analysis session to explore flooding incidents. Then cross-view linking is discussed.
Query window
Users can enter single or multi-term queries and these can include place names. Each query retrieves a new set of information that is processed to populate display views. The session illustrated above began with query on “earthquake Haiti”.
Time-plot/control
The time-plot doubles as a compact representation of the frequency distribution of tweets that match the query across the full time span of data in the database and a control to filter tweets by time. Specifically, both ends of the time range selector can be dragged and once a time range is set, that range can be shifted along the timeline by clicking on the time snap bar and dragging. Above, the timeline is set to a range of interest (approximately one month after the earthquake during the recovery phase).
Tweet list
The 500 most relevant tweets are displayed in a scrolling list. The list can be sorted by relevance (the default), time, and place. Hierarchical sorting is also enabled (e.g., with time as the primary sort and relevance as the secondary to highlight recent and relevant tweets). Above, the tweet list was sorted by time to find those near the end of the time range of interest. Interesting tweets were explored, with the map panning and zooming to include all places that a highlighted tweet was associated with (based on the computational processing outlined above).
Map
The map provides both overview, in the form of a gridded density surface representing all tweets that match the query, and detail in the form of point-based depiction of the most relevant 500 tweets. The density surface is generated for the globe and currently depicts frequency counts for tweets aggregated to 2 degree grid cells (grid resolution is flexible, but that flexibility has not yet been made accessible to users). A quantile classification scheme is applied, to allow comparison from one query to the next, and a sequential color scheme is used with dark=highest. It is likely that some locations for the top 500 tweets can have multiple tweets, thus those location are depicted with range-graded sizes for 1, 2-5, and >5 tweets from/about a place.
In the above example, places were also explored by pointing to them on the map; this moved the tweets linked to the place to the top of the list for easy reading. Thre role of various organizations in the relief effort starts to become apparent as does the variety of places in the U.S. that are active in relief efforts. In the view below, one tweet is highlighted that focuses on multi-state efforts by one church to organize relief efforts.
Task list
The task list view (not yet fully implemented) will allow users to label results of a query and store that result in a history. These stored queries will retain user set parameters that include any place and time filtering as well as decisions to promote at tweet to high relevance or hide an irrelevant tweet. As noted above, the display views are dynamically linked. Clicking on a tweet location on the map moves the tweet to the top of the tweet list, highlights that tweet in the list, and highlights its time bin on the time-plot. If the location has multiple tweets, the sorting and highlighting is applied to the full set. When a tweet is selected in the tweet list, the map zooms and pans to bring it into focus.
Social media can be defined as “a form of new media that facilitates social interaction and communication through the use of online internet-based platforms” [1]
4 main social media functions :
Information dissemination
Disaster planning and training
Collaborative problem solving and decision making
Information gathering
Data analysis ????
Unlike traditional passive communication media : social media allows readers, viewers or listeners to contribute or respond
Past, Present and Future of Social Media Tools [1]
Past
Present
Future
Purpose
To inform
To share
To engage
Core Activity
Gathering infomation
Tracking issues
Guiding action
Stakeholders
State Actors
State and private Actors
Multipleactors
Information content
Discrete data
Networks
Relationships
Treatment of Information
Data confidentiality
Privileged information
Transparency
Software tools
In-house capabilities
Commercial analytical tools
Open-source platforms
Output
Specialist assessment[a]
[a] + Multi-stakeholder perspectives[b]
[a] + [b] + Crowdsourced opinions
[2] Categories :
Social networks : Facebook, LinkedIn, Twitter
Media sharing networks : Flickr, Snapfish, YouTube
Blogs : WordPress, Blogger
Wikis – Crowdsourcing
Mashups/mapping software (Ushahidi)
According to [1], social media tools can be categorised :
Nhân bản (replication): liên quan đến việc chia sẻ thông tin cũng như đảm bảo sự nhất quán (consistency) giữa những tài nguyên dự phòng/dư thừa (redundant) để tăng độ tin cậy, fault-tolerance, hay khả năng truy cập. Tài nguyên ở đây có thể là: phần mềm hoặc phần cứng, gọi chung là node.
Nhân bản dữ liệu (data replication): cùng một dữ liệu được lưu trữ trên nhiều thiết bị.
Faut-tolerance: thuộc tính cho phép hệ thống tiếp tục hoạt động đúng trong trường hợp có lỗi xảy ra với một vài thành phần của hệ thống.
Failover: chuyển sang dùng hệ thống dự phòng / hệ thống chờ khi hệ thống đang hoạt động có sự cố xảy ra hoặc bị kết thúc bất thường.
Nhân bản kiểu đồng bộ và bất đồng bộ (Synchronous vs Asynchronous Replication)
Sync Replication: đảm bảo rằng những thay đổi trên một node của cluster sẽ xảy ra trên những node khác, gần như tại cùng một thời điểm.
Async Replication: không đảm bảo về độ trễ khi cập nhật những thay đổi trên một node sẽ xuất hiện trên node khác. Điều này dẫn tới khả năng khi một node bị crash, một vài sự thay đổi cuối cùng có thể bị mất, không được đồng bộ sang những node khác.
Về mặt lý thuyết, Sync Replication có nhiều điểm lợi hơn Async Replication
Sync Replication luôn high-availability. Không có mất dữ liệu khi một node bị crash và những bản sao dữ liệu là nhất quán.
Transactions có thể được thực thi song song ở tất cả các nodes.
Sync Replication có thể đảm bảo tính nhân quả (causality) trong toàn cluster.
Tuy nhiên, trong thực tế, synchronous replication được cài đặt theo cách truyền thống dựa theo cấu trúc nổi tiếng “2-phase commit” hoặc khóa phân phối (distributed locking), mà đã được chứng minh là rất chậm. Hiệu suất thấp và độ phức tạp của cài đặt synchronous replication dẫn đến tình trạng nhân bản kiểu không đồng bộ (asynchronous replication) vẫn thống trị khi tính đến vấn đề hiệu suất.
Eager Replication vs Lazy Replication
Thuật ngữ Eager Replication hay Lazy Replication đôi khi có thể được đồng nhất với Synchronous/Asynchronous Replication. Có một sự khác nhau nhỏ: thay vì tập trung vào vấn đề xử lý transactions một cách đồng bộ, hai thuật ngữ này ám chỉ rằng các nodes, các bản sao (replicas) cuối cùng đều phải đảm bảo sự nhất quán. Điều này có nghĩa là phải đảm bảo transactions theo cùng một thứ tự, không nhất thiết phải đồng bộ gần như tức thì tại thời điểm có sự thay đổi.
Theo đó, eager replication có thể coi như ở giữa Sync và Async Replication: cho phép một node bị lag so với node khác trong khi vẫn tránh được sự sai khác giữa các nodes.
Eager replication phải nhân bản dữ liệu transaction trước khi xác nhận commit, trong khi Lazy replication nhân bản dữ liệu ở đâu đó sau khi commit, vì vậy nguy cơ xung đột tăng cao.
Lazy replication luôn luôn là Async và không tránh đc sự sai khác.
Replication Topologies
Master-Slave
Master-Master (2 hệ thống / nodes)
Multi-Master (>2 hệ thống / nodes)
Thuật ngữ liên quan đến Galera Cluster
wsrep: Write Set REPlication
SST: State Snapshot Transfer
IST: Incremental State Transfer
Donor node: một db server (một node) đã tồn tại trong hệ thống và có thể sử dụng như đầu mối để các node mới kết nối vào cluster
Joining node: một db server (một node) đang kết nối vào cluster
II. Cài đặt nhân bản dữ liệu trong một số hệ quản trị dữ liệu
1. MySQL/Maria (Galera)
Một đặc điểm thú vị của MariaDB là built-in hỗ trợ Galera Cluster.
Xem phần III bên dưới
2. Oracle
3. Postgres-R
4. Microsoft SQL
5. MongoDB / CouchDB / RethinkDB
Nhân bản dữ liệu trong MongoDB sử dụng cơ chế Asynchoronous Replication liên quan đến 3 thành phần :
Node chính (primary node): chỉ có duy nhất một node chính
Node phụ (secondary node)
Trọng tài (arbiter)
Một tập bản sao (replica set) là một tập instance của mongod duy trì một tập dữ liệu giống nhau. Chỉ một thành viên được coi là node chính (primary node), trong khi các node khác được coi là node phụ (secondary node).
Nếu node chính có vấn đề gì (unavailable), một node phụ đủ điều kiện sẽ tự đề cử bản thân nó thành node chính mới.
Một trọng tài (arbiter) sẽ luôn luôn là trọng tài, trong khi một node chính có thể bước xuống để trở thành node phụ và ngược lại một node phụ có thể tiến lên trở thành node chính.
Cơ chế đồng bộ trong MongdoDB là tự động fail-over: khi node chính không giao tiếp/kết nối với những thành viên khác trong khoảng thời gian > 10s, một node phụ đủ điều kiện sẽ tự đề cử nó để trở thành node chính. Node phụ đầu tiên đề cử và nhận được phần lớn đồng ý của các thành viên khác sẽ trở thành node chính
III. Multi-Master Replication sử dụng Galera Cluster
1. Giới thiệu
Galera cluster được sử dụng bởi nhiều công ty lớn như Wikipedia, Facebook, Google, cũng như bởi hàng nghìn users trong nhiều lĩnh vực: e-commerce, telecom, gaming, insurance, healthcare, media, marketing, advertising, travel, university, software-as-service, Paas, Iaas, …
Nó được cài sẵn trong nhiều phiên bản Linux và OpenStack gần đây. Thống kê cho thấy 30% người dùng OpenStack đang sử dụng Galera Cluster cho HA. Phiên bản hiện tại của Galera wsrep provider là 25.3.15
Galera cluster cho phép nhân bản kiểu multi-master và tập trung mạnh vào sự nhất quán của dữ liệu.
Galera cluster được hỗ trợ bởi MySQL bản >= 5.5 và MariaDB bản >= 5.5.
Trong bản MariaDB 5.5 và 10.0, Galera Cluster là một gói riêng được cài đặt thêm chứ không phải là gói chuẩn của MariaDB Server.
Trong MariaDB 10.1, hai gói MariaDB Server và MariaDB Galera Server được kết hợp với nhau kèm theo những gói phụ thuộc được cài đặt tự động khi cài MariaDB, tuy nhiên Galera chỉ hoạt động khi đã được cấu hình bật lên giống như một plugin.
MariaDB Galera Cluster là một bản vá của MySQL-wsrep thực hiện bởi Codership và hiện tại chỉ hỗ trợ Linux
Galera hỗ trợ Cloud (như AWS zones) và WAN.
Mỗi node trong Galera cluster đều là master:
Không còn quan hệ kiểu chính-phụ (primary-secondary)
Không cần phải promote một secondary thành master khi có master failure
Mọi bản sao đều chứa TOÀN BỘ tập dữ liệu và nhất quán:
Client có thể query dữ liệu trên tất cả các nodes
Có thể response bất kỳ read request mà không có độ trễ
Loại bỏ latency cho nhiều hoạt động
Trong trường hợp có vấn đề xảy ra với một node, hệ thống sẽ tự động failover.
Quá trình đồng bộ dữ liệu xảy ra ở thời điểm commit:
Độ trễ của kế nối mang có thể làm chậm quá trình commit, nhưng tránh được disk I/O
Conflicts được phát hiện tại thời điểm commit
Galera cluster sử dụng row-based binary log events (không phải binary log files).
Galera có thể được cài đặt để đồng bộ chỉ một hay vài tables hoặc databases sử dụng những bộ lọc (replication filters).
Hai bộ lọc được khuyến khích sử dụng trong Galera là replicate-do-db, replicate-ignore-db, cho cả hai loại engine InnoDB và MyISAM.
Ngược lại, những bộ lọc sau không được khuyến khích sử dụng: binlog-do-db , binlog-ignore-db, replicate-wild-do-db, replicate-wild-ignore-db.
2. Chức năng và phương thức đồng bộ
Chức năng của Galera Replication được cài đặt như một thư viện chia sẻ và có thể được link với bất kỳ hệ thống xử lý transaction nào nếu hệ thống này cài đặt wsrep API hooks.
Thư viện Galera Replication là một stack giao thức cung cấp chức năng cho việc chuẩn bị, nhân bản và áp dụng các tập ghi transaction. Nó bao gồm các modules:
wsrep API: xác định giao diện, trách nhiệm cho DBMS và nhà cung cấp replication
wsrep hooks: là việc tích hợp wsrep bên trong engine DBMS
Galera provider: cài đặt wsrep API cho thư viện Galera
Tầng certification: chịu trách nhiệm chuẩn bị tập ghi (write sets) và thực hiện việc chứng nhận
Replication: quản lý giao thức nhân bản và cung cấp toàn bộ khả năng ordering
GCS framework: cung cấp kiến trúc plugin cho các hệ thống giao tiếp nhóm. Nhiều cài đặt GCS có thể được thích nghi (adapt), được thử nghiệm với những cài đặt in-house như: vsbes và gemini.
Galera sử dụng 3 phương thức để đồng bộ dữ liệu: mysqldump, rsync, xtrabackup-v2
rsync: là phương thức mặc định và yêu cầu ít thời gian setup nhất. Điểm yếu của nó là node đầu mối (donor node) sẽ bị block với tất cả các hoạt động trong lúc đang thực hiện SST.
mysqldump: chuyển dữ liệu dưới dạng các lệnh SQL INSERT. Mỗi lệnh này sẽ tốn thời gian để thực thi trên các node đang join vào nếu kích thước của tập dữ liệu là đáng kể. Có một vài kỹ thuật để tăng hiệu suất insert, tuy nhiên nó không thể loại bỏ cản trở lớn nhất là dữ liệu được chuyển theo kiểu row-by-row thay vì file-by-file.
xtrabackup-v2: sử dụng công cụ Percona XtraBackup để thu về một snapshot không bị block (non-blocking snapshot) của node đầu mối (donor node) và sau đó sử dụng snapshot đó để khởi động node mới join vào. Điều này yêu cầu cài đặt phức tạp hơn một chút, nhưng node đầu mối hầu như luôn sẵn sàng cho việc query trong suốt quá trình xử lý. Đây là phương thức nên sử dụng để cài đặt trong nếu chúng ta muốn loại bỏ thời gian chết của node đầu mối.
Galera sử dụng các cổng sau:
Cổng 3306 để kết nối với MySQL client và State Snapshot Transfer (SST) nếu sử dụng phương thức mysqldump để đồng bộ
Cổng 4567 dùng cho replication traffic, multicast. Sử dụng cả 2 giao thức UDP và TCP
Cổng 4568 dùng cho Incremental State Transfer
Cổng 4444 dùng cho State Snapshot Transfer nếu sử dụng phương thức rsync để đồng bộ
Trải nghiệm ngày IT Free Day với một câu hỏi thường trực trong đầu -_-. Cũng không thể gọi đúng nghĩa là Free Day được.
Anyway, trở lại câu hỏi về hàm curl_multi_exec.
do { $multi_exec_handle = curl_multi_exec ($this -> curl_parent, $active);} while ($active > 0);
Ba dòng code này có thể được tìm thấy trong cài đặt của một thư viện của CodeIgniter cho chức năng xử lý multi-curl [3].
Hàm curl_multi_exec nhằm mục đích cố gắng download nhiều trang (webpages dưới dạng HTML hoặc feeds dưới dạng XML) cùng một lúc, song song và độc lập với nhau.
Hàm curl_multi_exec nhận vào hai tham số:
Tham số thứ nhất (ở đâu là $this -> curl_parent): một multi-handler tạo bởi hàm curl_multi_init() ở trước đó, giá trị kiểu resource.
Tham số thứ hai $active: số lượng handler mà hàm đang làm việc, giá trị kiểu int. Ví dụ, nếu bạn đang xử lý 5 URLs với muti-hander này, hàm curl_multi_exec sẽ trả về giá trị $active = 5 nếu nó đang làm việc với cả 5 URLs, và sau đó mỗi khi xử lý xong một URL, giá trị của $active sẽ được giảm xuống cho đến khi về 0.
Hàm curl_multi_exec trả về một giá trị kiểu int, và có thể nhận các giá trị sau:
CURLM_CALL_MULTI_PERFORM (-1): Nghĩa là bạn nên gọi hàm curl_multi_exec() một lần nữa bởi vẫn còn dữ liệu để xử lý.
CURLM_OK (0): Nghĩa là mọi việc đều tốt!!! Điều nó ám chỉ là có thể vẫn còn giá trị nhưng nó chưa đến.
Một trong các error codes sau: CURLM_BAD_HANDLE, CURLM_OUT_OF_MEMORY, CURLM_INTERNAL_ERROR, or CURLM_BAD_SOCKET. Error code ám chỉ rằng chúng ta cần dừng xử lý.
Với đoạn code 3 dòng của chúng ta, trong điều kiện lý tưởng, vòng lặp sẽ thoát khi giá trị $active bằng 0 (hoặc bằng CURLM_OK). Nhưng chuyện gì sẽ xảy ra nếu trong quá trình xử lý có điều bất thường xảy ra (lỗi mạng, …)? Giá trị của $active sẽ không bao giờ là CURLM_OK và chúng ta sẽ rơi vào vòng lặp vô hạn.
Nhiều cài đặt của hàm này là sẽ đợi cho tất cả các request được hoàn thiện trước khi xử lý chúng. Như vậy khi có quá nhiều request cần xử lý cùng lúc, chúng ta phải đợi cho đến lúc request CHẬM NHẤT được hoàn thiện, dẫn đến việc tốn thời gian đợi không đáng có.
Thêm nữa, khi chạy vòng lặp này, nó thường chiếm dụng CPU (100%) cho đến khi vòng lặp hoàn thành.
Trang manual của hàm này cung câp một đoạn code mẫu như sau (sử dụng hai lần vòng lặp do while giống hệt nhau)
<?php $active = NULL; do { $ret = curl_multi_exec($multi, $active); } while ($ret == CURLM_CALL_MULTI_PERFORM);while ($active && $ret == CURLM_OK) { if (curl_multi_select($multi) != -1) { do { $mrc = curl_multi_exec($multi, $active); } while ($mrc == CURLM_CALL_MULTI_PERFORM); } }?>
Vòng lặp do while đầu tiên chịu trách nhiệm làm sạch bộ đệm. Vòng lặp do while thứ hai có trách nhiệm đợi thêm dữ liệu và sau đó lấy về dữ liệu này. Điều này dẫn đến cái gọi là blocking I/O, chúng ta block sự thực thi phần còn lại của chương trình cho đến khi Network I/O được hoàn thiện.
Ý nghĩa của vòng lặp while như sau:
(while): Chừng nào vẫn còn kết nối và mọi thứ trông có vẻ ổn …
(if) Nếu network socket có vài dữ liệu…
(do/while) Xử lý dữ liệu chừng nào hệ thống nói rằng nên dừng lại
Vấn đề bảo mật trong PHP
Tìm hiểu rộng ra về hàm curl_multi_exec, có một vấn đề liên quan đến bảo mật. Khi cấu hình PHP, chúng ta cần lưu ý phải tắt (disable) một số hàm nguy hiểm có thể bị hacker lợi dụng để khai thác website, trong đó có hàm curl_multi_exec.
Danh sách các hàm nguy hiểm cần tắt:
exec
passthru
shell_exec
system
symlink
proc_open
popen
curl_exec
curl_multi_exec
parse_ini_file
show_source
Tắt các hàm này bằng cách thêm dòng sau vào file php.ini
Mô hình đồng bộ kiểu Master-Master cho phép mọi thay đổi trên db này được cập nhật trên db kia. Điều này sẽ khắc phục yếu điểm của mô hình Master-Slave, khi thay đổi trên Slave (trong trường hợp db Master không hoạt động phải chuyển sang db Slave) sẽ không được cập nhật trên db Master.
Từ 2 âm tiết, trọng âm thường rơi vào từ đầu (‘happy, ‘dwindle). Tuy nhiên, nếu âm tiết đầu là một tiền tố thì trọng âm rơi vào âm tiết thứ hai (dis’like, pro’long).
Từ 3 âm tiết trở lên, trọng âm rơi vào âm tiết thứ ba tính từ phải sang (phi’losophy, bio’logical). Tuy nhiên, nếu tận cùng bằng -ion hoặc -ic(s) thì trọng âm rơi vào âm tiết đứng ngay sát trước nó (trans’lation, auto’matic)
When we do a writing, we usually use some general lazy expression (for ex. a goodstudent, a slowcomputer …). It should be avoid and could be replaced by an interesting corresponding one. These are following some substitutions:
1. Good -> Rewarding or Satisfying
2. Slow -> Retard
3. Many -> Several (Not sure)
Informal writing: a simple verb with a preposition (for ex. to look into, to look after) is the least formal choice and is commonly used in informal spoken language notes, emails and postcards.
Formal writing: words borrowed into English from other languages, especially Latin and Greek, are quite formal, or high register. These words are used in technical, scientific, medical, psychological and philosophical writings.
Many words ending in -ion are borrowed from Latin (such as: discussion, examination, explanation, information, instruction, investigation, presentation)