Skip to main content

Efficient Model Repository for Web Applications

  • Conference paper
  • First Online:

Part of the book series: Communications in Computer and Information Science ((CCIS,volume 838))

Abstract

Many model-based applications have been developed with standalone usage in mind. When migrating such applications to the web, we have to think about multiple users competing for limited server resources. In addition, we encounter the need to synchronize models via the network for client-side access. Thus, there is the risk that the model storage could become a bottleneck.

We propose a model repository that deals with these issues by using an efficient encoding of the model that resembles its Kolmogorov complexity. The encoding is suitable for direct sending over the network (with almost no overhead); it can also be used “as-is” in memory-mapped files, thus, utilizing the OS paging mechanism. By adding just 3 automatic indices, all traverse and query operations can be implemented efficiently. Our tests show that the proposed model repository outperforms other repositories concerning both CPU and memory and is able to hold 10,000 and more instances at the same time on a single server.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    MOF (Meta-Object Facility) is a standard developed by OMG (Object Management Group) for describing formal models [15].

  2. 2.

    For example, MongoDB write operations can be up to 10 times slower than read operations.

  3. 3.

    We proposed RAAPI in 2013 by combining the best from existing repository APIs. RAAPI can be mapped to virtually any model repository. The actual version can be found at http://webappos.org/dev/raapi/.

  4. 4.

    The first number is the maximum length of actions that does not cause integer overflow (\(2^{31}-1\)), which allows us to use 4-byte integers to encode positions in the actions array. The actions array then can occupy up to 10 GB (not counting strings), which we consider quite liberal for a single model accessed by a single user via a web application.

  5. 5.

    We could also embed the a2s map into the actions array by appending a string index to mini-arrays of string-actions. However, that would mix the actions array with the auxiliary a2s array. In addition, the length of the actions array and, hence, the amount of data synchronized with the client would increase.

  6. 6.

    The chars array is much longer than strings2. Thus, to save time during re-arrange, the chars array can be left “as is”, without removing characters of deleted strings (still, it can be compacted occasionally, e.g., during save).

  7. 7.

    The first hash is modulo p, the second is modulo \((p-2)+1\), which is always co-prime with p. For strings we use Java built-in hashCode function. However, since it returns 0 on empty strings, and since the second hash calculates to 1, all empty strings would be stored in the beginning of the hash table, thus, drastically increasing the number of collisions (up to 2.85x in our experiments). We avoid such inefficient hash values by appending a constant dummy text to every string before calculating its hash.

  8. 8.

    Grover’s algorithm on a real quantum computer could take sub-linear time, but the proposed repository is intended for classical computers.

  9. 9.

    For more connections or during peek loads, one can borrow virtual cloud servers, e.g., from Amazon Elastic Cloud.

  10. 10.

    The repository can be downloaded at http://webappos.org/dev/ar.

References

  1. Eclipse Modeling Framework (EMF, Eclipse Modeling subproject). http://www.eclipse.org/emf

  2. OWL 2 Web Ontology Language document overview (second edition). http://www.w3.org/TR/owl2-overview/

  3. OWL Web Ontology Language reference. http://www.w3.org/TR/owl-ref/

  4. Hellerstein, J.M., et al.: Ground: a data context service. In: Proceedings of CIDR (2017)

    Google Scholar 

  5. Ambler, S.: Mapping objects to relational databases: O/R mapping in detail. http://www.agiledata.org/essays/mappingObjects.html

  6. Anuja, K.: Object Relational Mapping. Ph.D. thesis, Cochin University of Science and Technology (2007)

    Google Scholar 

  7. Barzdins, J., Kalnins, A., Rencis, E., Rikacovs, S.: Model transformation languages and their implementation by bootstrapping method. In: Avron, A., Dershowitz, N., Rabinovich, A. (eds.) Pillars of Computer Science. LNCS, vol. 4800, pp. 130–145. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-78127-1_8

    Chapter  Google Scholar 

  8. Jouault, F., Kurtev, I.: Transforming models with ATL. In: Bruel, J.-M. (ed.) MODELS 2005. LNCS, vol. 3844, pp. 128–138. Springer, Heidelberg (2006). https://doi.org/10.1007/11663430_14

    Chapter  Google Scholar 

  9. Kalnins, A., Barzdins, J., Celms, E.: Model transformation language MOLA. In: Aßmann, U., Aksit, M., Rensink, A. (eds.) MDAFA 2003-2004. LNCS, vol. 3599, pp. 62–76. Springer, Heidelberg (2005). https://doi.org/10.1007/11538097_5

    Chapter  Google Scholar 

  10. Kegel, D.: The C10K problem. http://www.kegel.com/c10k.html

  11. Kemp, S.: Digital in 2018: World’s internet users pass the 4 billion mark. wearesocial.com blog. https://wearesocial.com/blog/2018/01/global-digital-report-2018

  12. Knuth, D.E.: The Art of Computer Programming, Sorting and Searching, 2nd edn., vol. 3. Addison Wesley Longman Publishing Co., Inc., Redwood City (1998)

    Google Scholar 

  13. Kolovos, D., Rose, L., Paige, R.: The Epsilon Book. http://www.eclipse.org/epsilon/doc/book/

  14. Kozlovics, S.: The orchestra of multiple model repositories. In: van Emde Boas, P., Groen, F.C.A., Italiano, G.F., Nawrocki, J., Sack, H. (eds.) SOFSEM 2013. LNCS, vol. 7741, pp. 503–514. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-35843-2_43

    Chapter  Google Scholar 

  15. Object Management Group: OMG Meta Object Facility (MOF) Core Specification Version 2.4.1 (2011)

    Google Scholar 

  16. Object Management Group: MOF Support For Semantic Structures (SMOF) (2012). http://www.omg.org/spec/SMOF/

  17. Object Management Group: Meta Object Facility (MOF) 2.0 Query/View/Transformation Specification, Version 1.3. formal/16-06-03 (2016)

    Google Scholar 

  18. Opmanis, M., Čerāns, K.: Multilevel data repository for ontological and meta-modeling. In: Databases and Information Systems VI - Selected Papers from the Ninth International Baltic Conference, DB&IS 2010 (2011)

    Google Scholar 

  19. Pacaci, A., Zhou, A., Lin, J., Özsu, M.T.: Do we need specialized graph databases?: benchmarking real-time social networking applications. In: Proceedings of the Fifth International Workshop on Graph Data-management Experiences & Systems, GRADES 2017, pp. 12:1–12:7. ACM, New York (2017)

    Google Scholar 

  20. Steinberg, D., Budinsky, F., Paternostro, M., Merks, E.: EMF: Eclipse Modeling Framework, 2nd edn. Addison-Wesley, Upper Saddle River (2008)

    Google Scholar 

  21. Varró, D., Balogh, A.: The model transformation language of the VIATRA2 framework. Sci. Comput. Program. 68(3), 187–207 (2007)

    Article  MathSciNet  Google Scholar 

Download references

Acknowledgements

The work has been supported by European Regional Development Fund within the project #1.1.1.2/16/I/001, application #1.1.1.2/VIAA/1/16/214 “Model-Based Web Application Infrastructure with Cloud Technology Support”.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Sergejs Kozlovičs .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Kozlovičs, S. (2018). Efficient Model Repository for Web Applications. In: Lupeikiene, A., Vasilecas, O., Dzemyda, G. (eds) Databases and Information Systems. DB&IS 2018. Communications in Computer and Information Science, vol 838. Springer, Cham. https://doi.org/10.1007/978-3-319-97571-9_18

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-97571-9_18

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-97570-2

  • Online ISBN: 978-3-319-97571-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics