Python Success Stories | Python.org
Notice: This page displays a fallback because interactive scripts did not run. Possible causes include disabled JavaScript or failure to load scripts or stylesheets. Introduction Nexedi is a leader in high-end enterprise services, providing solutions for Enterprise Resource Planning (ERP), Customer Relationship Management (CRM), and eCommerce. Nexedi has built its business on Open Source, and has designed and released an ERP/CRM framework called ERP5 under the GPL Free Software license.
ERP5 is in production in the apparel industry and government agencies with multi-gigabyte databases that track millions of warehouse stock movements. ERP5 is written entirely in Python and leverages the Zope Enterprise Objects framework to provide high performance and availability on clusters of inexpensive PCs. Background The ERP5 project started in 2002 when Coramy, an apparel industry leader in Europe, decided to migrate its in-house ERP solution to a new open source model.
The choice of open source for Coramy ERP was a strategic move to reduce software maintenance costs and to allow Coramy to retain complete control over its custom developments, something that would have been impossible with standard proprietary ERP solutions. Nexedi was created as an independent company in charge of developing, implementing, and disseminating the ERP5 technology. Nexedi was given a budget of 80,000 EUR to develop a generic ERP framework published under GPL license and customize it for Coramy's specific needs.
Python: Clean Objects from Scripting to Metaprogramming Working with this small budget, ERP5's developers needed to look to innovative approaches and code reuse to cut development costs. At the most abstract level, ERP5 is based on five generic classes used by all modules: Resource, Node, Movement, Item, and Path. This model, known as the ERP5 Universal Business Model, makes it possible to reuse code by abstracting away from the specific domain and encapsulating the generic relationships and actions common to many business processes.
As a result, modules as different as Payroll and Invoice can share almost of all their code. In this example of the ERP5 Universal Business Model, Movement allows the transfer of a quantity of resource from one node to another, Path allows planning of resource sourcing, and Item provides Resource traceability. Zoom in The ERP5 abstract model architecture requires a well-designed object language that supports high level abstraction.
Selecting an appropriate implementation language became strategic to the project's success. The project also required complete multi-platform OS abstraction, a rich library for Web applications, a rapid GUI development toolkit, support for internationalization, wide community support, and proven maturity. The short list of candidates quickly became: Java or Python. Or, more precisely, Java+Jakarta or Python+Zope. Two key factors led to the choice of Python.
First, was the need to make extensive use of metaprogramming. Second, for simplicity's sake, ERP5 needed to be implemented in a single language from core architecture to scripting. Metaprogramming is a technique that allows the programmer to redefine the semantics of the implementation language at runtime. It can be used to endow extremely abstract implementations with domain-specific behaviors that are modeled in properties or tables, rather than hand-coded.
In ERP5, this powerful technique allows 95% of the class methods to be generated automatically from lists of properties that define each unique custom ERP implementation. This has reduced maintenance costs by an order of magnitude: The typical ERP5 system contains 100,000 lines of code, rather than the 1,000,000 lines of code required in similar projects based on traditional programming techniques. Python supports efficient metaprogramming through powerful introspection features that allow programs to inspect and modify code at runtime.
Java's introspection are by contrast quite poor and inflexible. Metaprogramming in Java requires writing preprocessors, which would have added prohibitively to the cost and complexity of implementing the ERP5 system. Another advantage that Python had over Java was that it could be used at all levels of the system, from core implementation to scripting. Most ERP systems, while written in one language, use another scripting language to allow flexible configuration at run time by ERP administrators.
Python is equally well suited both for scripting and core development, reducing complexity and increasing the flexibility of the system. Using Python allowed code initially written as scripts to be incorporated afterward into core components, and vice versa, wherever this made sense. With Java, it would have been necessary to provide a separate scripting environment based on a different language, such as Jython or ECMAScript, and reusing scripting code in core components would have been much more difficult.
Enterprise Objects with Zope In addition to leveraging these high-level language capabilities, the ERP5 project also needed to base on an existing turn-key application server with support for transparent object persistence, transactions, and workflow. This would allow the project to focus its limited resources on application design, rather than on application server design. Zope , a Python-based application server, fulfilled this need.
In 2002, Zope was already a mature application server environment while Jakarta was still rather immature. Zope provided clustering, object storage, object publication, transactions, security, workflows, and a web-based management interface, all in a turn-key package. Zope and Python, unlike Java, also provided the licensing needed for complete freedom in distributing code on LiveCD, in RPM packages, and so forth. In some applications needed in ERP, such as in Point-of-Sales (POS), an autonomous client/server GUI application provides better results than a pure Web-based solution.
For these cases, the ERP5 project team selected PyQt , which supports the rapid development of multi-platform client/server applications with native look and feel. Autonomous applications written in PyQt could interoperate with Zope through the XML-RPC and SOAP implementations available for Python. ZSQLCatalog: Querying and ROLAP of Zope Object Database In January 2003, the initial ERP5 modules went into production at the Coramy factory and design center.
The ERP5 architecture relies completely on Zope for data storage, transactions and workflow management. The user interface is based on an extended version of Martijn Faassen's Formulator component. ERP5 itself is implemented as a set of Zope components. Overall, thanks to massive code reuse and fast coding, ERP5's initial development was completed in less than one year. The choice of Python and Zope proved to be a good one.
Part of this success was due to Nexedi's ZSQLCatalog component which leverages Zope's object database to implement an innovative approach for querying objects and data mining. ZSQLCatalog solves several major problems often encountered in Enterprise applications: locks, slow reports, and inconsistent transactions. Most Enterprise applications use tables in a relational database to store data. In ERP5 data is stored instead in Zope's object database.
Zope eliminates the need for storage adapters or attribute mappings by providing transparent persistence of Python objects. Zope also speeds up object access: Reading the Zope object database is 10 to 100 times faster than retrieving a row from the fastest relational databases available on the market today. Finally, unlike relational databases, transactions in a Zope object database can last minutes without causing deadlocks.
One limitation encountered in Zope was that it does not provide an efficient tool for querying the millions of objects that are needed in an ERP solution. To solve this, Nexedi's ZSQLCatalog maps between attributes or methods of objects
The rest of this page is on the live site.