{"id":13753284,"url":"https://github.com/muoncore/photon","last_synced_at":"2026-01-24T14:31:58.835Z","repository":{"id":34945965,"uuid":"39020669","full_name":"muoncore/photon","owner":"muoncore","description":"Photon is an event store with cold+hot event streaming","archived":false,"fork":false,"pushed_at":"2017-07-24T23:02:08.000Z","size":8963,"stargazers_count":23,"open_issues_count":7,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-16T05:32:40.722Z","etag":null,"topics":["clojure","eventsourcing","java","microservice","reactive","reactive-streams"],"latest_commit_sha":null,"homepage":"http://muoncore.io","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/muoncore.png","metadata":{"files":{"readme":"README.adoc","changelog":"CHANGELOG.md","contributing":".github/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":"code_of_conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-13T15:30:23.000Z","updated_at":"2024-01-13T23:54:02.000Z","dependencies_parsed_at":"2022-09-04T17:42:50.866Z","dependency_job_id":null,"html_url":"https://github.com/muoncore/photon","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muoncore%2Fphoton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muoncore%2Fphoton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muoncore%2Fphoton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muoncore%2Fphoton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muoncore","download_url":"https://codeload.github.com/muoncore/photon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253321858,"owners_count":21890480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clojure","eventsourcing","java","microservice","reactive","reactive-streams"],"created_at":"2024-08-03T09:01:19.598Z","updated_at":"2026-01-24T14:31:58.813Z","avatar_url":"https://github.com/muoncore.png","language":"Clojure","funding_links":[],"categories":["reactive"],"sub_categories":[],"readme":"# Photon Event Store\n\nPhoton is an event store with cold+hot event streaming.\n\nIn microservices, each service is supposed to take responsibility for a single functional capability: a computational process. In this context, these processes will follow the same pattern: gathering sequences of inputs and generating sequences of outputs though transformation functions, also called projections. Usually such functions are deeply coupled with both 1) the implementation of the service and 2) the data consumed to generate a current state and outputs. As a consequence, designs and implementations of the concepts of storage, sequence handling and data transformation have to be repeated over and over again across different services.\n\nPhoton is an attempt at avoiding such redundancy by abstracting and encapsulating both the storage and the transformation of data as service methods. It is designed as a black box with an internal database with a projection engine, both generic enough to store free-form data and allow for a wide range of expressivity for data transformation, in real time. In this way, business rules can be implemented and deployed in Photon instances via projections, effectively decoupling business logic and data storage and processing.\n\n## Quickstart\n\nDownload the link:https://github.com/muoncore/muon-starter[Muon Starter] repository and run through the instructions and\npre-requisites from there. The latest released version of photon will be started using Docker Compose,\nalong with a contained RabbitMQ instance for communication and other support microservices.\n\nInstall the link:https://github.com/muoncore/muon-cli[Muon CLI] and set up with the URL `amqp://muon:microservices@localhost`\n\nYou can then see photon running\n\n```bash\n\u003e muon d\n\n┌──────────────────────────────┬──────────────────────────────┬──────────────────────────────┐\n│ SERVICE NAME                 │ TAGS                         │ CONTENT/TYPE                 │\n├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤\n│ molecule                     │                              │ application/json             │\n├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤\n│ photon                       │ photon,eventstore            │ application/json             │\n└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘\n```\n\nYou can emit an event using the CLI\n\n```bash\n\u003e muon event '{ \"event-type\": \"SomethingHappened\", \"schema\": \"1\",\"stream-name\": \"something\",\"payload\": {\"message\": \"Hi there!\"}}'\n```\n\nThis will persist the event in the given stream. It can be replayed at any point later on\n\nYou can replay the persisted events using the CLI\n\n```bash\n\n\u003e muon replay something\n\n```\n\nAll the events stored will then be replayed.\n\n\nCheck the latest http://muoncore.io/submodules/photon/doc/index.html[photon documentation] for more information.\n\nCheck the http://muoncore.io/guide/index.html to see patterns for developing with events using Photon\n\n## Developing Photon\n\n### Prerequisites\n\nYou will need [Leiningen][] 2.0.0 or above installed.\n\nhttps://github.com/technomancy/leiningen[leiningen]\n\n### Running\n\nYou can run photon directly from the source:\n\n```\nlein do cljsbuild once, run\n```\n\nOr you can build an uberjar:\n\n```\nlein do cljsbuild once, uberjar\njava -jar photon-*-standalone.jar\n```\n\n### Admin Console\n\nOnce running, point your browser to: `http[s]://HOST:PORT/index.html`. HOST and PORT can be configured as seen below.\n\n.Migration of UI\n****\nThis console will be migrated to the Molecule project once the Molecule plugin system is stable.\n****\n\n### Startup options\n\n```\nUsage: java -jar photon-x.x.x-standalone.jar [-h] [-option value] ... [-option value]\nOptions:\n-microservice.name    : Service ID, especially important for Muon (default = photon)\n-rest.host            : The IP or hostname of the web server for frontend and API. Change it for external access (default = localhost)\n-rest.port            : The port for the UI frontend and the REST API\n-rest.keystore        : If set, the web server will be started in SSL mode using the certificates identified by this path\n-rest.keypass         : The password required to open the keystore set in rest.keystore. Not required in not-SSL mode\n-admin.user           : The default username for logging in and requesting API tokens (default = admin)\n-admin.pass           : The default password for logging in and requesting API tokens (default = p4010n)\n-admin.secret         : A secret string that will be used to encode authentication tokens (default is random on launch)\n-projections.port     : Port to stream projection updates to (default = 8375)\n-events.port          : Port to stream incoming events to (default = 8376)\n-muon.url             : AMQP endpoint for Muon-based transport and discovery (default = amqp://localhost)\n-parallel.projections : Number of cores assigned for parallel stream processing (default = number of cores on your machine)\n-projections.path     : Local folder with projections, in EDN format, to pre-load on start (default = /tmp/photon)\n-db.backend           : DB backend plugin to use (default=h2). Depending on the build of photon, this can be one of:\n                        h2, cassandra, redis, file, mongo, riak, dummy.\n-h2.path              : If using H2, the file prefix for the database file, including path (default = /tmp/photon.h2)\n-cassandra.ip         : If using Cassandra, the host of the cluster\n-file.path            : If using files as backend, the absolute path to the file\n-mongodb.host         : If using MongoDB, the host of the cluster\n-riak.default_bucket  : If using Riak, the name of the bucket\n-riak.node.X          : If using Riak, the nodes that form the cluster (riak.node.1, riak.node.2, etc.)\n```\n\n### Setting up a file for static configuration\n\nPhoton can be configured either directly from the command line or from a file, and parameters can be combined from different sources. The order of priority in which the configuration is build is the following:\n\n1. Command-line arguments\n2. photon.properties in the working directory\n3. resources/photon.properties\n4. resources/config.properties\n\nExample of property file:\n\n```\n# Microservice identifier (default = photon):\nmicroservice.name=photon\n# AMQP endpoint (default = amqp://localhost):\nmuon.url=amqp://username:password@localhost\n# Number of cores assigned for parallel stream processing\n# (default = number of cores on your machine):\nparallel.projections=8\n# Local folder with projections, in EDN format, to pre-load on start\n# (default = /tmp/photon):\nfile.path=/path/to/edn-files/\n# DB backend plugin to use, several options currently available:\ndb.backend={file,mongodb,riak,cassandra}\n# Depending on the backend, you'll need to set up the DB plugin:\ncassandra.ip=127.0.0.1\nfile.path=/path/to/file.json\nmongodb.host=localhost\nriak.default_bucket=photon-eventstore-v1\nriak.node.1=riak1.yourdomain.com\nriak.node.2=riak2.yourdomain.com\nriak.node.3=riak3.yourdomain.com\n```\n\n### Muon schemas\n\nThe endpoints and expected schemas to interact with `photon` can be found [here](doc/schemas.md).\n\n### Testing\n\nTests are run by executing\n\n```\nlein midje\n```\n\nTo run the test suite from the REPL:\n\n```bash\nlein repl\n=\u003e (use 'midje.sweet)\n=\u003e (autotest)\n```\n\nAlternatively, create a test photon client to interact with photon:\n\n```bash\nlein new muon-clojure photon-test-client\n```\n\n### Profiling\n\nIn order to achieve the best performance and thoughput, photon has been intensively tested and profiled with the [YourKit](https://www.yourkit.com) profiler, with a license kindly provided by their creators as part of their support to the open source community.\n\nimage:https://www.yourkit.com/images/yklogo.png[YourKit logo]\n\nYourKit supports open source projects with its full-featured Java Profiler.\nYourKit, LLC is the creator of \u003ca href=\"https://www.yourkit.com/java/profiler/index.jsp\"\u003eYourKit Java Profiler\u003c/a\u003e\nand \u003ca href=\"https://www.yourkit.com/.net/profiler/index.jsp\"\u003eYourKit .NET Profiler\u003c/a\u003e,\ninnovative and intelligent tools for profiling Java and .NET applications.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuoncore%2Fphoton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuoncore%2Fphoton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuoncore%2Fphoton/lists"}